:root {
    /* Design System - Variables CSS */
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #3B82F6;
    --secondary: #7C3AED;
    --secondary-dark: #6D28D9;
    --accent: #10B981;
    --accent-dark: #059669;
    --dark: #1F2937;
    --dark-light: #374151;
    --light: #F9FAFB;
    --light-gray: #F3F4F6;
    --medium-gray: #E5E7EB;
    --white: #FFFFFF;
    --error: #EF4444;
    --warning: #F59E0B;
    --success: #10B981;
    
    /* SQL Syntax Highlighting Colors */
    --sql-keyword: #D33682; /* Pink for keywords */
    --sql-function: #268BD2; /* Blue for functions */
    --sql-string: #2AA198; /* Teal for strings */
    --sql-number: #B58900; /* Yellow for numbers */
    --sql-comment: #93A1A1; /* Gray for comments */
    --sql-operator: #859900; /* Green for operators */
    --sql-type: #6C71C4; /* Purple for data types */
    --sql-background: #002B36; /* Dark background */
    --sql-text: #839496; /* Light text */
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Border radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--light);
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    word-wrap: break-word;
    overflow-wrap: break-word;
    position: relative;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

ul, ol {
    list-style-position: inside;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-sm);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-xs);
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
    color: var(--dark);
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

h1 {
    font-size: clamp(var(--text-2xl), 5vw, var(--text-4xl));
}

h2 {
    font-size: clamp(var(--text-xl), 4vw, var(--text-3xl));
    margin-top: var(--space-xl);
}

h3 {
    font-size: clamp(var(--text-lg), 3vw, var(--text-2xl));
    color: var(--primary);
    margin-top: var(--space-lg);
}

h4 {
    font-size: clamp(1rem, 2.5vw, var(--text-xl));
    color: var(--dark-light);
    margin-top: var(--space-md);
}

p {
    margin-bottom: var(--space-md);
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.lead {
    font-size: clamp(0.95rem, 2vw, 1.125rem);
    font-weight: 300;
    line-height: 1.7;
    color: var(--dark-light);
}

/* Header */
.main-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    padding: var(--space-md) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
    width: 100%;
}

.main-header.scrolled {
    padding: var(--space-xs) 0;
    background: rgba(37, 99, 235, 0.95);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 700;
    font-size: var(--text-lg);
    white-space: nowrap;
}

.logo-icon {
    background: var(--white);
    color: var(--primary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: var(--text-xl);
    cursor: pointer;
    z-index: 1002;
    position: relative;
    padding: var(--space-xs);
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
}

.nav-menu {
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: var(--primary);
        flex-direction: column;
        padding: var(--space-xl) var(--space-md);
        gap: var(--space-sm);
        transition: left var(--transition-base);
        box-shadow: var(--shadow-xl);
        z-index: 1001;
        overflow-y: auto;
        justify-content: flex-start;
        padding-top: 80px;
    }
    
    .nav-menu.active {
        left: 0;
    }
}

.nav-link {
    color: var(--white);
    font-weight: 500;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.15);
}

@media (max-width: 768px) {
    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: var(--space-sm);
        font-size: 1rem;
    }
}

/* Sommaire Mobile */
.syllabus-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: var(--white);
    z-index: 1002;
    transition: right var(--transition-base);
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    padding: var(--space-xl);
}

.syllabus-menu.active {
    right: 0;
}

.syllabus-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--light-gray);
}

.syllabus-title {
    font-size: var(--text-xl);
    color: var(--dark);
    margin: 0;
}

.syllabus-close {
    background: none;
    border: none;
    font-size: var(--text-xl);
    color: var(--dark);
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.syllabus-close:hover {
    background: var(--light-gray);
}

.syllabus-list {
    list-style: none;
    padding: 0;
}

.syllabus-item {
    margin-bottom: var(--space-sm);
}

.syllabus-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    color: var(--dark);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.syllabus-link:hover {
    background: var(--light-gray);
    transform: translateX(4px);
}

.syllabus-link.current {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(124, 58, 237, 0.05));
    color: var(--primary);
    font-weight: 600;
}

.syllabus-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--light-gray);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.syllabus-link.current .syllabus-number {
    background: var(--primary);
    color: var(--white);
}

/* Overlay for mobile menu */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #1E40AF 0%, #3730A3 100%);
    color: var(--white);
    padding: var(--space-xl) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="white" opacity="0.05"/></svg>');
    background-size: cover;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.hero h1 {
    color: var(--white);
    margin-bottom: var(--space-md);
    animation: fadeInUp 0.8s ease-out;
    padding: 0 var(--space-sm);
}

.hero-subtitle {
    font-size: clamp(0.95rem, 2vw, 1.125rem);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--space-lg);
    animation: fadeInUp 0.8s ease-out 0.2s both;
    padding: 0 var(--space-sm);
}

.chapter-progress {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: rgba(255, 255, 255, 0.1);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-lg);
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.8s ease-out 0.4s both;
    font-size: 0.9rem;
}

.progress-circle {
    width: 22px;
    height: 22px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

/* Main Layout */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-lg);
    padding: var(--space-lg) 0;
    position: relative;
    width: 100%;
}

@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: var(--space-md);
        padding: var(--space-md) 0;
    }
    
    .sidebar {
        position: static;
        order: -1;
    }
}

/* Content Card */
.content-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-lg);
    animation: fadeIn 0.6s ease-out;
    border: 1px solid var(--medium-gray);
    overflow-wrap: break-word;
    word-wrap: break-word;
    width: 100%;
    overflow: hidden;
}

@media (max-width: 768px) {
    .content-card {
        padding: var(--space-md);
        margin-bottom: var(--space-md);
        border-radius: var(--radius-md);
    }
}

@media (max-width: 480px) {
    .content-card {
        padding: var(--space-sm);
    }
}

/* Callout Boxes */
.callout {
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    margin: var(--space-md) 0;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-base);
    overflow-wrap: break-word;
    word-wrap: break-word;
    width: 100%;
}

@media (max-width: 768px) {
    .callout {
        padding: var(--space-sm);
        margin: var(--space-sm) 0;
    }
}

.callout:hover {
    transform: translateY(-2px);
}

.callout::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.callout-analogy {
    background: linear-gradient(135deg, #E0F2FE 0%, #F0F9FF 100%);
    border-left: 4px solid var(--primary);
}

.callout-analogy::before {
    background: var(--primary);
}

.callout-analogy .callout-icon {
    color: var(--primary);
}

.callout-definition {
    background: linear-gradient(135deg, #FEF3C7 0%, #FFFBEB 100%);
    border-left: 4px solid var(--warning);
}

.callout-definition::before {
    background: var(--warning);
}

.callout-definition .callout-icon {
    color: var(--warning);
}

.callout-tip {
    background: linear-gradient(135deg, #D1FAE5 0%, #ECFDF5 100%);
    border-left: 4px solid var(--accent);
}

.callout-tip::before {
    background: var(--accent);
}

.callout-tip .callout-icon {
    color: var(--accent);
}

.callout-warning {
    background: linear-gradient(135deg, #FEE2E2 0%, #FEF2F2 100%);
    border-left: 4px solid var(--error);
}

.callout-warning::before {
    background: var(--error);
}

.callout-warning .callout-icon {
    color: var(--error);
}

.callout-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    flex-wrap: wrap;
}

.callout-icon {
    font-size: var(--text-lg);
}

.callout-title {
    font-size: var(--text-base);
    font-weight: 700;
    margin: 0;
}

/* SQL Code Blocks */
.sql-code {
    background: var(--sql-background);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin: var(--space-md) 0;
    overflow-x: auto;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--sql-text);
}

.sql-code::before {
    content: 'SQL';
    position: absolute;
    top: 0;
    right: var(--space-md);
    background: rgba(255, 255, 255, 0.1);
    color: var(--sql-text);
    padding: 2px 8px;
    font-size: 0.7rem;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    font-weight: 600;
    letter-spacing: 1px;
}

.sql-keyword {
    color: var(--sql-keyword);
    font-weight: bold;
}

.sql-function {
    color: var(--sql-function);
}

.sql-string {
    color: var(--sql-string);
}

.sql-number {
    color: var(--sql-number);
}

.sql-comment {
    color: var(--sql-comment);
    font-style: italic;
}

.sql-operator {
    color: var(--sql-operator);
}

.sql-type {
    color: var(--sql-type);
}

/* Inline code */
code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background-color: var(--light-gray);
    color: var(--sql-keyword);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

/* External links */
.external-link {
    color: var(--primary);
    text-decoration: underline;
    transition: color var(--transition-fast);
}

.external-link:hover {
    color: var(--primary-dark);
}

/* Steps */
.step-container {
    display: grid;
    gap: var(--space-md);
    margin: var(--space-md) 0;
    width: 100%;
}

.step {
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
    padding: var(--space-md);
    background: var(--light-gray);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    border-left: 3px solid transparent;
    width: 100%;
    overflow: hidden;
}

.step:hover {
    background: var(--medium-gray);
    border-left-color: var(--primary);
    transform: translateX(2px);
}

@media (max-width: 768px) {
    .step {
        flex-direction: column;
        text-align: center;
        align-items: center;
        padding: var(--space-sm);
        gap: var(--space-sm);
    }
}

.step-icon {
    background: var(--primary);
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    flex-shrink: 0;
}

.step-content {
    flex: 1;
    min-width: 0;
}

.step-title {
    font-size: var(--text-base);
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--dark);
}

/* Comparison Cards */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-md);
    margin: var(--space-md) 0;
    width: 100%;
}

@media (max-width: 768px) {
    .comparison-grid {
        grid-template-columns: 1fr;
    }
}

.comparison-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--medium-gray);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    width: 100%;
}

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

.comparison-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.comparison-icon {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.comparison-title {
    font-size: var(--text-base);
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.comparison-list {
    list-style: none;
    padding: 0;
    margin-bottom: var(--space-md);
}

.comparison-list li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-xs);
    margin-bottom: var(--space-xs);
    font-size: 0.9rem;
    word-wrap: break-word;
}

.comparison-list li::before {
    content: '•';
    color: var(--primary);
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 0.1em;
}

/* Difficulty badges */
.difficulty-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.difficulty-badge.easy {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--accent-dark);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.difficulty-badge.medium {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.difficulty-badge.hard {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Tool recommendation */
.tool-recommendation {
    background: rgba(243, 244, 246, 0.5);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    margin-top: var(--space-sm);
}

.tool-recommendation h5 {
    font-size: 0.9rem;
    margin-bottom: var(--space-xs);
    color: var(--dark-light);
}

.tool-recommendation ul {
    list-style: none;
    padding-left: 0;
    font-size: 0.85rem;
}

.tool-recommendation li {
    margin-bottom: 2px;
    color: var(--dark-light);
}

/* Table Example */
.table-example {
    width: 100%;
    overflow-x: auto;
    margin: var(--space-md) 0;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    background: var(--white);
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.table-example table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
    table-layout: auto;
}

@media (max-width: 768px) {
    .table-example table {
        min-width: 400px;
    }
}

.table-example th {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    padding: var(--space-sm);
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
    white-space: nowrap;
    font-size: 0.9rem;
}

.table-example td {
    padding: var(--space-sm);
    border-bottom: 1px solid var(--medium-gray);
    word-break: break-word;
    font-size: 0.9rem;
}

.table-example tr:hover {
    background: var(--light-gray);
}

.table-example tr:last-child td {
    border-bottom: none;
}

.table-highlight {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(124, 58, 237, 0.1)) !important;
}

/* Screenshot */
.screenshot {
    text-align: center;
    margin: var(--space-md) 0;
    padding: var(--space-md);
    background: var(--light-gray);
    border-radius: var(--radius-md);
    border: 2px dashed var(--medium-gray);
}

.screenshot-placeholder {
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    color: var(--white);
    padding: var(--space-xl) var(--space-md);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    min-height: 200px;
}

.screenshot-placeholder i {
    font-size: var(--text-4xl);
}

.screenshot-caption {
    font-style: italic;
    color: var(--dark-light);
    margin-top: var(--space-sm);
    font-size: 0.9rem;
    text-align: center;
}

/* OS Comparison */
.os-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-md);
    margin: var(--space-md) 0;
    width: 100%;
}

@media (max-width: 768px) {
    .os-comparison {
        grid-template-columns: 1fr;
    }
}

.os-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
    border-top: 4px solid;
    transition: all var(--transition-base);
}

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

.os-card.windows {
    border-top-color: #0078D7;
}

.os-card.mac {
    border-top-color: #000000;
}

.os-card.linux {
    border-top-color: #F1502F;
}

.os-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.os-icon {
    font-size: var(--text-xl);
}

.os-header h4 {
    margin: 0;
    font-size: var(--text-lg);
    color: var(--dark);
}

.os-content p {
    margin-bottom: var(--space-xs);
    font-size: 0.9rem;
}

/* Troubleshooting */
.troubleshooting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-md);
    margin: var(--space-md) 0;
    width: 100%;
}

@media (max-width: 768px) {
    .troubleshooting-grid {
        grid-template-columns: 1fr;
    }
}

.troubleshooting-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--warning);
    transition: all var(--transition-base);
}

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

.troubleshooting-icon {
    font-size: var(--text-xl);
    margin-bottom: var(--space-sm);
    color: var(--warning);
}

.troubleshooting-card h4 {
    font-size: var(--text-base);
    margin-bottom: var(--space-xs);
    color: var(--dark);
}

.troubleshooting-card p {
    font-size: 0.9rem;
    margin-bottom: 0;
    color: var(--dark-light);
}

/* Checklist */
.checklist {
    background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin: var(--space-md) 0;
    border: 1px solid var(--medium-gray);
}

.checklist-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.checklist-icon {
    background: var(--accent);
    color: var(--white);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-base);
}

.checklist-title {
    font-size: var(--text-base);
    font-weight: 700;
    margin: 0;
    color: var(--dark);
}

.checklist-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: var(--white);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.checklist-item:hover {
    background: var(--light-gray);
    transform: translateX(2px);
}

.checklist-check {
    color: var(--accent);
    font-size: var(--text-base);
    flex-shrink: 0;
    margin-top: 2px;
}

.checklist-text {
    flex: 1;
    font-size: 0.9rem;
    color: var(--dark);
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-md);
    border: 1px solid var(--medium-gray);
    width: 100%;
    overflow: hidden;
}

.sidebar-title {
    font-size: var(--text-base);
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.progress-card {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
}

.progress-title {
    color: var(--white);
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    margin: var(--space-sm) 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: var(--radius-full);
    width: 14%;
    transition: width 1s ease-in-out;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    opacity: 0.9;
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--medium-gray);
    flex-wrap: wrap;
    gap: var(--space-sm);
    width: 100%;
}

@media (max-width: 768px) {
    .nav-buttons {
        flex-direction: column;
        gap: var(--space-sm);
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-base);
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    flex: 1;
    min-width: 140px;
    justify-content: center;
    width: auto;
}

@media (max-width: 768px) {
    .btn {
        width: 100%;
        min-width: 100%;
    }
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.7s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
}

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

.btn-secondary {
    background: var(--light-gray);
    color: var(--dark);
}

.btn-secondary:hover {
    background: var(--medium-gray);
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

/* Footer */
.main-footer {
    background: var(--dark);
    color: var(--white);
    padding: var(--space-lg) 0;
    margin-top: var(--space-xl);
    width: 100%;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
    width: 100%;
}

.footer-section h4 {
    color: var(--white);
    margin-bottom: var(--space-sm);
    font-size: var(--text-base);
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: var(--space-xs);
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    transition: color var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

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

.footer-bottom {
    text-align: center;
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Mobile-specific fixes */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        position: relative;
        width: 100%;
    }
    
    h1 {
        font-size: var(--text-2xl);
        padding: 0;
    }
    
    h2 {
        font-size: var(--text-xl);
        margin-top: var(--space-lg);
    }
    
    h3 {
        font-size: var(--text-lg);
        margin-top: var(--space-md);
    }
    
    p, .lead {
        font-size: 0.95rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }
    
    .logo span {
        font-size: 0.9rem;
    }
    
    .table-example {
        margin-left: -8px;
        margin-right: -8px;
        width: calc(100% + 16px);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-xs);
    }
    
    .syllabus-menu {
        max-width: 280px;
        padding: var(--space-md);
    }
    
    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .chapter-progress {
        font-size: 0.8rem;
        padding: var(--space-xs) var(--space-sm);
    }
    
    .nav-menu {
        width: 85%;
        max-width: 300px;
    }
}

@media (max-width: 360px) {
    .syllabus-menu {
        max-width: 100%;
    }
    
    .btn {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.9rem;
    }
    
    .nav-menu {
        width: 90%;
    }
}

/* Touch-friendly improvements */
button, 
.btn,
.nav-link {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Fix for iOS Safari */
@supports (-webkit-touch-callout: none) {
    body {
        -webkit-font-smoothing: antialiased;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --dark: #F9FAFB;
        --dark-light: #E5E7EB;
        --light: #111827;
        --light-gray: #1F2937;
        --medium-gray: #374151;
        --white: #1F2937;
    }
    
    .content-card,
    .sidebar-card,
    .comparison-card,
    .os-card,
    .troubleshooting-card,
    .checklist-item {
        background: var(--white);
    }
    
    .callout {
        background: var(--light-gray);
    }
    
    .table-example {
        background: var(--light-gray);
    }
    
    .table-example tr:hover {
        background: var(--medium-gray);
    }
    
    .syllabus-menu {
        background: var(--white);
    }
    
    .checklist {
        background: var(--light-gray);
    }
    
    .tool-recommendation {
        background: rgba(31, 41, 55, 0.5);
    }
}
