/* ============================================
   DIFFUSION MODELS TUTORIAL - MAIN STYLES
   Diffusion Theme: Forward (Red) + Reverse (Green)
   ============================================ */

:root {
    /* Color Palette */
    --bg-primary: #0a0e27;
    --bg-secondary: #141936;
    --bg-card: #1a1f3a;
    --bg-hover: #252b4a;

    /* Diffusion-specific Colors */
    --color-forward: #ef4444;
    /* Red for noise addition */
    --color-reverse: #10b981;
    /* Green for denoising */
    --color-noise: #6b7280;
    /* Gray for pure noise */
    --color-clean: #3b82f6;
    /* Blue for clean image */
    --color-schedule: #f59e0b;
    /* Orange for schedules */

    /* Accent Colors */
    --accent-primary: #00d4ff;
    --accent-secondary: #8b5cf6;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-diffusion: linear-gradient(135deg, #ef4444 0%, #10b981 100%);
    --gradient-forward: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    --gradient-reverse: linear-gradient(135deg, #10b981 0%, #34d399 100%);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #b4b9d6;
    --text-muted: #6b7280;

    /* Typography */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-code: 'JetBrains Mono', 'Courier New', monospace;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.3);

    /* Transitions */
    --transition-fast: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   LAYOUT - FIXED (NO GRID+FIXED CONFLICT)
   ============================================ */

body {
    display: block;
    /* ✅ NOT grid - prevents layout bug */
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--space-lg);
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    margin-bottom: var(--space-xl);
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-diffusion);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-xs);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 300;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-bottom: var(--space-lg);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-diffusion);
    width: 12.5%;
    /* 1/8 sections */
    transition: width var(--transition-slow);
}

/* Navigation Menu */
.nav-menu {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    margin-bottom: var(--space-xs);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    opacity: 0.6;
}

.nav-item:hover {
    background: var(--bg-hover);
    opacity: 1;
}

.nav-item.active {
    background: var(--bg-card);
    opacity: 1;
    box-shadow: var(--shadow-sm);
}

.nav-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.nav-title {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Main Content */
.main-content {
    margin-left: 300px;
    padding: var(--space-xl);
    max-width: none;
    width: auto;
}

/* ============================================
   TUTORIAL SECTIONS
   ============================================ */

.tutorial-section {
    display: none;
    animation: fadeIn var(--transition-base);
}

.tutorial-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    margin-bottom: var(--space-xl);
}

.section-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* ============================================
   CONTENT CARDS
   ============================================ */

.content-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all var(--transition-base);
}

.content-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 255, 255, 0.1);
}

.content-card h3 {
    font-size: 1.75rem;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.content-card h4 {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
    color: var(--accent-primary);
}

.content-card p {
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.content-card ul,
.content-card ol {
    margin-left: var(--space-lg);
    color: var(--text-secondary);
}

.content-card li {
    margin-bottom: var(--space-xs);
}

/* ============================================
   BUTTONS
   ============================================ */

.navigation-buttons {
    display: flex;
    gap: var(--space-md);
    justify-content: space-between;
    margin-top: var(--space-xl);
}

.btn-prev,
.btn-next,
.btn-restart,
.btn-control {
    padding: var(--space-sm) var(--space-lg);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: var(--font-body);
}

.btn-prev {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-prev:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-4px);
}

.btn-next,
.btn-restart {
    background: var(--gradient-diffusion);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-next:hover,
.btn-restart:hover {
    box-shadow: var(--shadow-glow);
    transform: translateX(4px);
}

.btn-control {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-control:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .main-content {
        margin-left: 0;
        padding: var(--space-md);
    }

    .section-title {
        font-size: 2rem;
    }

    .nav-menu {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: var(--space-xs);
    }
}

@media (max-width: 640px) {
    .section-title {
        font-size: 1.75rem;
    }

    .navigation-buttons {
        flex-direction: column;
    }
}