/* ===== CSS VARIABLES ===== */
        :root {
            /* Case Colors */
            --nom: #3b82f6;
            --nom-light: #dbeafe;
            --acc: #ef4444;
            --acc-light: #fee2e2;
            --dat: #10b981;
            --dat-light: #d1fae5;
            --gen: #8b5cf6;
            --gen-light: #ede9fe;
            
            /* Gender Colors */
            --masc: #06b6d4;
            --fem: #ec4899;
            --neut: #f59e0b;
            
            /* UI Colors */
            --bg: #f8fafc;
            --card-bg: #ffffff;
            --text: #1e293b;
            --text-muted: #64748b;
            --border: #e2e8f0;
            --success: #22c55e;
            --error: #ef4444;
            --warning: #f59e0b;
            
            /* Spacing */
            --space-xs: 0.25rem;
            --space-sm: 0.5rem;
            --space-md: 1rem;
            --space-lg: 1.5rem;
            --space-xl: 2rem;
            --space-2xl: 3rem;
            
            /* Border Radius */
            --radius-sm: 0.375rem;
            --radius-md: 0.5rem;
            --radius-lg: 0.75rem;
            --radius-xl: 1rem;
        }

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

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
            background: var(--bg);
            color: var(--text);
            line-height: 1.6;
            padding-bottom: var(--space-2xl);
        }

        /* ===== HEADER ===== */
        .chapter-header {
            background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
            color: white;
            padding: var(--space-xl);
            text-align: center;
        }

        .chapter-badge {
            display: inline-block;
            background: rgba(255,255,255,0.2);
            padding: var(--space-xs) var(--space-md);
            border-radius: var(--radius-lg);
            font-size: 0.875rem;
            font-weight: 600;
            margin-bottom: var(--space-sm);
        }

        .chapter-title {
            font-size: 2rem;
            font-weight: 700;
            margin-bottom: var(--space-sm);
        }

        .chapter-subtitle {
            color: rgba(255,255,255,0.8);
            font-size: 1.1rem;
        }

        /* ===== NAVIGATION ===== */
        .chapter-nav {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: var(--space-md) var(--space-xl);
            background: var(--card-bg);
            border-bottom: 1px solid var(--border);
            flex-wrap: wrap;
            gap: var(--space-md);
        }

        .chapter-nav a {
            color: var(--nom);
            text-decoration: none;
            font-weight: 500;
            padding: var(--space-sm) var(--space-md);
            border-radius: var(--radius-md);
            transition: all 0.2s;
        }

        .chapter-nav a:hover {
            background: var(--nom-light);
        }

        .progress-bar {
            font-size: 0.875rem;
            color: var(--text-muted);
            font-weight: 500;
        }

        /* ===== MAIN CONTAINER ===== */
        .container {
            max-width: 900px;
            margin: 0 auto;
            padding: var(--space-xl);
        }

        /* ===== INTRODUCTION ===== */
        .intro-card {
            background: var(--card-bg);
            border-radius: var(--radius-lg);
            padding: var(--space-xl);
            margin-bottom: var(--space-xl);
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }

        .intro-card h2 {
            color: var(--text);
            margin-bottom: var(--space-md);
            font-size: 1.5rem;
        }

        .intro-card p {
            margin-bottom: var(--space-md);
            color: var(--text);
        }

        .intro-card p:last-child {
            margin-bottom: 0;
        }

        /* ===== CASE OVERVIEW GRID ===== */
        .case-overview {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: var(--space-md);
            margin: var(--space-xl) 0;
        }

        .case-card {
            background: var(--card-bg);
            border-radius: var(--radius-lg);
            padding: var(--space-lg);
            border-left: 4px solid;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
            transition: transform 0.2s, box-shadow 0.2s;
        }

        .case-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }

        .case-card.nom { border-left-color: var(--nom); }
        .case-card.acc { border-left-color: var(--acc); }
        .case-card.dat { border-left-color: var(--dat); }
        .case-card.gen { border-left-color: var(--gen); }

        .case-card h3 {
            font-size: 1.1rem;
            margin-bottom: var(--space-sm);
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }

        .case-card.nom h3 { color: var(--nom); }
        .case-card.acc h3 { color: var(--acc); }
        .case-card.dat h3 { color: var(--dat); }
        .case-card.gen h3 { color: var(--gen); }

        .case-icon {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 0.75rem;
            color: white;
        }

        .nom .case-icon { background: var(--nom); }
        .acc .case-icon { background: var(--acc); }
        .dat .case-icon { background: var(--dat); }
        .gen .case-icon { background: var(--gen); }

        .case-function {
            font-size: 0.875rem;
            color: var(--text-muted);
            margin-bottom: var(--space-sm);
        }

        .case-example {
            font-style: italic;
            padding: var(--space-sm);
            border-radius: var(--radius-sm);
            font-size: 0.9rem;
        }

        .nom .case-example { background: var(--nom-light); }
        .acc .case-example { background: var(--acc-light); }
        .dat .case-example { background: var(--dat-light); }
        .gen .case-example { background: var(--gen-light); }

        /* ===== THEORY CARDS ===== */
        .theory-section {
            margin: var(--space-2xl) 0;
        }

        .theory-section h2 {
            font-size: 1.5rem;
            margin-bottom: var(--space-lg);
            padding-bottom: var(--space-sm);
            border-bottom: 2px solid var(--border);
        }

        .theory-card {
            background: var(--card-bg);
            border-radius: var(--radius-lg);
            padding: var(--space-xl);
            margin-bottom: var(--space-lg);
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }

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

        .theory-card p {
            margin-bottom: var(--space-md);
        }

        .theory-card ul {
            margin-left: var(--space-lg);
            margin-bottom: var(--space-md);
        }

        .theory-card li {
            margin-bottom: var(--space-sm);
        }

        /* ===== EXAMPLE BOXES ===== */
        .example-box {
            background: #f1f5f9;
            border-radius: var(--radius-md);
            padding: var(--space-md);
            margin: var(--space-md) 0;
            display: flex;
            align-items: center;
            gap: var(--space-md);
            flex-wrap: wrap;
        }

        .german-example {
            font-weight: 500;
            font-size: 1.1rem;
        }

        .english-translation {
            color: var(--text-muted);
            font-size: 0.95rem;
        }

        .audio-btn {
            background: var(--nom);
            color: white;
            border: none;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 1rem;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
            margin-left: auto;
        }

        .audio-btn:hover {
            background: #2563eb;
            transform: scale(1.05);
        }

        .audio-btn:active {
            transform: scale(0.95);
        }

        /* ===== TABLES ===== */
        .table-container {
            overflow-x: auto;
            margin: var(--space-lg) 0;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.95rem;
        }

        th, td {
            padding: var(--space-sm) var(--space-md);
            text-align: center;
            border: 1px solid var(--border);
        }

        th {
            background: #f8fafc;
            font-weight: 600;
            color: var(--text);
        }

        td:first-child, th:first-child {
            text-align: left;
            font-weight: 500;
        }

        .case-header.nom { background: var(--nom-light); color: var(--nom); }
        .case-header.acc { background: var(--acc-light); color: var(--acc); }
        .case-header.dat { background: var(--dat-light); color: var(--dat); }
        .case-header.gen { background: var(--gen-light); color: var(--gen); }

        .gender-masc { color: var(--masc); font-weight: 600; }
        .gender-fem { color: var(--fem); font-weight: 600; }
        .gender-neut { color: var(--neut); font-weight: 600; }

        /* ===== MASTER CASE TABLE ===== */
        .master-table {
            margin: var(--space-xl) 0;
        }

        .master-table th {
            font-size: 0.85rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .master-table .nom-col { background: var(--nom-light); }
        .master-table .acc-col { background: var(--acc-light); }
        .master-table .dat-col { background: var(--dat-light); }
        .master-table .gen-col { background: var(--gen-light); }

        /* ===== EXERCISES ===== */
        .exercise-section {
            background: var(--card-bg);
            border-radius: var(--radius-lg);
            padding: var(--space-xl);
            margin: var(--space-xl) 0;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }

        .exercise-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: var(--space-lg);
            flex-wrap: wrap;
            gap: var(--space-md);
        }

        .exercise-title {
            font-size: 1.25rem;
            color: var(--text);
        }

        .exercise-number {
            background: var(--nom);
            color: white;
            padding: var(--space-xs) var(--space-md);
            border-radius: var(--radius-lg);
            font-size: 0.875rem;
            font-weight: 600;
        }

        .exercise-instruction {
            background: #fef3c7;
            border-left: 4px solid var(--warning);
            padding: var(--space-md);
            margin-bottom: var(--space-lg);
            border-radius: var(--radius-sm);
        }

        /* Exercise 10.1 - Click to underline */
        .sentence-item {
            padding: var(--space-md);
            margin: var(--space-sm) 0;
            background: #f8fafc;
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: var(--space-md);
            flex-wrap: wrap;
        }

        .sentence-item:hover {
            background: #e2e8f0;
        }

        .sentence-item.correct {
            background: var(--nom-light);
            border: 2px solid var(--nom);
        }

        .sentence-item.incorrect {
            background: var(--acc-light);
            border: 2px solid var(--acc);
        }

        .sentence-number {
            background: var(--text-muted);
            color: white;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.875rem;
            font-weight: 600;
            flex-shrink: 0;
        }

        .sentence-text {
            font-size: 1.1rem;
            flex: 1;
        }

        .sentence-text .subject {
            text-decoration: underline;
            text-decoration-thickness: 3px;
            text-decoration-color: var(--nom);
            font-weight: 600;
        }

        .sentence-text .subject-wrong {
            text-decoration: line-through;
            text-decoration-color: var(--acc);
            color: var(--acc);
        }

        .feedback-icon {
            font-size: 1.25rem;
            flex-shrink: 0;
        }

        /* Exercise 10.2 - Object identification */
        .object-exercise {
            margin: var(--space-md) 0;
        }

        .object-sentence {
            background: #f8fafc;
            padding: var(--space-md);
            border-radius: var(--radius-md);
            margin-bottom: var(--space-md);
        }

        .object-sentence .german-text {
            font-size: 1.1rem;
            margin-bottom: var(--space-sm);
        }

        .object-inputs {
            display: flex;
            gap: var(--space-md);
            flex-wrap: wrap;
            margin-top: var(--space-sm);
        }

        .object-input-group {
            display: flex;
            align-items: center;
            gap: var(--space-sm);
        }

        .object-input-group label {
            font-size: 0.875rem;
            color: var(--text-muted);
        }

        .object-input-group input {
            width: 60px;
            padding: var(--space-sm);
            border: 2px solid var(--border);
            border-radius: var(--radius-sm);
            text-align: center;
            font-size: 1rem;
        }

        .object-input-group select {
            padding: var(--space-sm);
            border: 2px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 0.9rem;
        }

        /* Exercise 10.3 - Table ticks */
        .tick-table td {
            position: relative;
        }

        .tick-cell {
            cursor: pointer;
            min-width: 60px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .tick-cell:hover {
            background: #f1f5f9;
        }

        .tick-cell.ticked::after {
            content: "✓";
            color: var(--success);
            font-size: 1.5rem;
            font-weight: bold;
        }

        .tick-cell.correct {
            background: var(--dat-light);
        }

        .tick-cell.incorrect {
            background: var(--acc-light);
        }

        /* ===== BUTTONS ===== */
        .btn {
            padding: var(--space-sm) var(--space-lg);
            border: none;
            border-radius: var(--radius-md);
            font-size: 1rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }

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

        .btn-primary:hover {
            background: #2563eb;
        }

        .btn-secondary {
            background: var(--border);
            color: var(--text);
        }

        .btn-secondary:hover {
            background: #cbd5e1;
        }

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

        .btn-success:hover {
            background: #16a34a;
        }

        .exercise-actions {
            display: flex;
            gap: var(--space-md);
            margin-top: var(--space-lg);
            flex-wrap: wrap;
        }

        /* ===== FEEDBACK ===== */
        .feedback {
            padding: var(--space-md);
            border-radius: var(--radius-md);
            margin-top: var(--space-md);
            display: none;
        }

        .feedback.show {
            display: block;
        }

        .feedback.success {
            background: var(--dat-light);
            border: 1px solid var(--dat);
            color: #065f46;
        }

        .feedback.error {
            background: var(--acc-light);
            border: 1px solid var(--acc);
            color: #991b1b;
        }

        /* ===== CHECKLIST ===== */
        .checklist-section {
            background: var(--card-bg);
            border-radius: var(--radius-lg);
            padding: var(--space-xl);
            margin: var(--space-xl) 0;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }

        .checklist-section h2 {
            margin-bottom: var(--space-lg);
        }

        .checklist-item {
            display: flex;
            align-items: flex-start;
            gap: var(--space-md);
            padding: var(--space-md);
            border-bottom: 1px solid var(--border);
        }

        .checklist-item:last-child {
            border-bottom: none;
        }

        .checklist-number {
            background: var(--nom);
            color: white;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.875rem;
            font-weight: 600;
            flex-shrink: 0;
        }

        .checklist-content {
            flex: 1;
        }

        .checklist-question {
            font-weight: 500;
            margin-bottom: var(--space-sm);
        }

        .checklist-answer {
            display: none;
            padding: var(--space-sm);
            background: var(--nom-light);
            border-radius: var(--radius-sm);
            font-size: 0.9rem;
        }

        .checklist-answer.show {
            display: block;
        }

        .toggle-answer {
            background: none;
            border: none;
            color: var(--nom);
            cursor: pointer;
            font-size: 0.875rem;
            text-decoration: underline;
        }

        /* ===== BRIDGE SECTION ===== */
        .connectivity {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: var(--space-lg);
            margin: var(--space-2xl) 0;
        }

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

        .connectivity > div {
            padding: var(--space-lg);
            border-radius: var(--radius-lg);
        }

        .from-prev {
            background: var(--dat-light);
            border-left: 4px solid var(--dat);
        }

        .to-next {
            background: var(--nom-light);
            border-left: 4px solid var(--nom);
        }

        .connectivity h4 {
            margin-bottom: var(--space-sm);
            font-size: 1rem;
        }

        .from-prev h4 { color: var(--dat); }
        .to-next h4 { color: var(--nom); }

        .connectivity p {
            font-size: 0.9rem;
            color: var(--text-muted);
        }

        /* ===== STREAK COUNTER ===== */
        .streak-counter {
            position: fixed;
            top: var(--space-md);
            right: var(--space-md);
            background: var(--card-bg);
            padding: var(--space-sm) var(--space-md);
            border-radius: var(--radius-lg);
            box-shadow: 0 2px 8px rgba(0,0,0,0.15);
            display: flex;
            align-items: center;
            gap: var(--space-sm);
            font-weight: 600;
            z-index: 100;
        }

        .streak-flame {
            font-size: 1.25rem;
        }

        /* ===== PROGRESS INDICATOR ===== */
        .progress-indicator {
            position: fixed;
            top: 0;
            left: 0;
            height: 4px;
            background: linear-gradient(90deg, var(--nom), var(--acc), var(--dat), var(--gen));
            transition: width 0.3s;
            z-index: 1000;
        }

        /* ===== ANSWER KEY ===== */
        .answer-key {
            background: #f0fdf4;
            border: 1px solid var(--success);
            border-radius: var(--radius-md);
            padding: var(--space-md);
            margin-top: var(--space-lg);
            display: none;
        }

        .answer-key.show {
            display: block;
        }

        .answer-key h4 {
            color: var(--success);
            margin-bottom: var(--space-sm);
        }

        /* ===== RESPONSIVE ===== */
        @media (max-width: 768px) {
            .chapter-title {
                font-size: 1.5rem;
            }

            .container {
                padding: var(--space-md);
            }

            .case-overview {
                grid-template-columns: 1fr;
            }

            .chapter-nav {
                flex-direction: column;
                text-align: center;
            }

            table {
                font-size: 0.85rem;
            }

            th, td {
                padding: var(--space-xs) var(--space-sm);
            }

            .streak-counter {
                position: relative;
                top: auto;
                right: auto;
                margin: var(--space-md) auto;
                width: fit-content;
            }
        }

        /* ===== UTILITIES ===== */
        .highlight-nom { background: var(--nom-light); padding: 2px 4px; border-radius: 4px; }
        .highlight-acc { background: var(--acc-light); padding: 2px 4px; border-radius: 4px; }
        .highlight-dat { background: var(--dat-light); padding: 2px 4px; border-radius: 4px; }
        .highlight-gen { background: var(--gen-light); padding: 2px 4px; border-radius: 4px; }

        .text-nom { color: var(--nom); }
        .text-acc { color: var(--acc); }
        .text-dat { color: var(--dat); }
        .text-gen { color: var(--gen); }

        .mb-0 { margin-bottom: 0; }
        .mt-lg { margin-top: var(--space-lg); }
