:root {
            /* Case Colors */
            --nom: #3b82f6;
            --acc: #ef4444;
            --dat: #10b981;
            --gen: #8b5cf6;
            /* Gender Colors */
            --masc: #06b6d4;
            --fem: #ec4899;
            --neut: #f59e0b;
            /* Theme Colors */
            --primary: #6366f1;
            --primary-dark: #4f46e5;
            --secondary: #8b5cf6;
            --success: #22c55e;
            --warning: #f59e0b;
            --error: #ef4444;
            --info: #3b82f6;
            /* Neutral Colors */
            --bg: #f8fafc;
            --card-bg: #ffffff;
            --text: #1e293b;
            --text-light: #64748b;
            --border: #e2e8f0;
            --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
            --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        }

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

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

        /* Header & Navigation */
        .chapter-header {
            background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
            color: white;
            padding: 2rem 1rem;
            text-align: center;
            position: relative;
        }

        .chapter-badge {
            display: inline-block;
            background: rgba(255,255,255,0.2);
            padding: 0.5rem 1.5rem;
            border-radius: 2rem;
            font-size: 0.875rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            margin-bottom: 1rem;
        }

        .chapter-header h1 {
            font-size: clamp(1.5rem, 5vw, 2.5rem);
            font-weight: 700;
            margin-bottom: 0.5rem;
        }

        .chapter-subtitle {
            opacity: 0.9;
            font-size: 1.1rem;
        }

        /* Navigation */
        .chapter-nav {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem;
            background: var(--card-bg);
            border-bottom: 1px solid var(--border);
            position: sticky;
            top: 0;
            z-index: 100;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .chapter-nav a {
            color: var(--primary);
            text-decoration: none;
            font-weight: 500;
            padding: 0.5rem 1rem;
            border-radius: 0.5rem;
            transition: all 0.2s;
        }

        .chapter-nav a:hover {
            background: rgba(99, 102, 241, 0.1);
        }

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

        /* Streak Counter */
        .streak-counter {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            background: linear-gradient(135deg, #f59e0b, #d97706);
            color: white;
            padding: 0.5rem 1rem;
            border-radius: 2rem;
            font-weight: 600;
            font-size: 0.875rem;
        }

        .streak-counter::before {
            content: "🔥";
        }

        /* Main Container */
        .container {
            max-width: 900px;
            margin: 0 auto;
            padding: 2rem 1rem;
        }

        /* Theory Cards */
        .theory-card {
            background: var(--card-bg);
            border-radius: 1rem;
            padding: 1.5rem;
            margin-bottom: 1.5rem;
            box-shadow: var(--shadow);
            border-left: 4px solid var(--primary);
        }

        .theory-card h2 {
            color: var(--primary);
            font-size: 1.5rem;
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .theory-card h3 {
            color: var(--text);
            font-size: 1.2rem;
            margin: 1.5rem 0 0.75rem;
        }

        .theory-card p {
            margin-bottom: 1rem;
            color: var(--text);
        }

        .highlight-box {
            background: linear-gradient(135deg, #fef3c7, #fde68a);
            border-radius: 0.75rem;
            padding: 1rem 1.25rem;
            margin: 1rem 0;
            border-left: 4px solid var(--warning);
        }

        .info-box {
            background: linear-gradient(135deg, #dbeafe, #bfdbfe);
            border-radius: 0.75rem;
            padding: 1rem 1.25rem;
            margin: 1rem 0;
            border-left: 4px solid var(--info);
        }

        .success-box {
            background: linear-gradient(135deg, #d1fae5, #a7f3d0);
            border-radius: 0.75rem;
            padding: 1rem 1.25rem;
            margin: 1rem 0;
            border-left: 4px solid var(--success);
        }

        /* German Sentence Styling */
        .german {
            font-weight: 600;
            color: var(--primary-dark);
        }

        .translation {
            color: var(--text-light);
            font-style: italic;
        }

        /* Audio Button */
        .audio-btn {
            background: var(--primary);
            color: white;
            border: none;
            width: 2rem;
            height: 2rem;
            border-radius: 50%;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 0.875rem;
            transition: all 0.2s;
            margin-left: 0.5rem;
        }

        .audio-btn:hover {
            background: var(--primary-dark);
            transform: scale(1.1);
        }

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

        /* Tables */
        .verb-table {
            width: 100%;
            border-collapse: collapse;
            margin: 1rem 0;
            font-size: 0.95rem;
        }

        .verb-table th {
            background: var(--primary);
            color: white;
            padding: 0.75rem;
            text-align: left;
            font-weight: 600;
        }

        .verb-table td {
            padding: 0.75rem;
            border-bottom: 1px solid var(--border);
        }

        .verb-table tr:nth-child(even) {
            background: var(--bg);
        }

        .verb-table tr:hover {
            background: rgba(99, 102, 241, 0.05);
        }

        /* Verb Type Labels */
        .verb-type {
            display: inline-block;
            padding: 0.25rem 0.75rem;
            border-radius: 1rem;
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
        }

        .type-regular {
            background: #dbeafe;
            color: #1e40af;
        }

        .type-irregular {
            background: #fee2e2;
            color: #991b1b;
        }

        .type-mixed {
            background: #fef3c7;
            color: #92400e;
        }

        .type-sein {
            background: #d1fae5;
            color: #065f46;
        }

        /* Formation Formula */
        .formula {
            background: #1e293b;
            color: #e2e8f0;
            padding: 1rem 1.5rem;
            border-radius: 0.75rem;
            font-family: 'Courier New', monospace;
            font-size: 1.1rem;
            margin: 1rem 0;
            overflow-x: auto;
        }

        .formula .ge {
            color: #f59e0b;
            font-weight: bold;
        }

        .formula .stem {
            color: #22c55e;
            font-weight: bold;
        }

        .formula .ending {
            color: #3b82f6;
            font-weight: bold;
        }

        /* Example Sentences */
        .example {
            background: var(--bg);
            padding: 1rem 1.25rem;
            border-radius: 0.75rem;
            margin: 0.75rem 0;
            display: flex;
            align-items: flex-start;
            gap: 0.75rem;
            flex-wrap: wrap;
        }

        .example .german-ex {
            flex: 1;
            min-width: 200px;
        }

        /* Exercise Sections */
        .exercise-section {
            background: var(--card-bg);
            border-radius: 1rem;
            padding: 1.5rem;
            margin-bottom: 1.5rem;
            box-shadow: var(--shadow);
        }

        .exercise-section h2 {
            color: var(--text);
            font-size: 1.4rem;
            margin-bottom: 0.5rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .exercise-instructions {
            color: var(--text-light);
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid var(--border);
        }

        /* Exercise Items */
        .exercise-item {
            margin-bottom: 1.5rem;
            padding: 1rem;
            background: var(--bg);
            border-radius: 0.75rem;
        }

        .exercise-item .question {
            font-weight: 500;
            margin-bottom: 0.75rem;
        }

        .exercise-item .hint {
            font-size: 0.875rem;
            color: var(--text-light);
            margin-bottom: 0.5rem;
        }

        /* Input Fields */
        .input-group {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            align-items: center;
        }

        .input-field {
            padding: 0.5rem 0.75rem;
            border: 2px solid var(--border);
            border-radius: 0.5rem;
            font-size: 1rem;
            transition: all 0.2s;
            min-width: 120px;
        }

        .input-field:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
        }

        .input-field.correct {
            border-color: var(--success);
            background: #f0fdf4;
        }

        .input-field.incorrect {
            border-color: var(--error);
            background: #fef2f2;
        }

        /* Buttons */
        .btn {
            padding: 0.5rem 1.25rem;
            border: none;
            border-radius: 0.5rem;
            font-size: 0.95rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

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

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

        .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;
        }

        /* Feedback */
        .feedback {
            margin-top: 0.75rem;
            padding: 0.75rem 1rem;
            border-radius: 0.5rem;
            font-size: 0.95rem;
            display: none;
        }

        .feedback.show {
            display: block;
            animation: fadeIn 0.3s ease;
        }

        .feedback.correct {
            background: #f0fdf4;
            color: #166534;
            border: 1px solid #86efac;
        }

        .feedback.incorrect {
            background: #fef2f2;
            color: #991b1b;
            border: 1px solid #fecaca;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(-5px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* Checkbox Exercise */
        .checkbox-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            gap: 0.75rem;
            margin: 1rem 0;
        }

        .checkbox-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.75rem;
            background: var(--bg);
            border-radius: 0.5rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .checkbox-item:hover {
            background: rgba(99, 102, 241, 0.1);
        }

        .checkbox-item input[type="checkbox"] {
            width: 1.25rem;
            height: 1.25rem;
            cursor: pointer;
        }

        .checkbox-item.correct {
            background: #f0fdf4;
            border: 2px solid var(--success);
        }

        .checkbox-item.incorrect {
            background: #fef2f2;
            border: 2px solid var(--error);
        }

        /* Checkbox labels for sein */
        .sein-indicator {
            color: var(--success);
            font-weight: bold;
            margin-left: 0.25rem;
        }

        /* Checklist */
        .checklist {
            background: var(--card-bg);
            border-radius: 1rem;
            padding: 1.5rem;
            box-shadow: var(--shadow);
        }

        .checklist h2 {
            color: var(--primary);
            margin-bottom: 1rem;
        }

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

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

        .checklist-item input[type="checkbox"] {
            width: 1.25rem;
            height: 1.25rem;
            margin-top: 0.25rem;
            cursor: pointer;
            accent-color: var(--primary);
        }

        .checklist-item label {
            cursor: pointer;
            flex: 1;
        }

        /* Bridge Section */
        .connectivity {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1.5rem;
            margin-top: 2rem;
            padding-top: 2rem;
            border-top: 2px solid var(--border);
        }

        .connectivity > div {
            padding: 1.25rem;
            border-radius: 0.75rem;
        }

        .from-prev {
            background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
        }

        .to-next {
            background: linear-gradient(135deg, #fef3c7, #fde68a);
        }

        .connectivity h4 {
            margin-bottom: 0.5rem;
            font-size: 1rem;
        }

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

        /* Footer */
        footer {
            text-align: center;
            padding: 2rem;
            color: var(--text-light);
            border-top: 1px solid var(--border);
            margin-top: 2rem;
        }

        /* Progress Indicator */
        .progress-indicator {
            position: fixed;
            top: 0;
            left: 0;
            height: 4px;
            background: linear-gradient(90deg, var(--primary), var(--secondary));
            transition: width 0.3s ease;
            z-index: 1000;
        }

        /* Mobile Responsive */
        @media (max-width: 768px) {
            .chapter-nav {
                padding: 0.75rem;
            }

            .chapter-nav a {
                font-size: 0.875rem;
                padding: 0.4rem 0.75rem;
            }

            .container {
                padding: 1rem;
            }

            .theory-card, .exercise-section {
                padding: 1rem;
            }

            .verb-table {
                font-size: 0.85rem;
            }

            .verb-table th, .verb-table td {
                padding: 0.5rem;
            }

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

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

            .input-group {
                flex-direction: column;
                align-items: stretch;
            }

            .input-field {
                width: 100%;
            }
        }

        /* Print Styles */
        @media print {
            .chapter-nav, .audio-btn, .btn, .streak-counter {
                display: none !important;
            }

            .theory-card, .exercise-section {
                box-shadow: none;
                border: 1px solid #ccc;
            }
        }

        /* Tooltip */
        .tooltip {
            position: relative;
            cursor: help;
            border-bottom: 1px dotted var(--primary);
        }

        .tooltip:hover::after {
            content: attr(data-tooltip);
            position: absolute;
            bottom: 100%;
            left: 50%;
            transform: translateX(-50%);
            background: var(--text);
            color: white;
            padding: 0.5rem 0.75rem;
            border-radius: 0.5rem;
            font-size: 0.8rem;
            white-space: nowrap;
            z-index: 10;
        }

        /* Collapsible sections */
        .collapsible {
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .collapsible::after {
            content: "▼";
            font-size: 0.75rem;
            transition: transform 0.3s;
        }

        .collapsible.active::after {
            transform: rotate(180deg);
        }

        .collapsible-content {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease;
        }

        .collapsible-content.show {
            max-height: 2000px;
        }
