﻿/* shared-nav.css v7.3 — Clean rewrite */

/* ── NAVBAR ─────────────────────────────────────────────────────── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    width: 100%;
    height: 64px;
    margin: 0;
    padding: 0;
}

/* Компенсация fixed навбара на всех экранах */
body {
    padding-top: 64px;
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
}

.nav-content {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 20px;
}

/* ── LOGO ────────────────────────────────────────────────────────── */
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon { font-size: 22px; }

.logo-text {
    font-size: 16px;
    font-weight: 800;
    color: #f1f5f9;
    white-space: nowrap;
}

/* ── DESKTOP NAV LINKS ───────────────────────────────────────────── */
.nav-links {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
    margin: 0 auto;
}

.nav-item { position: relative; }

.nav-btn {
    background: none;
    border: none;
    color:#e2e8f0;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.nav-btn:hover { color: #f1f5f9; background: rgba(255,255,255,0.06); }
.nav-item.open .nav-btn { color: #06b6d4; background: rgba(6,182,212,0.08); }

.arrow { font-size: 10px; transition: transform 0.2s; }
.nav-item.open .arrow { transform: rotate(180deg); }

/* ── DROPDOWN ────────────────────────────────────────────────────── */
.dropdown {
    display: none;
    position: fixed;
    min-width: 220px;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 8px;
    z-index: 9100;
    box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}

.nav-item.open .dropdown { display: block; }

.dropdown a {
    display: block;
    padding: 10px 14px;
    color:#e2e8f0;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.dropdown a:hover { background: rgba(6,182,212,0.1); color: #f1f5f9; }

/* ── NAV ACTIONS ─────────────────────────────────────────────────── */
.nav-actions {
    display: none;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Stats icon in navbar */
.nav-stats-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(102,126,234,.1);
    border: 1px solid rgba(102,126,234,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.2s;
    flex-shrink: 0;
    cursor: pointer;
}
.nav-stats-icon:hover {
    background: rgba(102,126,234,.2);
    border-color: rgba(102,126,234,.4);
    transform: translateY(-1px);
}

.btn-login {
    padding: 7px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-login:hover { background: rgba(255,255,255,0.12); color: #fff; }

.btn-signup {
    padding: 7px 16px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #06b6d4, #0ea5e9);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-signup:hover { opacity: 0.9; transform: translateY(-1px); }

/* ── MOBILE XP BADGE ─────────────────────────────────────────────── */
.mob-xp-wrap {
    display: none;
    margin-left: auto;
    margin-right: 8px;
}

.mob-xp-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s;
}

.mob-xp-badge:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.25));
    transform: translateY(-1px);
}

.mob-xp-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.mob-xp-val {
    font-size: 16px;
    font-weight: 700;
    color: #fbbf24;
    white-space: nowrap;
}

/* ── BURGER ──────────────────────────────────────────────────────── */
.burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    flex-shrink: 0;
}

.burger span {
    display: block;
    width: 18px;
    height: 2px;
    background: #94a3b8;
    border-radius: 2px;
    transition: all 0.2s;
}

.burger:hover span { background: #f1f5f9; }

/* ── MOBILE OVERLAY ──────────────────────────────────────────────── */
.mob-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    z-index: 9200;
}

.mob-overlay.active { display: block; }

/* ── MOBILE MENU ─────────────────────────────────────────────────── */
.mob-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(340px, 88vw);
    height: 100vh;
    height: 100dvh;
    background: rgba(10, 14, 26, 0.97);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-left: 1px solid rgba(255,255,255,0.08);
    z-index: 9300;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.mob-menu.active { right: 0; }

.mob-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    font-size: 15px;
    font-weight: 700;
    color: #f1f5f9;
    flex-shrink: 0;
}

.mob-header button {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color:#94a3b8;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.mob-header button:hover { background: rgba(239,68,68,0.15); color: #ef4444; }

.mob-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 14px 32px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(6,182,212,0.2) transparent;
}

/* ── MOBILE ACTIONS (login/register) ─────────────────────────────── */
.mob-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.mob-actions .btn-login,
.mob-actions .btn-signup {
    flex: 1;
    text-align: center;
    padding: 12px 16px;
    font-size: 14px;
    border-radius: 14px;
}

.mob-actions .btn-login {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.14);
    color: #e2e8f0;
}

.mob-actions .btn-signup {
    background: linear-gradient(135deg, #06b6d4, #0ea5e9);
    border: none;
    color: #fff;
    font-weight: 700;
}

/* ── MOBILE ACCORDION ────────────────────────────────────────────── */
.mob-acc {
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 4px;
}

.mob-acc-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 16px;
    font-size: 14px;
    font-weight: 600;
    color:#e2e8f0;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s, background 0.15s;
}

.mob-acc-title:hover { color: #f1f5f9; background: rgba(255,255,255,0.04); }
.mob-acc.open .mob-acc-title { color: #38bdf8; }

.mob-arr { font-size: 9px; transition: transform 0.25s; }
.mob-acc.open .mob-arr { transform: rotate(180deg); }

.mob-acc-body {
    display: none;
    padding: 6px 8px 10px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.mob-acc.open .mob-acc-body { display: block; }

.mob-sub {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    color:#e2e8f0;
    text-decoration: none;
    font-size: 14px;
    border-radius: 10px;
    transition: all 0.18s;
    margin-bottom: 2px;
}

.mob-sub:hover {
    background: rgba(6,182,212,0.1);
    color: #e2e8f0;
    transform: translateX(3px);
}

/* ── RESPONSIVE ──────────────────────────────────────────────────── */

/* Desktop: >= 768px */
@media (min-width: 768px) {
    .nav-links { display: flex; }
    .nav-actions { display: flex; }
    .burger { display: none; }
    .mob-menu { display: none !important; }
    .mob-overlay { display: none !important; }
    .mob-xp-wrap { display: none !important; }
}

/* Mobile/Tablet: < 768px */
@media (max-width: 767px) {
    .nav-links { display: none; }
    .nav-actions { display: none; }
    .burger { display: flex; }
    .mob-menu { display: flex; }
    .navbar { position: fixed; top: 0; left: 0; right: 0; }
    .nav-container { padding: 0 12px; }
}
    .logo-text { font-size: 14px; }
    .logo-icon { font-size: 18px; }
    .mob-menu { width: 92vw; }
    .nav-content { gap: 8px; }
    .mob-xp-badge { 
        padding: 6px 10px; 
        gap: 8px;
    }
    .mob-xp-avatar { 
        width: 28px; 
        height: 28px; 
        font-size: 13px;
    }
    .mob-xp-val { 
        font-size: 13px;
    }
    .mob-xp-wrap {
        margin-right: 4px;
    }
    .burger {
        width: 36px;
        height: 36px;
    }
    .burger span {
        width: 16px;
    }
}
