/* ======================================== */
/* SIDEBAR */
/* ======================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: white;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: var(--z-sidebar);
    animation: slideInLeft 0.4s var(--ease-standard);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    background: var(--gradient-primary);
    color: white;
    padding: var(--space-xl);
    text-align: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

.sidebar-header h1 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: var(--space-sm);
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    animation: fadeIn 0.6s var(--ease-standard) 0.2s both;
}

.subtitle {
    font-size: var(--font-size-sm);
    opacity: 0.95;
    position: relative;
    z-index: 1;
    animation: fadeIn 0.6s var(--ease-standard) 0.3s both;
    font-weight: 300;
    letter-spacing: 0.02em;
}

.sidebar-content {
    padding: var(--space-lg);
    flex: 1;
    overflow-y: auto;
    animation: fadeIn 0.6s var(--ease-standard) 0.4s both;
}

/* Sidebar scrollbar - enhanced */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
    transition: background var(--transition-fast);
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-light);
}

/* Mobile menu toggle button (hidden by default) */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: var(--space-md);
    left: var(--space-md);
    z-index: calc(var(--z-sidebar) + 1);
    width: 48px;
    height: 48px;
    background: white;
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    padding: 0;
}

.sidebar-toggle:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

.sidebar-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--color-primary);
    margin: 4px auto;
    transition: all var(--transition-base);
    border-radius: 2px;
}

/* ======================================== */
/* RESPONSIVE - SIDEBAR */
/* ======================================== */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 60vh;
        position: relative;
        animation: slideInLeft 0.3s var(--ease-standard);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .sidebar-header {
        padding: var(--space-lg) var(--space-md);
    }
    
    .sidebar-header h1 {
        font-size: var(--font-size-xl);
    }
    
    .sidebar-content {
        padding: var(--space-md);
        max-height: calc(60vh - 100px);
    }
}

@media (max-width: 480px) {
    .sidebar {
        max-height: 50vh;
    }
    
    .sidebar-header h1 {
        font-size: var(--font-size-lg);
    }
    
    .subtitle {
        font-size: var(--font-size-xs);
    }
    
    .sidebar-content {
        padding: var(--space-sm);
    }
}

/* Tablet portrait */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 280px;
    }
    
    :root {
        --sidebar-width: 280px;
    }
}
