* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #212529;
    line-height: 1.6;
    padding: 20px;
}

.quiz-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.level-selection, .unit-selection {
    text-align: center;
    margin-bottom: 30px;
}

.level-btn, .unit-btn, .activity-btn {
    margin: 10px;
    padding: 15px 25px;
    font-size: 1.1rem;
    background-color: #4361ee;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: block;
    width: 100%;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.level-btn:hover, .unit-btn:hover, .activity-btn:hover {
    background-color: #3a0ca3;
    transform: translateY(-2px);
}

.quiz-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
    border-radius: 12px;
}

.unit-text, .dictation-area {
    margin-bottom: 30px;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Multiple Choice Quiz Styles */
.quiz-question {
    margin-bottom: 25px;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.quiz-option {
    display: block;
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 10px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-option:hover {
    background-color: #e9ecef;
}

.quiz-option.selected {
    background-color: #d1ecf1;
    border-color: #4cc9f0;
}

.quiz-option.correct {
    background-color: #d4edda;
    border-color: #4bb543;
}

.quiz-option.incorrect {
    background-color: #f8d7da;
    border-color: #dc3545;
}

.quiz-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.btn {
    padding: 12px 20px;
    background-color: #4361ee;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
}

.btn:hover {
    background-color: #3a0ca3;
}

.btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.btn-success {
    background-color: #4bb543;
}

.btn-success:hover {
    background-color: #3a9c35;
}

.quiz-results {
    text-align: center;
    padding: 30px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.score {
    font-size: 2rem;
    font-weight: bold;
    margin: 20px 0;
    color: #4361ee;
}

.results-breakdown {
    text-align: left;
    margin-top: 30px;
}

.result-item {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 6px;
    background-color: #f8f9fa;
}

.result-correct {
    border-left: 4px solid #4bb543;
}

.result-incorrect {
    border-left: 4px solid #dc3545;
}

.hidden {
    display: none;
}

.feedback {
    font-style: italic;
    color: #6c757d;
    margin-top: 10px;
}

/* TTS & Dictation Styles */
.tts-btn, .dictation-btn {
    background: none;
    border: none;
    color: #4361ee;
    cursor: pointer;
    font-size: 1.2rem;
    margin-left: 10px;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s;
}

.tts-btn:hover, .dictation-btn:hover {
    background-color: #f0f0f0;
    transform: scale(1.1);
}

.tts-btn.playing, .dictation-btn.playing {
    color: #4bb543;
    animation: pulse 1s infinite;
}

.tts-btn.disabled, .dictation-btn.disabled {
    color: #6c757d;
    cursor: not-allowed;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.tts-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.tts-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
}

.tts-toggle input {
    width: auto;
}

.tts-warning {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 5px;
}

.question-header, .option-text, .unit-text-header {
    display: flex;
    align-items: center;
}

/* Dictation Specific */
.dictation-output {
    min-height: 80px;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    background-color: #f8f9fa;
    line-height: 2;
}

.dictation-correct {
    color: #4bb543;
    font-weight: bold;
}

.dictation-input-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.dictation-input-group input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.dictation-sentence {
    color: transparent;
    display: inline;
    user-select: none;
}

.dictation-finished {
    color: #4bb543;
    font-weight: bold;
    user-select: text;
}

.mode-selection {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

/* Arabic text support */
.arabic-text {
    direction: rtl;
    text-align: right;
    font-family: 'Segoe UI', Tahoma, 'Arabic Typesetting', 'Traditional Arabic', Arial, sans-serif;
    font-size: 1.1rem;
    line-height: 1.8;
}

.language-indicator {
    display: inline-block;
    padding: 3px 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-left: 10px;
}

.dictation-input-group input.arabic-text {
    direction: rtl;
    text-align: right;
}