/* ============================================================
   Top Navigation Bar
   Colour: #0f2c44  (--cdre-blue)
   Font:   Inter (--font-primary from typography.css)
   ============================================================ */

/* ── Shell ─────────────────────────────────────────────────── */
.top-nav {
    background: #051e40;
    background-color: #051e40;
    color: #ffffff;
    font-family: var(--font-primary, 'Inter', system-ui, sans-serif);
    font-size: 14px;
    line-height: 1.5;
}

.top-nav,
.top-nav * {
    box-sizing: border-box;
}

/* ── Inner container ────────────────────────────────────────── */
.nav-container {
    max-width: 88rem;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1.5rem;
}

/* ── Logo + links left group ─────────────────────────────────── */
.nav-left {
    display: flex;
    align-items: center;
    gap: 40px;
}

/* ── Logo ────────────────────────────────────────────────────── */
.nav-logo-img {
    height: 42px;
    width: auto;
    display: block;
}

/* ── Desktop links ───────────────────────────────────────────── */
.nav-link {
    color: #6b7280;
    font-size: 12px;
    font-weight: 400;
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s;
    display: inline-flex;
    align-items: center;
    height: 64px;        /* stretch to full nav height so border lands at the bottom */
    padding: 0 4px;
    border-bottom: 2px solid transparent;
}
.nav-link:hover {
    color: #d1d5db;
    border-bottom-color: #9ca3af;
    text-decoration: none;
}
.nav-link.active {
    color: #f3f4f6;
    border-bottom-color: #818cf8;
}

/* ── User dropdown button ────────────────────────────────────── */
#user-menu-button {
    color: #e5e7eb;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}
#user-menu-button:hover {
    color: #ffffff;
}

/* ── Dropdown panel ──────────────────────────────────────────── */
.nav-user-dropdown {
    display: block !important;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 160px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 6px 0;
    z-index: 9999;
}
.nav-user-dropdown--hidden {
    display: none !important;
}
.nav-user-dropdown a {
    display: block;
    padding: 9px 16px;
    color: #374151;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.1s;
}
.nav-user-dropdown a:hover {
    background: #f3f4f6;
    color: #111827;
}

/* ── Hamburger button ────────────────────────────────────────── */
.nav-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e5e7eb;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.15s;
}
.nav-mobile:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ── Mobile drop-down menu ───────────────────────────────────── */
.mobile-menu {
    background: #0c2438;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 0 16px;
}
.mobile-menu a {
    display: block;
    padding: 11px 20px;
    color: #d1d5db;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.1s, color 0.1s;
}
.mobile-menu a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

/* Mobile user section */
.mobile-user {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 8px;
    padding-top: 8px;
}
.mobile-user-name {
    padding: 10px 20px 4px;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Responsive show/hide ─────────────────────────────────────
   Use custom classes instead of Tailwind hidden/md:flex to avoid
   Bootstrap 3 (.hidden { display:none !important }) killing the nav.
   Order matters: base rules first, then media query overrides. */

/* Hamburger button — mobile styles (base, overridden at md+) */
.nav-hamburger {
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #e5e7eb;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.15s;
}
.nav-hamburger:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Desktop-only elements — hidden by default (mobile-first) */
.nav-desktop {
    display: none !important;
}

/* At 768px+: show desktop nav, hide hamburger + mobile menu */
@media (min-width: 768px) {
    .nav-desktop {
        display: flex !important;
    }
    .nav-hamburger,
    .mobile-menu {
        display: none !important;
    }
}
