/* ============================================
   sidebar.css — Premium Glassmorphism Sidebar
   Collapsed: 72px | Expanded on hover: 260px
   ============================================ */

/* ===== SIDEBAR CONTAINER ===== */
.sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 72px;
    background: rgba(9, 28, 31, 0.8);
    backdrop-filter: blur(32px) saturate(180%);
    -webkit-backdrop-filter: blur(32px) saturate(180%);
    border-right: 1px solid var(--glass-border);
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    overflow: hidden;
    display: flex; flex-direction: column;
}
.sidebar:hover { width: 260px; }

/* Scrollbar hidden but functional */
.sidebar::-webkit-scrollbar { width: 0; }
.sidebar { scrollbar-width: none; }

/* ===== SIDEBAR HEADER ===== */
.sidebar-header {
    padding: 18px 18px 14px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--glass-border);
    display: flex; align-items: center; gap: 14px;
    white-space: nowrap;
}

/* Make the header sidebar-item (generated by nav.js) behave as flex row */
.sidebar-header .sidebar-item {
    display: flex; align-items: center; gap: 14px;
    padding: 0; margin: 0;
    border: none; border-left: none; border-radius: 0;
    background: none; color: var(--text);
    cursor: pointer;
}
.sidebar-header .sidebar-item:hover {
    background: none;
}
.sidebar-header .sidebar-item::before {
    display: none;
}

/* ===== LOGO (emoji icon in header) ===== */
.sidebar-logo {
    width: 38px; height: 38px; border-radius: 11px;
    background: linear-gradient(145deg, var(--primary), var(--primary-light));
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(30, 82, 87, 0.4), inset 0 1px 0 rgba(255,255,255,0.1);
}
.sidebar-logo svg {
    width: 20px; height: 20px;
    stroke: var(--accent); fill: none; stroke-width: 2;
}

/* Header icon slot — style the emoji as a pseudo-logo */
.sidebar-header .sidebar-item .icon,
.sidebar-header .sidebar-item .sidebar-icon {
    width: 38px; height: 38px; border-radius: 11px;
    background: linear-gradient(145deg, var(--primary), var(--primary-light));
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(30, 82, 87, 0.4), inset 0 1px 0 rgba(255,255,255,0.1);
    font-size: 18px; min-width: 38px; text-align: center;
    line-height: 1;
}

/* ===== BRAND TEXT ===== */
.sidebar-brand {
    opacity: 0;
    transition: opacity 0.25s ease;
}
.sidebar:hover .sidebar-brand { opacity: 1; }

.sidebar-brand-name {
    font-size: 15px; font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}
.sidebar-brand-sub {
    font-size: 10px; color: var(--text-muted);
    font-weight: 600; letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Header label — behave like brand text */
.sidebar-header .sidebar-item .label,
.sidebar-header .sidebar-item .sidebar-label {
    font-size: 15px; font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    opacity: 0;
    transition: opacity 0.25s ease;
}
.sidebar:hover .sidebar-header .sidebar-item .label,
.sidebar:hover .sidebar-header .sidebar-item .sidebar-label {
    opacity: 1;
}

/* ===== NAV SECTION ===== */
.sidebar-nav {
    padding: 16px 10px;
    flex: 1;
    overflow-y: auto;
}
.sidebar-nav::-webkit-scrollbar { width: 0; }
.sidebar-nav { scrollbar-width: none; }

/* ===== NAV ITEMS ===== */
.sidebar-item {
    display: flex; align-items: center; gap: 14px;
    padding: 8px 14px; margin-bottom: 1px;
    color: var(--text-secondary);
    cursor: pointer; white-space: nowrap;
    border-radius: 12px;
    transition: all 0.2s ease;
    position: relative;
    border: none;
}
.sidebar-item:hover {
    background: rgba(255,255,255,0.04);
    color: var(--text);
}

/* Active state — accent bar + glow */
.sidebar-item.active {
    color: var(--accent);
    background: var(--accent-soft);
}
.sidebar-item.active::before {
    content: ''; position: absolute;
    left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 22px;
    border-radius: 0 4px 4px 0;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(241, 135, 21, 0.4);
}

/* ===== ICON SLOTS ===== */
/* New .sidebar-icon class (for future SVG icons) */
.sidebar-icon {
    width: 22px; height: 22px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.sidebar-icon svg {
    width: 20px; height: 20px;
    stroke: currentColor; fill: none;
    stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
}

/* Legacy .icon class (used by current nav.js with emoji) */
.sidebar-item .icon {
    font-size: 20px; min-width: 22px; width: 22px;
    text-align: center; flex-shrink: 0;
    line-height: 1;
}

/* ===== LABELS ===== */
/* New .sidebar-label class */
.sidebar-label {
    font-size: 13.5px; font-weight: 500;
    opacity: 0;
    transition: opacity 0.2s ease 0.05s;
}
.sidebar:hover .sidebar-label { opacity: 1; }

/* Legacy .label class (used by current nav.js) */
.sidebar-item .label {
    font-size: 13.5px; font-weight: 500;
    opacity: 0;
    transition: opacity 0.2s ease 0.05s;
}
.sidebar:hover .sidebar-item .label { opacity: 1; }

/* ===== DIVIDERS ===== */
.sidebar-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 6px 18px;
    opacity: 0;
    transition: opacity 0.25s;
}
.sidebar:hover .sidebar-divider { opacity: 1; }

/* ===== SUB-NAVIGATION ===== */
.sidebar-sub {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar:hover .sidebar-sub { max-height: 300px; }

.sidebar-sub .sidebar-item {
    padding: 6px 14px 6px 28px;
}
.sidebar-sub .sidebar-icon svg {
    width: 16px; height: 16px; opacity: 0.5;
}
.sidebar-sub .sidebar-item .icon {
    font-size: 15px; min-width: 20px; width: 20px;
    opacity: 0.5;
}
.sidebar-sub .sidebar-item:hover .icon,
.sidebar-sub .sidebar-item:hover .sidebar-icon svg {
    opacity: 1;
}
.sidebar-sub .sidebar-item .label {
    font-size: 13px;
}
.sidebar-sub .sidebar-item .sidebar-label {
    font-size: 13px;
}
.sidebar-sub .sidebar-item.active .icon,
.sidebar-sub .sidebar-item.active .sidebar-icon svg {
    opacity: 1;
}

/* ===== HAMBURGER (mobile) ===== */
.hamburger {
    display: none;
    position: fixed; top: 12px; left: 12px; z-index: 200;
    background: rgba(9, 28, 31, 0.8);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 10px; padding: 8px 12px;
    cursor: pointer; color: var(--text); font-size: 20px;
}

/* ===== SIDEBAR OVERLAY (mobile) ===== */
.sidebar-overlay,
#sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 90;
}
.sidebar-overlay.open,
#sidebar-overlay.open {
    display: block;
}

/* ===== MOBILE OPEN STATE ===== */
.sidebar.open {
    width: 260px;
}
.sidebar.open .sidebar-item .label,
.sidebar.open .sidebar-label { opacity: 1; }
.sidebar.open .sidebar-sub { max-height: 300px; }
.sidebar.open .sidebar-divider { opacity: 1; }
.sidebar.open .sidebar-brand { opacity: 1; }
.sidebar.open .sidebar-header .sidebar-item .label,
.sidebar.open .sidebar-header .sidebar-item .sidebar-label { opacity: 1; }

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 72px;
    padding: 40px 44px;
    min-height: 100vh;
    position: relative;
    z-index: 2;
}
