/* ============================================================
   Challenge Circle — nav.css
   Universal top bar. Visible on ALL pages, ALL screen sizes.

   LAYOUT (all screens):
     [Logo]  ←left        right→  [Actions] [Hamburger]

   Desktop adds centre links between logo and actions.
   Mobile shows only logo + icon actions + hamburger.
   ============================================================ */

/* ════════════════════════════════════════════════════════════
   TOP BAR
════════════════════════════════════════════════════════════ */
.site-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 150;
    background: rgba(5,2,10,0.80);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: background 0.3s;
}
.site-nav.scrolled { background: rgba(5,2,10,0.97); }

.nav-inner {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-sizing: border-box;
}


/* ── Logo ────────────────────────────────────────────────── */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.nav-logo-icon {
    width: 36px; height: 36px;
    background: var(--purple);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 16px rgba(139,92,246,0.5);
    flex-shrink: 0;
}
.nav-logo-text {
    font-size: 16px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: #fff;
    line-height: 1;
    white-space: nowrap;
}
.nav-logo-text span { color: var(--purple-light); }


/* ── Centre links (desktop only) ─────────────────────────── */
.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
    /* Does NOT flex:1 — keeps logo pinned left, actions pinned right */
}

.nav-link {
    position: relative;
    font-size: 13px;
    font-weight: 600;
    color: #9ca3af;
    text-decoration: none;
    padding-bottom: 2px;
    transition: color 0.2s;
    white-space: nowrap;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0;
    width: 0; height: 2px;
    background: var(--purple);
    transition: width 0.25s ease;
    border-radius: 2px;
}
.nav-link:hover         { color: #fff; }
.nav-link:hover::after  { width: 100%; }
.nav-link.active        { color: #fff; }
.nav-link.active::after { width: 100%; }
.nav-link-gold          { color: var(--gold) !important; font-weight: 800; }
.nav-link-gold::after   { background: var(--gold); }


/* ── Right-side actions ──────────────────────────────────── */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto; /* pushes to far right even if no centre links */
}

/* Icon button (bell, sidebar-toggle) */
.nav-icon-btn {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: #9ca3af;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}
.nav-icon-btn:hover {
    background: rgba(139,92,246,0.12);
    color: var(--purple-light);
    border-color: rgba(139,92,246,0.3);
}

/* Login text link */
.nav-text-btn {
    font-size: 13px;
    font-weight: 700;
    color: #9ca3af;
    background: none; border: none;
    cursor: pointer; padding: 0;
    transition: color 0.2s;
    font-family: var(--font);
    text-decoration: none;
    white-space: nowrap;
}
.nav-text-btn:hover { color: #fff; }

/* User block (desktop) */
.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
}
.nav-user-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: rgba(139,92,246,0.45);
    border: 2px solid rgba(139,92,246,0.35);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 900; color: #fff;
    flex-shrink: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.nav-user-avatar:hover,
.nav-avatar-touch:hover {
    border-color: rgba(139,92,246,0.7);
    box-shadow: 0 0 10px rgba(139,92,246,0.35);
}
.nav-user-name  { font-size: 13px; font-weight: 700; color: #fff; line-height: 1.2; }
.nav-user-plan  { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }

/* Touch-only avatar (mobile) — hidden on desktop */
.nav-avatar-touch { display: none; }

/* Hamburger */
.hamburger {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: #9ca3af;
    display: none; /* shown by media query */
    align-items: center; justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.hamburger:hover  { background: rgba(255,255,255,0.10); color: #fff; }
.hamburger.is-open {
    background: rgba(139,92,246,0.15);
    color: var(--purple-light);
    border-color: rgba(139,92,246,0.3);
}


/* ════════════════════════════════════════════════════════════
   MOBILE MENU — full-screen slide-down panel
════════════════════════════════════════════════════════════ */
.mobile-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0; right: 0;
    z-index: 149;
    background: rgba(5,2,10,0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(139,92,246,0.12);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.36s cubic-bezier(0.4,0,0.2,1),
                opacity   0.25s ease;
}
.mobile-menu.open {
    max-height: 90vh;
    opacity: 1;
    pointer-events: auto;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(139,92,246,0.3) transparent;
}

/* Menu header row */
.mm-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 16px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mm-user-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(139,92,246,0.45);
    border: 2px solid rgba(139,92,246,0.5);
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 900; color: #fff;
    flex-shrink: 0;
}
.mm-user-info  { flex: 1; min-width: 0; }
.mm-user-name  { font-size: 15px; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-user-plan  { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--purple-light); margin-top: 2px; }
.mm-guest-brand { display: flex; align-items: center; gap: 8px; flex: 1; }
.mm-close {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: #6b7280;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.mm-close:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* Menu body */
.mm-body {
    padding: 8px 10px 28px;
    display: flex;
    flex-direction: column;
}

/* Section labels */
.mm-section-label {
    font-size: 9px; font-weight: 900;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    padding: 12px 10px 4px;
}

/* Divider */
.mm-divider {
    height: 1px;
    background: rgba(255,255,255,0.05);
    margin: 6px 0;
}

/* Menu items */
.mm-item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px 10px;
    border-radius: 12px;
    font-size: 15px; font-weight: 600;
    color: #9ca3af;
    text-decoration: none;
    background: none; border: none;
    cursor: pointer; font-family: var(--font);
    transition: background 0.15s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.mm-item:active            { transform: scale(0.97); }
.mm-item:hover             { background: rgba(255,255,255,0.05); color: #fff; }
.mm-item.mm-active         { background: rgba(139,92,246,0.12); color: var(--purple-light); }
.mm-item.mm-gold           { color: var(--gold); }
.mm-item.mm-gold:hover     { background: rgba(245,158,11,0.08); }
.mm-item.mm-highlight      { color: var(--purple-light); font-weight: 800; }
.mm-item.mm-danger         { color: #6b7280; }
.mm-item.mm-danger:hover   { color: #f87171; background: rgba(248,113,113,0.06); }

/* Item icon box */
.mm-icon {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}
.mm-item.mm-active   .mm-icon { background: rgba(139,92,246,0.2); }
.mm-item.mm-gold     .mm-icon { background: rgba(245,158,11,0.1); }
.mm-item.mm-highlight.mm-icon { background: rgba(139,92,246,0.15); }
.mm-item.mm-danger   .mm-icon { background: rgba(255,255,255,0.03); }

/* Backdrop */
.mobile-menu-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 148;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.mobile-menu-backdrop.visible { display: block; opacity: 1; }


/* ════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
════════════════════════════════════════════════════════════ */

/* ── >1024px: full desktop nav ───────────────────────────── */
@media (min-width: 1025px) {
    .nav-links         { display: flex; }
    .nav-desktop-only  { display: flex !important; }
    .nav-avatar-touch  { display: none !important; }
    .hamburger         { display: none !important; }
    .mobile-menu       { display: none !important; }
    .mobile-menu-backdrop { display: none !important; }
}

/* ── 901–1024px: logo + actions + hamburger, no centre links */
@media (max-width: 1024px) and (min-width: 901px) {
    .nav-links         { display: none; }
    .nav-desktop-only  { display: none !important; }
    .nav-avatar-touch  { display: none !important; }
    .hamburger         { display: flex; }
}

/* ── ≤900px: mobile — logo + icons + hamburger ───────────── */
@media (max-width: 900px) {
    :root { --nav-height: 60px; }
    .site-nav          { display: flex !important; width: 100% !important; height: 60px; }
    .nav-inner         { padding: 0 14px; gap: 8px; width: 100%; }
    .nav-logo-text     { font-size: 13px; letter-spacing: -0.03em; }
    .nav-logo-icon     { width: 32px; height: 32px; border-radius: 9px; }

    .nav-links         { display: none !important; }
    .nav-desktop-only  { display: none !important; }
    .nav-avatar-touch  { display: flex; }
    .hamburger         { display: flex; }
    .nav-icon-btn      { display: flex; }
}

/* ── ≤380px: tiny phones — hide logo text, show icon only ── */
@media (max-width: 380px) {
    .nav-logo-text { display: none; }
}

/* ── Pages using the old .has-mobile-header wrapper ─────── */
/* The top nav is now always 80px, so all pages just need that clearance */
.has-mobile-header { padding-top: var(--nav-height) !important; }