/* ============================================================
   Sidebar — Lilac Design System
   ============================================================ */

/* ── body offset ─────────────────────────────────────────── */
body.has-sidebar {
    padding-left: 56px;
    transition: padding-left 0.25s cubic-bezier(0.4,0,0.2,1);
}
body.has-sidebar.sidebar-expanded { padding-left: 260px; }
@media (max-width: 900px) {
    body.has-sidebar,
    body.has-sidebar.sidebar-expanded { padding-left: 0 !important; }
}

/* ── sidebar shell ───────────────────────────────────────── */
.nav-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 56px;
    background: #0A0A10;
    border-right: 1px solid rgba(176,124,255,0.08);
    z-index: 200; overflow-y: auto; overflow-x: hidden;
    display: flex; flex-direction: column;
    transition: width 0.25s cubic-bezier(0.4,0,0.2,1);
    scrollbar-width: thin; scrollbar-color: transparent transparent;
}
.nav-sidebar:hover { scrollbar-color: rgba(176,124,255,0.18) transparent; }
.nav-sidebar::-webkit-scrollbar { width: 3px; }
.nav-sidebar::-webkit-scrollbar-track { background: transparent; }
.nav-sidebar::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
.nav-sidebar:hover::-webkit-scrollbar-thumb { background: rgba(176,124,255,0.18); }
.nav-sidebar::-webkit-scrollbar-thumb:hover { background: rgba(176,124,255,0.35); }
.nav-sidebar.expanded { width: 260px; }

/* Subtle top glow on expanded */
.nav-sidebar.expanded::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 120px;
    background: radial-gradient(ellipse at 50% 0%, rgba(176,124,255,0.06) 0%, transparent 70%);
    pointer-events: none; z-index: 0;
}

/* mobile */
@media (max-width: 900px) {
    .nav-sidebar {
        width: 280px; transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    }
    .nav-sidebar.open { transform: translateX(0); }
    .nav-sidebar.expanded { width: 280px; }
}
.nav-sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 199;
    opacity: 0; visibility: hidden; transition: all 0.3s; pointer-events: none;
    backdrop-filter: blur(4px);
}
.nav-sidebar-backdrop.open { opacity: 1; visibility: visible; pointer-events: auto; }

/* ── sections ────────────────────────────────────────────── */
.sb-section { padding: 6px 0; position: relative; z-index: 1; }
.nav-sidebar.expanded .sb-section { padding: 10px 0; }
.sb-section + .sb-section { border-top: 1px solid rgba(176,124,255,0.06); }

.sb-section-title {
    font-size: 9px; font-weight: 800; color: rgba(176,124,255,0.45);
    text-transform: uppercase; letter-spacing: 2px;
    margin-bottom: 8px; display: none; align-items: center; gap: 8px;
}
.nav-sidebar.expanded .sb-section-title { display: flex; padding: 0 14px; }
.sb-section-title .count {
    background: rgba(176,124,255,0.15); color: #B07CFF;
    font-size: 9px; padding: 2px 6px; border-radius: 10px;
    font-weight: 700; min-width: 18px; text-align: center;
}

/* ── nav links ───────────────────────────────────────────── */
.sb-links { display: flex; flex-direction: column; gap: 1px; padding: 0 6px; }
.nav-sidebar.expanded .sb-links { padding: 0 8px; }

.sb-link {
    display: flex; align-items: center; gap: 10px; padding: 9px 0;
    border-radius: 8px; color: var(--text-muted);
    text-decoration: none; font-size: 12px; font-weight: 600;
    transition: all 0.2s; justify-content: center;
    white-space: nowrap; overflow: hidden; position: relative;
}
.nav-sidebar.expanded .sb-link { padding: 8px 12px; justify-content: flex-start; }
.sb-link:hover {
    background: rgba(176,124,255,0.06); color: var(--text-secondary);
}
/* Active: lilac accent bar on left + tinted bg */
.sb-link.active {
    color: #B07CFF; background: rgba(176,124,255,0.08);
}
.sb-link.active::before {
    content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px;
    background: linear-gradient(180deg, #B07CFF, #8B5CF6);
    border-radius: 0 3px 3px 0;
}
.nav-sidebar:not(.expanded) .sb-link.active::before {
    left: -6px;
}
.sb-link .link-icon {
    font-size: 16px; width: 20px; text-align: center; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    opacity: 0.6; transition: opacity 0.2s;
}
.sb-link:hover .link-icon, .sb-link.active .link-icon { opacity: 1; }
.sb-link-text { display: none; }
.nav-sidebar.expanded .sb-link-text { display: inline; }

/* ── nav group / submenu ─────────────────────────────────── */
.sb-nav-group { position: relative; }
.sb-group-toggle { cursor: pointer; background: none; border: none; width: 100%; }
.sb-group-arrow {
    display: none; margin-left: auto; font-size: 10px;
    color: rgba(176,124,255,0.35); transition: transform 0.2s;
}
.nav-sidebar.expanded .sb-group-arrow { display: inline; }
.sb-nav-group.open .sb-group-arrow { transform: rotate(90deg); color: rgba(176,124,255,0.6); }

.sb-sub-links {
    display: none; flex-direction: column; gap: 0;
    overflow: hidden; transition: all 0.2s;
    margin-left: 14px; padding-left: 10px;
    border-left: 1px solid rgba(176,124,255,0.08);
}
.sb-nav-group.open .sb-sub-links { display: flex; }
.nav-sidebar:not(.expanded) .sb-sub-links { display: none !important; }

.sb-sub-link {
    font-size: 11px; padding: 5px 10px !important;
    color: var(--text-muted); border-radius: 6px;
}
.sb-sub-link:hover { color: var(--text-secondary); background: rgba(176,124,255,0.04); }
.sb-sub-link.active { color: #B07CFF; }
.sb-sub-link .link-icon { width: 16px; }
.sb-sub-link .link-icon svg { width: 13px; height: 13px; }

/* ── tournament items ────────────────────────────────────── */
.sb-t-item {
    display: flex; align-items: center; gap: 10px; padding: 7px 0;
    border-radius: 8px; cursor: pointer; transition: all 0.2s;
    margin-bottom: 1px; justify-content: center;
}
.nav-sidebar.expanded .sb-t-item { padding: 7px 12px; justify-content: flex-start; }
.sb-t-item:hover { background: rgba(176,124,255,0.06); }

.sb-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.nav-sidebar.expanded .sb-dot { width: 7px; height: 7px; }
.sb-dot.live {
    background: #F87171; box-shadow: 0 0 8px rgba(248,113,113,0.5);
    animation: sb-pulse 2s infinite;
}
.sb-dot.checkin { background: #FBBF24; box-shadow: 0 0 6px rgba(251,191,36,0.4); }
.sb-dot.open { background: #34D399; }
.sb-dot.completed { background: var(--text-muted); opacity: 0.5; }
@keyframes sb-pulse { 0%,100% { opacity:1; } 50% { opacity:0.4; } }

.sb-t-info { flex: 1; min-width: 0; display: none; }
.nav-sidebar.expanded .sb-t-info { display: block; }
.sb-t-name {
    font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.85);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sb-t-meta { font-size: 10px; color: var(--text-muted); margin-top: 1px; }

.sb-t-status {
    font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
    flex-shrink: 0; padding: 2px 6px; border-radius: 4px; display: none;
}
.nav-sidebar.expanded .sb-t-status { display: inline-block; }
.sb-t-status.live { color: #F87171; background: rgba(248,113,113,0.12); }
.sb-t-status.checkin { color: #FBBF24; background: rgba(251,191,36,0.10); }
.sb-t-status.open { color: #34D399; background: rgba(52,211,153,0.10); }
.sb-t-status.completed { color: var(--text-muted); background: rgba(255,255,255,0.04); }

/* ── empty / loading ─────────────────────────────────────── */
.sb-empty {
    color: var(--text-muted); font-size: 11px; padding: 8px 4px;
    text-align: center; white-space: nowrap; overflow: hidden; opacity: 0.6;
}
.nav-sidebar.expanded .sb-empty { padding: 8px 14px; text-align: left; }
