/* =============================================================
   GPHI Global Navigation Stylesheet — nav.css
   Self-contained. Works on all pages regardless of CSS variables.
   ============================================================= */

/* ---- Header ---- */
#header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 80px;
    background: rgba(255,255,255,.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
    z-index: 1000;
    transition: box-shadow .3s ease, border-color .3s ease;
}
#header.scrolled {
    box-shadow: 0 4px 16px rgba(0,0,0,.10), 0 1px 4px rgba(0,0,0,.06);
    border-bottom-color: #cbd5e1;
}
.header-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 32px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

/* ---- Logo ---- */
.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: #1e3a8a;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    letter-spacing: -0.4px;
    transition: color .2s ease;
}
.logo:hover { color: #2563eb; }
.logo-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

/* ---- Nav wrapper ---- */
#navigation {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* ---- Plain nav links (Blog, FAQ) ---- */
#navigation > .nav-link {
    color: #334155;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    padding: 8px 13px;
    border-radius: 8px;
    transition: color .18s ease, background .18s ease;
    position: relative;
    white-space: nowrap;
}
#navigation > .nav-link:hover {
    color: #2563eb;
    background: #eff6ff;
}
/* Kill the underline pseudo-element some pages add */
#navigation > .nav-link::after { display: none !important; }

/* ---- CTA button ---- */
#navigation > .cta-button {
    background: #2563eb;
    color: #ffffff !important;
    padding: 10px 22px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
    white-space: nowrap;
    margin-left: 8px;
    border: none;
    cursor: pointer;
}
#navigation > .cta-button:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37,99,235,.35);
}
#navigation > .cta-button::after { display: none !important; }

/* ---- Dropdown wrapper ---- */
.nav-dropdown { position: relative; }

/* ---- Dropdown toggle ---- */
.nav-dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Poppins', -apple-system, sans-serif;
    color: #334155;
    font-weight: 500;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 13px;
    border-radius: 8px;
    transition: color .18s ease, background .18s ease;
    white-space: nowrap;
    line-height: 1.5;
}
.nav-dropdown-toggle:hover {
    color: #2563eb;
    background: #eff6ff;
}
.nav-dropdown-toggle::after { display: none !important; }

/* Arrow */
.nav-arrow {
    font-size: 11px;
    opacity: .65;
    transition: transform .2s ease, opacity .2s ease;
    pointer-events: none;
}
.nav-dropdown.open .nav-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

/* ---- Dropdown panel ---- */
.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 8px;
    padding-top: 14px; /* fills the gap so hover doesn't break */
    min-width: 215px;
    box-shadow:
        0 10px 30px rgba(15,23,42,.12),
        0 2px 8px rgba(15,23,42,.06);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    /* delay the hide so mouse has time to reach menu items */
    transition: opacity .15s ease .25s, visibility .15s ease .25s, transform .15s ease .25s;
    z-index: 1100;
}
.nav-dropdown.open .nav-dropdown-menu,
.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
    transition-delay: 0s; /* show immediately */
}

/* ---- Dropdown items ---- */
.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 13px;
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: background .15s ease, color .15s ease;
    white-space: nowrap;
}
.nav-dropdown-item:hover {
    background: #eff6ff;
    color: #2563eb;
}
.nav-dropdown-item .fa-fw {
    color: #94a3b8;
    font-size: 13px;
    width: 16px;
    flex-shrink: 0;
    transition: color .15s ease;
}
.nav-dropdown-item:hover .fa-fw { color: #2563eb; }

/* ---- Mobile menu toggle (hamburger) ---- */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    flex-shrink: 0;
}
.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: #1e293b;
    position: relative;
    transition: background .25s ease;
}
.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: #1e293b;
    transition: transform .25s ease, top .25s ease, bottom .25s ease;
}
.hamburger::before { top: -7px; }
.hamburger::after  { bottom: -7px; }
.mobile-menu-toggle.active .hamburger              { background: transparent; }
.mobile-menu-toggle.active .hamburger::before      { transform: rotate(45deg);  top: 0; }
.mobile-menu-toggle.active .hamburger::after       { transform: rotate(-45deg); bottom: 0; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .mobile-menu-toggle { display: block; }

    #navigation {
        position: fixed;
        top: 80px;
        left: 0; right: 0;
        background: #ffffff;
        flex-direction: column;
        align-items: stretch;
        padding: 12px 16px 20px;
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 8px 24px rgba(15,23,42,.12);
        transform: translateY(-110%);
        opacity: 0;
        visibility: hidden;
        transition: transform .25s cubic-bezier(.4,0,.2,1),
                    opacity .25s ease,
                    visibility .25s ease;
        gap: 2px;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
        z-index: 999;
    }
    #navigation.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    #navigation > .nav-link {
        font-size: 16px;
        padding: 12px 14px;
        border-radius: 8px;
    }

    .nav-dropdown-toggle {
        font-size: 16px;
        padding: 12px 14px;
        width: 100%;
        justify-content: space-between;
        border-radius: 8px;
    }

    /* Mobile dropdown: static, revealed on open */
    .nav-dropdown-menu {
        position: static;
        transform: none !important;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        border: none;
        background: #f8fafc;
        border-radius: 10px;
        padding: 6px;
        pointer-events: auto;
        display: none;
        margin-top: 4px;
    }
    .nav-dropdown.open .nav-dropdown-menu {
        display: block;
        transform: none !important;
    }

    .nav-dropdown-item {
        font-size: 15px;
        padding: 10px 14px;
        border-radius: 8px;
    }

    #navigation > .cta-button {
        margin-left: 0;
        margin-top: 8px;
        text-align: center;
        display: block;
        padding: 14px 22px;
        font-size: 16px;
        border-radius: 10px;
    }
}

@media (max-width: 480px) {
    .header-container { padding: 0 16px; }
    .logo-text { display: none; }
}

/* ---- Desktop: right-edge overflow prevention ---- */
@media (min-width: 901px) {
    .nav-dropdown:last-of-type .nav-dropdown-menu,
    .nav-dropdown:nth-last-of-type(2) .nav-dropdown-menu {
        left: auto;
        right: 0;
        transform: translateY(-6px);
    }
    .nav-dropdown:last-of-type:hover .nav-dropdown-menu,
    .nav-dropdown:nth-last-of-type(2):hover .nav-dropdown-menu,
    .nav-dropdown.open:last-of-type .nav-dropdown-menu,
    .nav-dropdown.open:nth-last-of-type(2) .nav-dropdown-menu {
        transform: translateY(0);
        transition-delay: 0s;
    }
}

/* ---- Prevent horizontal page overflow ---- */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}
