:root {
    /* Dart-inspired color palette - Light mode */
    --primary: #0175C2;
    --primary-dark: #02569B;
    --primary-light: #4A9FE7;
    --secondary: #13B9FD;
    --accent: #40C4FF;
    
    /* Surface colors */
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --surface-elevated: #ffffff;
    --surface-variant: #e2e8f0;
    
    /* Background */
    --background: #f1f5f9;
    --background-alt: #e2e8f0;
    
    /* Text colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    
    /* Borders and dividers */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --divider: #cbd5e1;
    
    /* Status colors */
    --success: #10b981;
    --success-light: #dcfce7;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
    
    /* Border radius */
    --radius-sm: 0.25rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
}

/* Dark mode variables */
[data-theme="dark"] {
    /* Dart colors remain similar but adapted */
    --primary: #4A9FE7;
    --primary-dark: #0175C2;
    --primary-light: #7BB3EA;
    --secondary: #40C4FF;
    --accent: #64FFDA;
    
    /* Dark surfaces */
    --surface: #1e293b;
    --surface-alt: #334155;
    --surface-elevated: #475569;
    --surface-variant: #64748b;
    
    /* Dark background */
    --background: #0f172a;
    --background-alt: #1e293b;
    
    /* Dark text colors */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-inverse: #1e293b;
    
    /* Dark borders */
    --border: #334155;
    --border-light: #475569;
    --divider: #475569;
    
    /* Dark status colors */
    --success: #22c55e;
    --success-light: rgba(34, 197, 94, 0.1);
    --warning: #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.1);
    --danger: #f87171;
    --danger-light: rgba(248, 113, 113, 0.1);
    --info: #60a5fa;
    --info-light: rgba(96, 165, 250, 0.1);
    
    /* Dark shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--background);
    transition: background-color var(--transition), color var(--transition);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: 100vh;
    background: var(--background);
}

/* Sidebar Styling */
.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    height: 100vh;
    position: sticky;
    top: 0;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    transition: all var(--transition);
}

.logo {
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.logo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.logo:hover::before {
    transform: translateX(100%);
}

.logo i {
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.logo h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    color: var(--text-inverse);
}

/* Dark Mode Toggle */
.theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.chapters {
    padding: 1.5rem 0;
}

.chapter-item {
    padding: 1rem 2rem;
    border-left: 4px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.25rem 0;
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.chapter-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0.1;
    transition: width var(--transition);
}

.chapter-item:hover {
    color: var(--text-primary);
    background: var(--surface-alt);
    transform: translateX(4px);
}

.chapter-item:hover::before {
    width: 100%;
}

.chapter-item.active {
    background: linear-gradient(90deg, var(--primary-light), var(--secondary));
    background: var(--info-light);
    border-left: 4px solid var(--primary);
    color: var(--primary);
    font-weight: 600;
    transform: translateX(4px);
}

.chapter-item.active::before {
    width: 100%;
    opacity: 0.15;
}

.chapter-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    opacity: 0.8;
}

/* Main Content */
.main-content {
    padding: 2.5rem;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    background: var(--background);
}

.chapter-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 3rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.chapter-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}

.chapter-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chapter-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 2.5rem 0 1.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary);
    position: relative;
}

.chapter-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 2rem 0 1rem 0;
}

.chapter-content p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Enhanced Code Blocks with Syntax Highlighting */
.dartpad-container {
    margin: 2rem 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--surface-elevated);
    transition: all var(--transition);
}

.dartpad-container:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.dartpad-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--text-inverse);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.dartpad-actions {
    display: flex;
    gap: 0.75rem;
}

.run-button, .copy-button {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
    backdrop-filter: blur(10px);
}

.run-button:hover, .copy-button:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.code-block {
    background: var(--background-alt);
    border: none;
    position: relative;
}

.code-block pre {
    margin: 0;
    padding: 2rem;
    font-family: 'Fira Code', 'JetBrains Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    overflow-x: auto;
    background: transparent;
    color: var(--text-primary);
}

/* Syntax Highlighting for Dart */
.code-block .keyword {
    color: #cf6edf;
    font-weight: 600;
}

.code-block .string {
    color: #a8cc8c;
}

.code-block .number {
    color: #ff8a65;
}

.code-block .comment {
    color: var(--text-muted);
    font-style: italic;
}

.code-block .function {
    color: #82aaff;
    font-weight: 500;
}

.code-block .class {
    color: #ffcb6b;
    font-weight: 600;
}

.code-block .variable {
    color: #f07178;
}

.code-block .operator {
    color: #89ddff;
}

/* Chapter Objectives and Prerequisites */
.chapter-objectives, .prerequisites {
    background: linear-gradient(135deg, var(--info-light), rgba(74, 159, 231, 0.05));
    border-left: 4px solid var(--primary);
    padding: 2rem;
    margin: 2rem 0;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    position: relative;
    overflow: hidden;
}

.chapter-objectives::before, .prerequisites::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    opacity: 0.1;
}

.chapter-objectives h3, .prerequisites h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.objectives-list, .prereq-list {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.objectives-list li, .prereq-list li {
    margin: 1rem 0;
    line-height: 1.7;
    color: var(--text-secondary);
    position: relative;
}

.objectives-list li::marker, .prereq-list li::marker {
    color: var(--primary);
    font-weight: bold;
}

/* Use Cases */
.use-cases {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2.5rem 0;
}

.use-case {
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 2px solid;
    position: relative;
    transition: all var(--transition);
    overflow: hidden;
}

.use-case::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.use-case.use {
    border-color: var(--success);
    background: var(--success-light);
}

.use-case.use::before {
    background: linear-gradient(90deg, var(--success), #22c55e);
}

.use-case.avoid {
    border-color: var(--danger);
    background: var(--danger-light);
}

.use-case.avoid::before {
    background: linear-gradient(90deg, var(--danger), #f87171);
}

.use-case:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.use-case h3 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.use-case.use h3 {
    color: var(--success);
}

.use-case.avoid h3 {
    color: var(--danger);
}

/* Installation Tabs */
.installation-tabs {
    margin: 2.5rem 0;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.tab-headers {
    display: flex;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border);
}

.tab-header {
    background: none;
    border: none;
    padding: 1.25rem 2rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all var(--transition);
    font-weight: 600;
    color: var(--text-secondary);
    position: relative;
    flex: 1;
}

.tab-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: height var(--transition);
}

.tab-header:hover {
    background: var(--surface-variant);
    color: var(--text-primary);
}

.tab-header.active {
    color: var(--primary);
    background: var(--surface);
}

.tab-header.active::before {
    height: 3px;
}

.tab-content {
    display: none;
    padding: 2rem;
}

.tab-content.active {
    display: block;
}

.tab-content pre {
    background: var(--background-alt);
    color: var(--text-primary);
    padding: 1.5rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--border);
    font-family: 'Fira Code', 'JetBrains Mono', monospace;
}

/* Examples */
.example {
    margin: 2.5rem 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--surface);
    transition: all var(--transition);
}

.example:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.example h3 {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--text-inverse);
    padding: 1.5rem 2rem;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.example-explanation {
    padding: 2rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

/* Best Practices */
.best-practices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin: 2.5rem 0;
}

.practice-do, .practice-avoid {
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 2px solid;
    position: relative;
    transition: all var(--transition);
}

.practice-do {
    border-color: var(--success);
    background: var(--success-light);
}

.practice-avoid {
    border-color: var(--danger);
    background: var(--danger-light);
}

.practice-do:hover, .practice-avoid:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Common Errors */
.common-errors {
    background: var(--warning-light);
    border: 2px solid var(--warning);
    border-left: 6px solid var(--warning);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin: 2rem 0;
    position: relative;
}

.common-errors::before {
    content: '⚠️';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    opacity: 0.7;
}

.common-errors h3 {
    color: var(--warning);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

/* Exercises */
.exercises {
    display: grid;
    gap: 1.5rem;
    margin: 2.5rem 0;
}

.exercise {
    background: linear-gradient(135deg, var(--accent), rgba(64, 196, 255, 0.1));
    background: var(--info-light);
    border-left: 6px solid var(--secondary);
    padding: 2rem;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    transition: all var(--transition);
    position: relative;
}

.exercise:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-md);
}

.exercise h3 {
    color: var(--secondary);
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Solution Toggle */
.toggle-solutions {
    text-align: center;
    margin: 3rem 0;
}

.solution-toggle {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 1.25rem 2.5rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.solution-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.solution-toggle:hover::before {
    transform: translateX(100%);
}

.solution-toggle:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Navigation */
.chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3rem 0;
    border-top: 2px solid var(--border);
    margin-top: 4rem;
    gap: 2rem;
}

.nav-button {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 1.25rem 2rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all var(--transition);
    box-shadow: var(--shadow);
    min-width: 160px;
}

.nav-button:hover:not(.disabled) {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.nav-button.disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

/* MODAL DO DARTPAD - CORRIGIDO */
.execution-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.8) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 10000 !important;
    backdrop-filter: blur(8px) !important;
    padding: 2vh 2vw !important;
    box-sizing: border-box !important;
}

.execution-modal .modal-content {
    background: var(--surface) !important;
    border-radius: var(--radius-lg) !important;
    width: 96vw !important;
    height: 92vh !important;
    max-width: none !important;
    max-height: none !important;
    overflow: hidden !important;
    box-shadow: var(--shadow-lg) !important;
    border: 1px solid var(--border) !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
}

.execution-modal .modal-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
    color: white !important;
    padding: 1rem 1.5rem !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}

.execution-modal .modal-header h3 {
    margin: 0 !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
}

.execution-modal .close-modal {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    font-size: 1.2rem !important;
    cursor: pointer !important;
    padding: 0.4rem !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: all var(--transition) !important;
    flex-shrink: 0 !important;
}

.execution-modal .close-modal:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.1) !important;
}

.execution-modal .modal-body {
    flex: 1 !important;
    padding: 0 !important;
    overflow: hidden !important;
    position: relative !important;
    min-height: 0 !important;
}

.execution-modal #dartpad-container {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    overflow: hidden !important;
    background: var(--surface) !important;
    position: relative !important;
}

.execution-modal #dartpad-container iframe {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    display: block !important;
    background: transparent !important;
    overflow: hidden !important;
}

/* RESPONSIVIDADE DO MODAL */
@media (max-width: 768px) {
    .execution-modal {
        padding: 1vh 1vw !important;
    }
    
    .execution-modal .modal-content {
        width: 98vw !important;
        height: 94vh !important;
    }
    
    .execution-modal .modal-header {
        padding: 0.8rem 1rem !important;
    }
    
    .execution-modal .modal-header h3 {
        font-size: 1rem !important;
    }
    
    .execution-modal .close-modal {
        width: 28px !important;
        height: 28px !important;
        font-size: 1rem !important;
    }
}

/* DARK MODE PARA O MODAL */
[data-theme="dark"] .execution-modal .modal-content {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
}

[data-theme="dark"] .execution-modal #dartpad-container {
    background: var(--surface) !important;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 280px 1fr;
    }
    
    .main-content {
        padding: 2rem;
    }
    
    .chapter-content {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: relative;
        height: auto;
    }
    
    .use-cases,
    .best-practices {
        grid-template-columns: 1fr;
    }
    
    .tab-headers {
        flex-direction: column;
    }
    
    .tab-header {
        border-bottom: 1px solid var(--border);
        border-right: none;
    }
    
    .tab-header.active {
        border-bottom-color: var(--border);
    }
    
    .chapter-nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-button {
        width: 100%;
        justify-content: center;
    }
    
    .main-content {
        padding: 1.5rem;
    }
    
    .chapter-content {
        padding: 1.5rem;
    }
    
    .chapter-content h1 {
        font-size: 2rem;
    }
    
    .chapter-content h2 {
        font-size: 1.5rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface-alt);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: var(--radius);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Selection */
::selection {
    background: var(--primary);
    color: white;
}

/* Focus styles */
*:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.chapter-content {
    animation: fadeIn 0.6s ease-out;
}

.chapter-item {
    animation: slideIn 0.4s ease-out;
}

/* Loading states */
.loading {
    animation: pulse 2s infinite;
}

/* Utility classes */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .glass-effect {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] a {
    color: #94c5f7; 
    text-decoration: none;
    transition: color var(--transition);
}

[data-theme="dark"] a:hover {
    color: #bdd7f5; 
    text-decoration: underline;
}

[data-theme="dark"] a:visited {
    color: #a8b3d1;
}

[data-theme="dark"] .references a,
[data-theme="dark"] .chapter-content a {
    color: #94c5f7;
}

[data-theme="dark"] .references a:hover,
[data-theme="dark"] .chapter-content a:hover {
    color: #bdd7f5;
    text-decoration: underline;
}

[data-theme="dark"] .references a:visited,
[data-theme="dark"] .chapter-content a:visited {
    color: #a8b3d1;
}

[data-theme="dark"] ol a,
[data-theme="dark"] ul a {
    color: #94c5f7;
}

[data-theme="dark"] ol a:hover,
[data-theme="dark"] ul a:hover {
    color: #bdd7f5;
}

[data-theme="dark"] ol a:visited,
[data-theme="dark"] ul a:visited {
    color: #a8b3d1;
}

[data-theme="dark"] .chapter-objectives a,
[data-theme="dark"] .prerequisites a {
    color: #7fb3e3;
}

[data-theme="dark"] .chapter-objectives a:hover,
[data-theme="dark"] .prerequisites a:hover {
    color: #94c5f7;
}

[data-theme="dark"] .exercise a,
[data-theme="dark"] .example a {
    color: #7fb3e3;
}

[data-theme="dark"] .exercise a:hover,
[data-theme="dark"] .example a:hover {
    color: #94c5f7;
}

[data-theme="dark"] .surface-elevated a,
[data-theme="dark"] .surface-alt a {
    color: #a8c5e8; 
}

[data-theme="dark"] .surface-elevated a:hover,
[data-theme="dark"] .surface-alt a:hover {
    color: #bdd7f5;
}
