/* ═══════════════════════════════════════════════════════════════════
   NAVIGATION — Top Bar + Mobile Bottom Tab Bar
   ═══════════════════════════════════════════════════════════════════ */

/* ── Top Navigation Bar ─────────────────────────────────────────── */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    margin: 15px 15px 0;
    border-radius: 16px;
    position: relative;
    z-index: var(--z-nav);
}

/* Gold accent line at top */
.top-nav::before {
    content: '';
    position: absolute;
    top: 0; left: 20px; right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-glow), transparent);
    pointer-events: none;
}

.nav-left, .nav-center, .nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: transform var(--transition-fast);
}

.nav-brand:hover {
    transform: translateY(-1px);
}

.nav-logo-img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.nav-brand-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 1.2px;
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 4px;
}

.nav-center {
    flex: 1;
    justify-content: center;
    max-width: 400px;
}

/* ── Player Avatar ──────────────────────────────────────────────── */
.player-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-surface-active), rgba(212, 175, 55, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--primary-color);
    border: 2px solid rgba(212, 175, 55, 0.4);
    box-shadow: 0 0 15px var(--primary-glow), inset 0 0 10px rgba(212, 175, 55, 0.1);
    flex-shrink: 0;
    animation: glowPulse 4s ease-in-out infinite;
}

.player-info {
    display: flex;
    flex-direction: column;
}

.player-name {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
}

.player-class {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-family: var(--font-body);
    font-weight: 400;
}

.player-title {
    font-size: 0.82rem;
    color: var(--secondary-color);
    font-weight: 600;
}

/* ── XP / Stat Bars ─────────────────────────────────────────────── */
.stat-bar-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-bar {
    width: 100%;
    height: 7px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.8);
}

.stat-fill {
    height: 100%;
    border-radius: 4px;
    transition: width var(--transition-slow);
    position: relative;
}

.xp-fill {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.6), var(--primary-color));
    box-shadow: 0 0 10px var(--primary-color);
}


.energy-fill {
    background: linear-gradient(90deg, var(--success-color), #34d399);
    box-shadow: 0 0 10px var(--success-color);
}

/* ── Currency ───────────────────────────────────────────────────── */
.currency {
    font-weight: 700;
    font-family: var(--font-heading);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    white-space: nowrap;
}

/* ── Desktop Nav Links ──────────────────────────────────────────── */
.nav-links {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid var(--border-color);
}

.nav-link {
    color: var(--text-muted);
    font-size: 1.15rem;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
    background: rgba(212, 175, 55, 0.08);
}

.nav-link.active {
    color: var(--primary-color);
    background: rgba(212, 175, 55, 0.1);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.15);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 2px;
    background: var(--primary-color);
    border-radius: 1px;
}

/* ── User Account Button ────────────────────────────────────────── */
.nav-user-btn {
    position: relative;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.nav-user-btn:hover {
    color: var(--primary-color);
}

.nav-user-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--glass-bg-strong);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 14px;
    padding: 12px;
    min-width: 200px;
    z-index: 9999;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    backdrop-filter: blur(20px);
    animation: fadeInDown 0.15s ease;
}

.nav-user-menu.open {
    display: block;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.nav-user-email {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 4px 6px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    margin-bottom: 8px;
    word-break: break-all;
}

.nav-signout-btn {
    width: 100%;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 8px;
    color: #fca5a5;
    font-size: 0.82rem;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    font-family: var(--font-body);
}

.nav-signout-btn:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* ── Main Content Wrapper ───────────────────────────────────────── */
.main-content {
    flex: 1;
    padding: 0 20px 20px 20px;
    display: flex;
    flex-direction: column;
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE BOTTOM TAB BAR
   ═══════════════════════════════════════════════════════════════════ */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    /* Hide desktop nav links on mobile */
    .nav-links {
        display: none !important;
    }
    .nav-center {
        display: none !important;
    }
    .currency {
        font-size: 0.85rem;
    }

    .top-nav {
        margin: 8px 8px 0;
        padding: 8px 14px;
        border-radius: 14px;
    }

    .player-name { font-size: 0.95rem; }
    .player-class { display: none; }
    .player-title { font-size: 0.72rem; }

    .player-avatar {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }

    .nav-left {
        gap: 10px;
    }

    /* Show bottom nav on mobile */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: var(--z-bottom-nav);
        background: rgba(9, 9, 11, 0.92);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        padding: 6px 8px 8px;
        justify-content: space-around;
        align-items: center;
        box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.5);
    }

    .mobile-bottom-nav::before {
        content: '';
        position: absolute;
        top: 0; left: 15%; right: 15%;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(212,175,55,0.3), transparent);
    }

    .mob-tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 6px 0;
        text-decoration: none;
        color: var(--text-muted);
        font-size: 0.62rem;
        font-family: var(--font-body);
        font-weight: 500;
        letter-spacing: 0.3px;
        text-transform: uppercase;
        transition: color 0.2s, transform 0.2s;
        position: relative;
        min-width: 50px;
        -webkit-tap-highlight-color: transparent;
    }

    .mob-tab i {
        font-size: 1.2rem;
        transition: transform 0.2s;
    }

    .mob-tab:active {
        transform: scale(0.9);
    }

    .mob-tab.active {
        color: var(--primary-color);
    }

    .mob-tab.active i {
        transform: scale(1.1);
        filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.5));
    }

    .mob-tab.active::before {
        content: '';
        position: absolute;
        top: -6px;
        left: 50%;
        transform: translateX(-50%);
        width: 20px;
        height: 3px;
        background: var(--primary-color);
        border-radius: 0 0 3px 3px;
        box-shadow: 0 0 8px var(--primary-glow);
    }
}
