/* ═══════════════════════════════════════════════
   AZ KONNECT — Global Header / Footer System CSS
   ═══════════════════════════════════════════════ */

/* ── Design Tokens (match existing :root) ── */
:root {
    --az-navy: #05165B;
    --az-navy-deep: #020C2E;
    --az-accent: #4A9EFF;
    --az-accent-dim: rgba(74, 158, 255, .12);
    --az-text: rgba(255, 255, 255, .94);
    --az-text-mid: rgba(255, 255, 255, .60);
    --az-text-dim: rgba(255, 255, 255, .35);
    --az-glass: rgba(255, 255, 255, .03);
    --az-glass-border: rgba(255, 255, 255, .08);
    --az-nav-height: 72px;
    --az-max-w: 1120px;
}

/* ══════════════════════════════════════
   1. HEADER / NAVBAR
   ══════════════════════════════════════ */
.az-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    height: var(--az-nav-height);
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background .35s ease, border-color .35s ease, box-shadow .35s ease;
}

.az-header.scrolled {
    background: rgba(2, 12, 46, .82);
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    border-bottom-color: rgba(255, 255, 255, .06);
    box-shadow: 0 4px 30px rgba(0, 0, 0, .25);
}

.az-header-inner {
    max-width: var(--az-max-w);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(16px, 4vw, 40px);
}

/* ── Logo ── */
.az-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--az-text);
    flex-shrink: 0;
    z-index: 10;
}

.az-logo-mark {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.az-logo-mark svg {
    width: 100%;
    height: 100%;
}

.az-logo-wordmark {
    font-weight: 800;
    font-size: 17px;
    letter-spacing: -.01em;
}

.az-logo-wordmark span {
    color: var(--az-accent);
}

/* ── Desktop Nav Links ── */
.az-nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.az-nav-item {
    position: relative;
}

.az-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    color: var(--az-text-mid);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .02em;
    border-radius: 8px;
    transition: color .2s, background .2s;
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    white-space: nowrap;
}

.az-nav-link:hover,
.az-nav-link:focus-visible {
    color: var(--az-text);
    background: rgba(255, 255, 255, .04);
}

.az-nav-link:focus-visible {
    outline: 2px solid var(--az-accent);
    outline-offset: 2px;
}

/* Active nav link highlight */
.az-nav-link.az-active {
    color: var(--az-text);
    background: rgba(74, 158, 255, .08);
}

.az-mobile-link.az-active {
    color: var(--az-accent);
}

.az-nav-link .chevron {
    width: 10px;
    height: 10px;
    transition: transform .25s ease;
}

.az-nav-link[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
}

/* ── CTA Button ── */
.az-nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: linear-gradient(135deg, var(--az-accent), #6DC0FF);
    color: var(--az-navy-deep);
    font-size: 13px;
    font-weight: 700;
    border-radius: 10px;
    text-decoration: none;
    letter-spacing: .01em;
    box-shadow: 0 4px 18px rgba(74, 158, 255, .25);
    transition: transform .25s, box-shadow .25s;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.az-nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(74, 158, 255, .4);
}

.az-nav-cta:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.az-nav-cta .arrow {
    transition: transform .2s;
}

.az-nav-cta:hover .arrow {
    transform: translateX(3px);
}

/* ── Hamburger (mobile) ── */
.az-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    border: none;
    background: none;
    cursor: pointer;
    z-index: 9010;
    border-radius: 8px;
    transition: background .2s;
}

.az-hamburger:hover {
    background: rgba(255, 255, 255, .06);
}

.az-hamburger:focus-visible {
    outline: 2px solid var(--az-accent);
    outline-offset: 2px;
}

.az-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--az-text);
    border-radius: 2px;
    transition: transform .3s ease, opacity .3s ease;
    transform-origin: center;
}

.az-hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.az-hamburger.active span:nth-child(2) {
    opacity: 0;
}

.az-hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ══════════════════════════════════════
   2. DROPDOWN MENUS (Desktop)
   ══════════════════════════════════════ */

/* Parent nav item with dropdown */
.az-has-dropdown {
    position: relative;
}

/* The dropdown container */
.az-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    min-width: 220px;
    list-style: none;
    margin: 0;
    padding: 8px 0;
    background: rgba(5, 22, 91, .94);
    backdrop-filter: blur(40px) saturate(1.6);
    -webkit-backdrop-filter: blur(40px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 14px;
    box-shadow:
        0 16px 48px rgba(0, 0, 0, .45),
        0 0 0 1px rgba(74, 158, 255, .06) inset;

    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease, visibility .22s;
    z-index: 9001;
}

/* Invisible bridge so cursor can travel from trigger to dropdown */
.az-dropdown::before {
    content: '';
    position: absolute;
    top: -14px;
    left: 0;
    right: 0;
    height: 14px;
}

/* Show dropdown on hover of parent item */
.az-has-dropdown:hover > .az-dropdown,
.az-has-dropdown:focus-within > .az-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

/* Rotate chevron on hover */
.az-has-dropdown:hover > .az-nav-link .chevron,
.az-has-dropdown:focus-within > .az-nav-link .chevron {
    transform: rotate(180deg);
}

/* Individual dropdown link */
.az-dropdown-link {
    display: block;
    padding: 10px 20px;
    color: var(--az-text-mid);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: .01em;
    white-space: nowrap;
    transition: color .18s ease, background .18s ease, padding-left .18s ease;
    border-radius: 0;
    position: relative;
}

.az-dropdown-link:hover {
    color: #fff;
    background: rgba(74, 158, 255, .10);
    padding-left: 24px;
}

.az-dropdown-link:focus-visible {
    outline: 2px solid var(--az-accent);
    outline-offset: -2px;
}

/* Accent bar on hover */
.az-dropdown-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 18px;
    border-radius: 0 3px 3px 0;
    background: var(--az-accent);
    transition: transform .18s ease;
}

.az-dropdown-link:hover::before {
    transform: translateY(-50%) scaleY(1);
}

/* Active state for dropdown link matching current page */
.az-dropdown-link.az-active {
    color: var(--az-accent);
    background: rgba(74, 158, 255, .06);
}

.az-dropdown-link.az-active::before {
    transform: translateY(-50%) scaleY(1);
}

/* ══════════════════════════════════════
   3. MOBILE DRAWER
   ══════════════════════════════════════ */
.az-mobile-overlay {
    position: fixed;
    inset: 0;
    z-index: 8999;
    background: rgba(2, 12, 46, .55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

.az-mobile-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.az-mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(360px, calc(100vw - 48px));
    z-index: 9005;
    background: rgba(3, 14, 52, .96);
    backdrop-filter: blur(40px) saturate(1.5);
    -webkit-backdrop-filter: blur(40px) saturate(1.5);
    border-left: 1px solid rgba(255, 255, 255, .06);
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.4, 0, .2, 1);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0;
}

.az-mobile-drawer.active {
    transform: translateX(0);
}

.az-mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--az-nav-height);
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.az-mobile-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255, 255, 255, .05);
    border-radius: 8px;
    cursor: pointer;
    color: var(--az-text-mid);
    font-size: 18px;
    transition: background .2s, color .2s;
}

.az-mobile-close:hover {
    background: rgba(255, 255, 255, .1);
    color: var(--az-text);
}

.az-mobile-close:focus-visible {
    outline: 2px solid var(--az-accent);
    outline-offset: 2px;
}

.az-mobile-nav {
    padding: 16px 0;
    list-style: none;
    margin: 0;
}

.az-mobile-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 24px;
    color: var(--az-text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: background .2s;
}

.az-mobile-link:hover {
    background: rgba(255, 255, 255, .04);
}

.az-mobile-link:focus-visible {
    outline: 2px solid var(--az-accent) inset;
}

.az-mobile-link .chevron {
    width: 12px;
    height: 12px;
    transition: transform .25s ease;
    color: var(--az-text-dim);
}

.az-mobile-link[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
}

/* Accordion panels */
.az-mobile-accordion {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s cubic-bezier(.4, 0, .2, 1);
    background: rgba(0, 0, 0, .15);
}

.az-mobile-accordion.open {
    max-height: 600px;
}

.az-mobile-accordion a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px 12px 40px;
    font-size: 14px;
    color: var(--az-text-mid);
    text-decoration: none;
    transition: color .2s, background .2s;
}

.az-mobile-accordion a:hover {
    color: var(--az-text);
    background: rgba(255, 255, 255, .03);
}

.az-mobile-accordion a:focus-visible {
    outline: 2px solid var(--az-accent) inset;
}

.az-mobile-accordion .acc-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--az-accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.az-mobile-accordion .acc-icon svg {
    width: 14px;
    height: 14px;
    color: var(--az-accent);
}

.az-mobile-cta-wrap {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.az-mobile-cta-wrap .az-nav-cta {
    width: 100%;
    justify-content: center;
    padding: 14px 24px;
    font-size: 14px;
}

/* ══════════════════════════════════════
   4. FOOTER
   ══════════════════════════════════════ */
.az-footer {
    position: relative;
    padding: 80px 24px 0;
    background: linear-gradient(180deg, var(--az-navy-deep) 0%, rgba(2, 8, 32, 1) 100%);
    border-top: 1px solid rgba(255, 255, 255, .04);
    overflow: hidden;
}

.az-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 300px;
    background: radial-gradient(ellipse, rgba(74, 158, 255, .04) 0%, transparent 70%);
    pointer-events: none;
}

.az-footer-inner {
    max-width: var(--az-max-w);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 56px;
    position: relative;
    z-index: 2;
}

.az-footer-brand {
    max-width: 280px;
}

.az-footer-brand .az-logo {
    margin-bottom: 16px;
}

.az-footer-tagline {
    font-size: 14px;
    line-height: 1.7;
    color: var(--az-text-dim);
}

/* Footer columns */
.az-footer-col h6 {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--az-accent);
    margin-bottom: 20px;
}

.az-footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.az-footer-col li {
    margin-bottom: 10px;
}

.az-footer-col a {
    font-size: 13px;
    color: var(--az-text-mid);
    text-decoration: none;
    transition: color .2s;
}

.az-footer-col a:hover {
    color: var(--az-text);
}

.az-footer-col a:focus-visible {
    outline: 2px solid var(--az-accent);
    outline-offset: 2px;
}

/* Bottom bar */
.az-footer-bottom {
    max-width: var(--az-max-w);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, .06);
    position: relative;
    z-index: 2;
}

.az-footer-copy {
    font-size: 12px;
    color: var(--az-text-dim);
}

.az-footer-legal {
    display: flex;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.az-footer-legal a {
    font-size: 12px;
    color: var(--az-text-dim);
    text-decoration: none;
    transition: color .2s;
}

.az-footer-legal a:hover {
    color: var(--az-text);
}

.az-footer-legal a:focus-visible {
    outline: 2px solid var(--az-accent);
    outline-offset: 2px;
}

/* ══════════════════════════════════════
   5. RESPONSIVE
   ══════════════════════════════════════ */
@media (max-width: 960px) {
    .az-nav-links {
        display: none;
    }
    .az-nav-cta.desktop-only {
        display: none;
    }
    .az-hamburger {
        display: flex;
    }
    .az-dropdown {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .az-footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 36px;
    }
    .az-footer-brand {
        grid-column: 1 / -1;
        max-width: 100%;
    }
    .az-footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    .az-footer-legal {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .az-footer-inner {
        grid-template-columns: 1fr;
    }
    .az-mobile-drawer {
        width: 100vw;
    }
}

/* ══════════════════════════════════════
   6. REDUCED MOTION
   ══════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .az-header,
    .az-dropdown,
    .az-dropdown-link,
    .az-mobile-drawer,
    .az-mobile-overlay,
    .az-nav-link,
    .az-nav-cta,
    .az-mobile-accordion,
    .az-hamburger span {
        transition-duration: 0.01ms !important;
    }
}
