:root {
            --bg-primary: #fafafa;
            --bg-secondary: #f5f5dc;
            --bg-tertiary: #e8f5e9;
            --text-primary: #2e7d32;
            --text-secondary: #1b5e20;
            --accent-purple: #7b1fa2;
            --accent-purple-light: #9c27b0;
            --accent-gray: #757575;
            --success: #4caf50;
            --error: #f44336;
            --warning: #ff9800;
            --white: #ffffff;
            --shadow: rgba(0,0,0,0.1);
            --transition: all 0.3s ease;
        }

        [data-theme="dark"] {
            --bg-primary: #121212;
            --bg-secondary: #1e1e1e;
            --bg-tertiary: #2d3b2d;
            --text-primary: #81c784;
            --text-secondary: #66bb6a;
            --accent-purple: #ba68c8;
            --accent-purple-light: #ce93d8;
            --accent-gray: #9e9e9e;
            --white: #1e1e1e;
            --shadow: rgba(0,0,0,0.3);
        }

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

        html {
            scroll-behavior: smooth;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
            background-color: var(--bg-primary);
            color: var(--text-primary);
            line-height: 1.6;
            font-size: 16px;
            transition: var(--transition);
        }

        /* Header Styles */
        header {
            background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
            padding: 1rem;
            position: sticky;
            top: 0;
            z-index: 100;
            box-shadow: 0 2px 10px var(--shadow);
            border-bottom: 2px solid var(--text-primary);
            transition: var(--transition);
        }

        .header-content {
            max-width: 900px;
            margin: 0 auto;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .header-top {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .logo {
            font-size: 1.5rem;
            font-weight: bold;
            color: var(--text-secondary);
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .logo::before {
            content: "📚";
        }

        .header-controls {
            display: flex;
            gap: 0.5rem;
            align-items: center;
        }

        .theme-toggle {
            background: var(--white);
            border: 2px solid var(--text-primary);
            border-radius: 20px;
            padding: 0.5rem 1rem;
            cursor: pointer;
            font-size: 1rem;
            transition: var(--transition);
        }

        .theme-toggle:hover {
            transform: scale(1.05);
        }

        .exercise-indicator {
            background: var(--text-primary);
            color: var(--white);
            padding: 0.25rem 0.75rem;
            border-radius: 20px;
            font-size: 0.875rem;
            font-weight: 600;
        }

        .nav-buttons {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        .nav-btn {
            background: var(--white);
            color: var(--text-primary);
            border: 2px solid var(--text-primary);
            padding: 0.5rem 1rem;
            border-radius: 8px;
            text-decoration: none;
            font-weight: 600;
            transition: var(--transition);
            display: inline-flex;
            align-items: center;
            gap: 0.25rem;
        }

        .nav-btn:hover {
            background: var(--text-primary);
            color: var(--white);
            transform: translateY(-2px);
        }

        /* Main Content */
        main {
            max-width: 900px;
            margin: 0 auto;
            padding: 2rem 1rem;
        }

        h1 {
            color: var(--text-secondary);
            margin-bottom: 0.5rem;
            font-size: 2rem;
        }

        .subtitle {
            color: var(--accent-purple);
            font-size: 1.25rem;
            margin-bottom: 2rem;
            font-weight: 600;
        }

        /* Section Styles */
        section {
            background: var(--white);
            border-radius: 12px;
            padding: 2rem;
            margin-bottom: 2rem;
            box-shadow: 0 4px 6px var(--shadow);
            border-left: 4px solid var(--text-primary);
            transition: var(--transition);
        }

        h2 {
            color: var(--text-secondary);
            margin-bottom: 1.5rem;
            font-size: 1.5rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        h3 {
            color: var(--text-primary);
            margin: 1.5rem 0 0.75rem;
            font-size: 1.25rem;
        }

        p {
            margin-bottom: 1rem;
            line-height: 1.8;
        }

        /* Interactive Tools */
        .tool-container {
            background: var(--bg-secondary);
            border-radius: 8px;
            padding: 1.5rem;
            margin: 1.5rem 0;
            border: 2px solid var(--text-primary);
            transition: var(--transition);
        }

        .verb-splitter {
            text-align: center;
        }

        .verb-display {
            font-size: 2rem;
            margin: 1rem 0;
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 1rem;
            flex-wrap: wrap;
        }

        .prefix {
            color: var(--accent-purple);
            font-weight: bold;
            padding: 0.5rem 1rem;
            background: rgba(123, 31, 162, 0.1);
            border-radius: 8px;
            transition: all 0.5s ease;
        }

        .stem {
            color: var(--text-primary);
            font-weight: bold;
            padding: 0.5rem 1rem;
        }

        .arrow {
            font-size: 1.5rem;
            color: var(--text-secondary);
        }

        .sentence-demo {
            background: var(--white);
            padding: 1rem;
            border-radius: 8px;
            margin-top: 1rem;
            font-size: 1.25rem;
            min-height: 60px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-wrap: wrap;
            gap: 0.5rem;
            border: 2px dashed var(--text-primary);
            transition: var(--transition);
        }

        .demo-word {
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
        }

        .demo-prefix {
            color: var(--accent-purple);
            font-weight: bold;
            border: 2px solid var(--accent-purple);
            background: rgba(123, 31, 162, 0.05);
            animation: fadeIn 0.5s ease;
        }

        .demo-verb {
            color: var(--text-primary);
            font-weight: 600;
        }

        .demo-subject {
            color: var(--text-secondary);
        }

        .controls {
            margin-top: 1rem;
            display: flex;
            gap: 0.5rem;
            justify-content: center;
            flex-wrap: wrap;
        }

        button {
            background: var(--text-primary);
            color: var(--white);
            border: none;
            padding: 0.75rem 1.5rem;
            border-radius: 8px;
            cursor: pointer;
            font-size: 1rem;
            font-weight: 600;
            transition: var(--transition);
        }

        button:hover {
            background: var(--text-secondary);
            transform: translateY(-2px);
            box-shadow: 0 4px 8px var(--shadow);
        }

        button.secondary {
            background: var(--white);
            color: var(--text-primary);
            border: 2px solid var(--text-primary);
        }

        button.secondary:hover {
            background: var(--bg-tertiary);
        }

        button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
        }

        button.small {
            padding: 0.4rem 0.8rem;
            font-size: 0.875rem;
        }

        button.hint-btn {
            background: var(--warning);
            color: white;
        }

        /* Tables */
        .prefix-table {
            width: 100%;
            border-collapse: collapse;
            margin: 1rem 0;
            background: var(--white);
            border-radius: 8px;
            overflow: hidden;
        }

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

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

        .prefix-table tr:hover {
            background: var(--bg-tertiary);
        }

        .separable {
            color: var(--accent-purple);
            font-weight: bold;
        }

        .inseparable {
            color: var(--accent-gray);
            font-weight: bold;
        }

        /* Exercise Styles */
        .exercise {
            background: var(--bg-secondary);
            border-radius: 12px;
            padding: 1.5rem;
            margin-bottom: 2rem;
            border: 2px solid var(--text-primary);
            transition: var(--transition);
        }

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

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

        .exercise-number {
            background: var(--accent-purple);
            color: var(--white);
            padding: 0.25rem 0.75rem;
            border-radius: 20px;
            font-size: 0.875rem;
        }

        .question {
            background: var(--white);
            padding: 1rem;
            margin-bottom: 1rem;
            border-radius: 8px;
            border-left: 4px solid var(--accent-purple);
            transition: var(--transition);
        }

        .question.correct {
            border-left-color: var(--success);
            background: rgba(76, 175, 80, 0.05);
        }

        .question.incorrect {
            border-left-color: var(--error);
            background: rgba(244, 67, 54, 0.05);
        }

        .question-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 0.5rem;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .question-number {
            font-weight: bold;
            color: var(--accent-purple);
            margin-right: 0.5rem;
        }

        .question-actions {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        .input-group {
            display: flex;
            gap: 0.5rem;
            align-items: center;
            flex-wrap: wrap;
            margin-top: 0.5rem;
        }

        input[type="text"], select {
            padding: 0.5rem;
            border: 2px solid var(--text-primary);
            border-radius: 6px;
            font-size: 1rem;
            background: var(--white);
            color: var(--text-primary);
            transition: var(--transition);
        }

        input[type="text"]:focus, select:focus {
            outline: none;
            border-color: var(--accent-purple);
            box-shadow: 0 0 0 3px rgba(123, 31, 162, 0.1);
        }

        input[type="text"].correct {
            border-color: var(--success);
            background: rgba(76, 175, 80, 0.1);
        }

        input[type="text"].incorrect {
            border-color: var(--error);
            background: rgba(244, 67, 54, 0.1);
        }

        .split-input {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            background: var(--bg-secondary);
            padding: 0.5rem;
            border-radius: 6px;
            flex-wrap: wrap;
        }

        .split-input input {
            width: 120px;
            text-align: center;
        }

        .prefix-box {
            background: rgba(123, 31, 162, 0.1);
            border: 2px solid var(--accent-purple);
            color: var(--accent-purple);
            padding: 0.5rem;
            border-radius: 6px;
            font-weight: bold;
            min-width: 80px;
            text-align: center;
            transition: var(--transition);
        }

        .checkbox-group {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            gap: 0.75rem;
            margin-top: 1rem;
        }

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

        .checkbox-item:hover {
            border-color: var(--text-primary);
            transform: translateX(4px);
        }

        .checkbox-item input[type="checkbox"] {
            width: 20px;
            height: 20px;
            cursor: pointer;
            accent-color: var(--accent-purple);
        }

        .checkbox-item.checked {
            background: rgba(123, 31, 162, 0.1);
            border-color: var(--accent-purple);
        }

        .checkbox-item.correct-answer {
            background: rgba(76, 175, 80, 0.1);
            border-color: var(--success);
        }

        .checkbox-item.wrong-answer {
            background: rgba(244, 67, 54, 0.1);
            border-color: var(--error);
        }

        .verb-text {
            font-weight: 600;
            color: var(--text-primary);
        }

        .verb-meaning {
            color: var(--accent-gray);
            font-size: 0.875rem;
            margin-left: auto;
        }

        .verb-type-label {
            font-size: 0.75rem;
            padding: 0.2rem 0.5rem;
            border-radius: 4px;
            margin-left: 0.5rem;
            font-weight: bold;
        }

        .verb-type-label.separable {
            background: rgba(123, 31, 162, 0.2);
            color: var(--accent-purple);
        }

        .verb-type-label.inseparable {
            background: rgba(117, 117, 117, 0.2);
            color: var(--accent-gray);
        }

        .checkmark {
            color: var(--success);
            font-weight: bold;
            margin-left: 0.5rem;
            display: none;
        }

        .checkbox-item.checked .checkmark {
            display: inline;
        }

        /* Feedback */
        .feedback {
            margin-top: 0.5rem;
            padding: 0.75rem;
            border-radius: 6px;
            font-size: 0.875rem;
            display: none;
            animation: slideDown 0.3s ease;
        }

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

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

        .feedback.correct {
            background: rgba(76, 175, 80, 0.1);
            color: var(--success);
            border: 1px solid var(--success);
            display: block;
        }

        .feedback.incorrect {
            background: rgba(244, 67, 54, 0.1);
            color: var(--error);
            border: 1px solid var(--error);
            display: block;
        }

        .feedback.hint {
            background: rgba(255, 152, 0, 0.1);
            color: var(--warning);
            border: 1px solid var(--warning);
            display: block;
        }

        .correct-answer {
            color: var(--success);
            font-weight: 600;
            margin-left: 0.5rem;
        }

        /* Action Buttons */
        .action-buttons {
            display: flex;
            gap: 1rem;
            margin-top: 2rem;
            flex-wrap: wrap;
            justify-content: center;
        }

        .action-buttons button {
            min-width: 150px;
        }

        #checkAll {
            background: var(--success);
        }

        #showAll {
            background: var(--accent-purple);
        }

        #resetAll {
            background: var(--error);
        }

        /* Progress Bar */
        .progress-container {
            background: var(--bg-secondary);
            border-radius: 20px;
            padding: 0.5rem;
            margin: 2rem 0;
            position: sticky;
            top: 80px;
            z-index: 50;
            box-shadow: 0 2px 10px var(--shadow);
            transition: var(--transition);
        }

        .progress-bar {
            background: var(--text-primary);
            height: 20px;
            border-radius: 10px;
            transition: width 0.5s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--white);
            font-size: 0.75rem;
            font-weight: bold;
            position: relative;
            overflow: hidden;
        }

        .progress-bar::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
            animation: shimmer 2s infinite;
        }

        @keyframes shimmer {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(100%); }
        }


        /* Two Clause Visualizer */
        .clause-container {
            background: var(--white);
            padding: 1.5rem;
            border-radius: 8px;
            margin: 1rem 0;
            border: 2px solid var(--text-primary);
            transition: var(--transition);
        }

        .clause {
            padding: 1rem;
            margin: 0.5rem 0;
            background: var(--bg-tertiary);
            border-radius: 8px;
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 0.5rem;
            font-size: 1.1rem;
            transition: var(--transition);
        }

        .clause-connector {
            text-align: center;
            color: var(--accent-purple);
            font-weight: bold;
            margin: 0.5rem 0;
        }

        .highlight-prefix {
            background: rgba(123, 31, 162, 0.2);
            border: 2px solid var(--accent-purple);
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            font-weight: bold;
            color: var(--accent-purple);
        }

        /* Footer */
        footer {
            background: var(--bg-secondary);
            padding: 2rem 1rem;
            text-align: center;
            border-top: 2px solid var(--text-primary);
            margin-top: 3rem;
            transition: var(--transition);
        }

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

        .footer-link {
            color: var(--text-primary);
            text-decoration: none;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .footer-link:hover {
            color: var(--accent-purple);
        }

        /* Confetti Canvas */
        #confetti-canvas {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 1000;
        }

        /* Save Indicator */
        .save-indicator {
            position: fixed;
            bottom: 20px;
            right: 20px;
            background: var(--text-primary);
            color: white;
            padding: 0.5rem 1rem;
            border-radius: 20px;
            font-size: 0.875rem;
            opacity: 0;
            transition: opacity 0.3s;
            z-index: 100;
        }

        .save-indicator.show {
            opacity: 1;
        }

        /* Responsive */
        @media (max-width: 600px) {
            h1 { font-size: 1.5rem; }
            .subtitle { font-size: 1rem; }
            section { padding: 1rem; }
            .verb-display { font-size: 1.5rem; }
            .checkbox-group { grid-template-columns: 1fr; }
            .input-group { flex-direction: column; align-items: stretch; }
            input[type="text"] { width: 100%; }
            .question-actions { width: 100%; justify-content: flex-end; }
        }

        /* Utility Classes */
        .hidden { display: none !important; }
        .text-center { text-align: center; }
        .mb-2 { margin-bottom: 2rem; }
        .mt-2 { margin-top: 2rem; }
        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0,0,0,0);
            border: 0;
        }

        /* Animation */
        @keyframes slideRight {
            from { transform: translateX(0); }
            to { transform: translateX(100px); }
        }

        .animate-slide {
            animation: slideRight 1s ease forwards;
        }

        /* Tooltip */
        .tooltip {
            position: relative;
            display: inline-block;
            border-bottom: 1px dotted var(--accent-purple);
            cursor: help;
        }

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

        /* Completion Checkbox */
        .completion-box {
            background: var(--bg-tertiary);
            padding: 1rem;
            border-radius: 8px;
            margin-top: 2rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            justify-content: center;
            border: 2px solid var(--text-primary);
            transition: var(--transition);
        }

        .completion-box input[type="checkbox"] {
            width: 24px;
            height: 24px;
            accent-color: var(--success);
        }

        .completion-box label {
            font-weight: 600;
            cursor: pointer;
        }

        /* Print Styles */
        @media print {
            header, footer, .action-buttons, .question-actions, .theme-toggle {
                display: none !important;
            }
            section {
                break-inside: avoid;
                box-shadow: none;
                border: 1px solid #ccc;
            }
            input {
                border: 1px solid #999 !important;
                background: white !important;
            }
        }
