/* static/css/components/sidebar.css */

:root {
    /* Colori principali */
    --primary: #2563eb;
    --primary-light: #dbeafe;
    
    /* Background e bordi */
    --bg-white: #ffffff;
    --bg-gray-50: #f9fafb;
    --bg-gray-100: #f3f4f6;
    
    /* Testo */
    --text-dark: #111827;
    --text-gray: #4b5563;
    --text-light: #9ca3af;
    
    /* Bordi e ombre */
    --border-color: #e5e7eb;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    
    /* Dimensioni */
    --sidebar-width: 320px;
    --header-height: 64px;
}

/* Layout Base */
.course-layout {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-gray-50);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--bg-white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    z-index: 50;
}

/* Header Sidebar */
.sidebar-header {
    height: var(--header-height);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-white);
}

.sidebar-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Navigazione */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

/* Sezioni */
.course-section {
    margin-bottom: 0.25rem;
}

.section-toggle {
    width: 100%;
    padding: 0.875rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-gray);
    transition: all 0.2s ease;
}

.section-toggle:hover {
    background-color: var(--bg-gray-50);
    color: var(--text-dark);
}

.arrow {
    color: var(--text-light);
    transition: transform 0.2s ease;
}

/* Contenuto Sezione */
.section-content {
    display: none;
    background-color: var(--bg-gray-50);
}

.section-content.open {
    display: block;
}

/* Link Video/Docs */
.nav-link {
    display: block;
    padding: 0.75rem 2rem;
    color: var(--text-gray);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.nav-link:hover {
    background-color: var(--bg-gray-100);
    color: var(--text-dark);
}

.nav-link.active {
    background-color: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 500;
}

/* Contenuto Principale */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: 100vh;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .nav-link {
        padding-left: 1.5rem;
    }
}

/* Scrollbar */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

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

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: 4px;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-white: #1f2937;
        --bg-gray-50: #111827;
        --bg-gray-100: #374151;
        --text-dark: #f9fafb;
        --text-gray: #d1d5db;
        --text-light: #6b7280;
        --border-color: #374151;
        --primary-light: rgba(37, 99, 235, 0.2);
    }
}