:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    
    /* Light theme colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --card-bg: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.1);
    --header-bg: #ffffff;
    
    /* Gradients for light theme */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-tertiary: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-quaternary: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --gradient-modern: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    /* Dark theme colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --border-hover: #475569;
    --card-bg: #1e293b;
    --card-shadow: rgba(0, 0, 0, 0.3);
    --header-bg: #0f172a;
    
    /* Darker gradients for dark theme */
    --gradient-primary: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
    --gradient-secondary: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
    --gradient-tertiary: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    --gradient-quaternary: linear-gradient(135deg, #059669 0%, #10b981 100%);
    --gradient-modern: linear-gradient(135deg, #e11d48 0%, #be185d 100%);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    transition: var(--transition);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Dark Mode Toggle - positioned below contributions */
.theme-toggle {
    position: fixed;
    top: 5rem;
    right: 2rem;
    z-index: 1000;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 0.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

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

.theme-toggle button {
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.theme-toggle button:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.theme-toggle button.active {
    background: var(--primary-color);
    color: white;
}

/* Navigation */
.nav {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

/* Breadcrumb */
.breadcrumb {
    background: var(--bg-secondary);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb .separator {
    color: var(--text-muted);
}

.breadcrumb .current {
    color: var(--text-primary);
    font-weight: 500;
}

/* Header */
.header {
    background: var(--bg-secondary);
    padding: 4rem 0 3rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.header h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.header .subtitle {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.header .description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Learning Objectives */
.objectives-section {
    padding: 3rem 0;
    background: var(--bg-primary);
}

.objectives-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.objectives-card h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: center;
}

.objectives-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.objective-item {
    text-align: center;
    padding: 1rem;
}

.objective-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 1rem;
}

.objective-item h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.objective-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Main Content */
.main-content {
    padding: 4rem 0;
    background: var(--bg-secondary);
}

.progress-section {
    margin-bottom: 4rem;
}

.progress-section h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-item {
    text-align: center;
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Chapters Section */
.chapters-section h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.chapter-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.chapter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chapter-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--accent-color);
    background: rgba(6, 182, 212, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.difficulty-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.difficulty-badge.beginner {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.difficulty-badge.intermediate {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.difficulty-badge.advanced {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.chapter-card h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.chapter-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.chapter-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.chapter-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.topic-tag {
    font-size: 0.75rem;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-weight: 500;
}

.chapter-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: var(--primary-color);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-hover);
}

.progress-indicator {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Quick Access */
.quick-access-section h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.quick-access-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.quick-access-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.access-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 1rem;
}

.quick-access-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.quick-access-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 3rem 0;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .theme-toggle {
        top: 4rem;
        right: 1rem;
    }

    .nav-content {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .header {
        padding: 2rem 0;
    }

    .chapter-grid {
        grid-template-columns: 1fr;
    }

    .objectives-grid {
        grid-template-columns: 1fr;
    }

    .progress-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-access-grid {
        grid-template-columns: 1fr;
    }

    .chapter-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .progress-indicator {
        order: -1;
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .progress-stats {
        grid-template-columns: 1fr;
    }

    .chapter-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Animation for scroll reveal */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Dark mode transition */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
