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

:root {
    --primary: #00843D;
    --primary-dark: #006B31;
    --secondary: #FFCD00;
    --background: #f5f5f5;
    --card-bg: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --success: #28a745;
    --error: #dc3545;
    --warning: #ffc107;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --transition: all 0.3s ease;
}

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

/* App Container */
.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 20px;
    position: relative;
}

.header h1 {
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 20px;
}

/* Sound Toggle */
.sound-toggle {
    position: absolute;
    top: 20px;
    right: 0;
    background: var(--card-bg);
    border: 2px solid #ddd;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sound-toggle:hover {
    border-color: var(--primary);
    background: #f0f8f4;
}

.sound-toggle .sound-off {
    display: none;
}

.sound-toggle.muted .sound-on {
    display: none;
}

.sound-toggle.muted .sound-off {
    display: inline;
}

/* Mode Selector */
.mode-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-btn {
    padding: 12px 24px;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

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

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

/* Main Content */
.main-content {
    flex: 1;
}

.mode-section {
    display: none;
}

.mode-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Controls Bar */
.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.category-select {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: var(--radius);
    font-size: 1rem;
    background: white;
    cursor: pointer;
    min-width: 150px;
}

.category-select:focus {
    outline: none;
    border-color: var(--primary);
}

.card-counter {
    font-weight: 600;
    color: var(--text-light);
}

/* Flashcard Styles */
.flashcard-container {
    perspective: 1000px;
    margin: 20px 0;
}

.flashcard {
    width: 100%;
    max-width: 500px;
    height: 300px;
    margin: 0 auto;
    cursor: pointer;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

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

.flashcard-back {
    background: var(--card-bg);
    transform: rotateY(180deg);
    border: 3px solid var(--secondary);
}

.term {
    font-size: 2.5rem;
    font-weight: 700;
}

.meaning {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--primary);
}

.example {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-light);
}

/* Speak Button */
.speak-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.flashcard-front .speak-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.flashcard-front .speak-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

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

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

.speak-btn.speaking {
    animation: pulse 0.5s ease infinite;
}

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

/* Flashcard Navigation */
.flashcard-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.nav-btn,
.flip-btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.nav-btn {
    background: #e0e0e0;
    color: var(--text);
}

.nav-btn:hover {
    background: #d0d0d0;
}

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

.flip-btn:hover {
    background: #e6b800;
}

/* Quiz Styles */
.quiz-container {
    max-width: 600px;
    margin: 0 auto;
}

.quiz-start,
.quiz-results {
    text-align: center;
    padding: 40px 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.quiz-start h2,
.quiz-results h2 {
    color: var(--primary);
    margin-bottom: 15px;
}

.start-btn,
.next-btn {
    padding: 15px 40px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 20px;
}

.start-btn:hover,
.next-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.quiz-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-weight: 600;
    color: var(--text-light);
}

.quiz-score {
    color: var(--primary);
}

.question-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.question-card h2 {
    color: var(--text);
    margin-bottom: 25px;
    font-size: 1.5rem;
}

.answer-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.answer-btn {
    padding: 15px 20px;
    background: var(--card-bg);
    border: 2px solid #ddd;
    border-radius: var(--radius);
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.answer-btn:hover {
    border-color: var(--primary);
    background: #f0f8f4;
}

.answer-btn.correct {
    border-color: var(--success);
    background: #d4edda;
}

.answer-btn.incorrect {
    border-color: var(--error);
    background: #f8d7da;
}

.answer-btn.disabled {
    pointer-events: none;
}

.feedback {
    margin-top: 20px;
    padding: 15px;
    border-radius: var(--radius);
    text-align: center;
}

.feedback.correct {
    background: #d4edda;
    color: var(--success);
}

.feedback.incorrect {
    background: #f8d7da;
    color: var(--error);
}

/* Quiz Results */
.results-score {
    margin: 30px 0;
}

.big-score {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.score-label {
    font-size: 1.2rem;
    color: var(--text-light);
}

/* Review Mode Styles */
.review-container {
    max-width: 600px;
    margin: 0 auto;
}

.review-stats {
    text-align: center;
    padding: 30px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.review-stats h2 {
    color: var(--primary);
    margin-bottom: 25px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    padding: 20px 10px;
    background: var(--background);
    border-radius: var(--radius);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.reset-btn {
    padding: 10px 20px;
    background: transparent;
    border: 2px solid var(--error);
    color: var(--error);
    border-radius: var(--radius);
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 15px;
    transition: var(--transition);
}

.reset-btn:hover {
    background: var(--error);
    color: white;
}

.review-card {
    text-align: center;
}

.review-progress {
    margin-bottom: 20px;
    font-weight: 600;
    color: var(--text-light);
}

/* Rating Buttons */
.rating-buttons {
    margin-top: 20px;
}

.rating-buttons p {
    margin-bottom: 15px;
    font-weight: 600;
}

.rating-grid {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.rating-btn {
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: white;
}

.rating-1 { background: #dc3545; }
.rating-2 { background: #fd7e14; }
.rating-3 { background: #ffc107; color: var(--text); }
.rating-4 { background: #20c997; }
.rating-5 { background: #28a745; }

.rating-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.review-complete {
    text-align: center;
    padding: 40px 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.review-complete h2 {
    color: var(--primary);
    margin-bottom: 15px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 30px;
    color: var(--text-light);
}

/* ===== NEW GAMIFICATION STYLES ===== */

/* Header Top with Stats */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.header-stats {
    display: flex;
    gap: 12px;
    font-weight: 600;
    font-size: 0.9rem;
}

.streak-badge, .xp-badge, .level-badge {
    background: var(--card-bg);
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.streak-badge { color: #ff6b35; }
.xp-badge { color: #ffc107; }
.level-badge { color: var(--primary); }

/* Search Bar */
.search-bar {
    position: relative;
    margin-bottom: 15px;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 2px solid #ddd;
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-light);
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    margin-bottom: 15px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Flashcard Controls */
.flashcard-controls {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: 50%;
    background: var(--card-bg);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    border-color: var(--primary);
    background: #f0f8f4;
}

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

/* Timed Mode Toggle */
.timed-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 2px solid #ddd;
    font-weight: 600;
}

.timed-toggle input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Quiz Timer */
.quiz-timer-container {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.quiz-timer-container .timer-display {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.timer-bar-container {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.timer-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s linear;
    width: 100%;
}

.timer-bar.warning {
    background: var(--warning);
}

.timer-bar.danger {
    background: var(--error);
    animation: pulse 0.3s ease infinite;
}

/* High Score Display */
.high-score-display {
    margin: 15px 0;
    font-size: 1.1rem;
    color: var(--text-light);
}

/* Achievements Container */
.achievements-container {
    max-width: 600px;
    margin: 0 auto;
}

.achievements-container h2 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 25px;
}

/* Daily Challenge */
.daily-challenge {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 25px;
    text-align: center;
}

.daily-challenge h3 {
    margin-bottom: 15px;
}

.challenge-card {
    background: rgba(255,255,255,0.15);
    padding: 20px;
    border-radius: var(--radius);
}

.challenge-term {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.challenge-hint {
    opacity: 0.9;
    margin-bottom: 15px;
}

/* Level Progress */
.level-progress {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    text-align: center;
}

.level-progress h3 {
    margin-bottom: 15px;
    color: var(--text);
}

.level-bar-container {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.level-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 10px;
    transition: width 0.5s ease;
}

.level-info {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Badges Grid */
.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.badge {
    background: var(--card-bg);
    padding: 15px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.badge.locked {
    opacity: 0.5;
    filter: grayscale(100%);
}

.badge.unlocked {
    border: 2px solid var(--secondary);
}

.badge-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.badge-name {
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.badge-desc {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Favorites Section */
.favorites-section {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.favorites-section h3 {
    margin-bottom: 15px;
    color: var(--text);
}

.favorites-list {
    max-height: 300px;
    overflow-y: auto;
}

.no-favorites {
    color: var(--text-light);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.favorite-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: var(--transition);
}

.favorite-item:hover {
    background: #f5f5f5;
}

.fav-term {
    font-weight: 600;
    color: var(--primary);
}

.fav-meaning {
    flex: 1;
    margin: 0 15px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.remove-fav {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--error);
    cursor: pointer;
    opacity: 0.5;
}

.remove-fav:hover {
    opacity: 1;
}

/* Game Notification Toast */
.game-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--primary);
    color: white;
    padding: 15px 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    font-weight: 600;
    transition: transform 0.3s ease;
}

.game-notification.show {
    transform: translateX(-50%) translateY(0);
}

/* ===== VOICE PRACTICE STYLES ===== */

.voice-practice-section {
    margin-top: 20px;
    text-align: center;
}

.voice-practice-controls {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.practice-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.practice-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.practice-btn .mic-icon {
    font-size: 1.3rem;
}

.practice-btn.recording {
    background: linear-gradient(135deg, #e53935, #d32f2f);
    animation: recordingPulse 1.5s ease infinite;
}

.practice-btn.recording .btn-text::after {
    content: 'Listening...';
}

.practice-btn.recording .btn-text {
    font-size: 0;
}

.recording-indicator {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transition: var(--transition);
}

.recording-indicator.active {
    background: #fff;
    animation: blink 0.8s ease infinite;
}

@keyframes recordingPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(229, 57, 53, 0); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Voice Feedback */
.voice-practice-feedback {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    animation: slideUp 0.3s ease;
}

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

.voice-transcript {
    font-size: 1.3rem;
    color: var(--text-light);
    margin-bottom: 15px;
    font-style: italic;
    min-height: 30px;
}

.voice-transcript.final {
    color: var(--text);
    font-style: normal;
}

.voice-result {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.voice-score {
    font-size: 2rem;
    font-weight: 700;
    padding: 8px 20px;
    border-radius: 20px;
    background: #e0e0e0;
}

.voice-score.excellent {
    background: linear-gradient(135deg, #4caf50, #8bc34a);
    color: white;
}

.voice-score.good {
    background: linear-gradient(135deg, #8bc34a, #cddc39);
    color: white;
}

.voice-score.close {
    background: linear-gradient(135deg, #ffc107, #ffeb3b);
    color: #333;
}

.voice-score.partial {
    background: linear-gradient(135deg, #ff9800, #ffc107);
    color: white;
}

.voice-score.tryagain,
.voice-score.different {
    background: linear-gradient(135deg, #f44336, #ff5722);
    color: white;
}

.voice-feedback {
    font-size: 1.1rem;
    font-weight: 600;
}

.voice-feedback.excellent { color: #4caf50; }
.voice-feedback.good { color: #8bc34a; }
.voice-feedback.close { color: #ff9800; }
.voice-feedback.partial { color: #ff9800; }
.voice-feedback.tryagain { color: #f44336; }
.voice-feedback.different { color: #f44336; }
.voice-feedback.error { color: #f44336; }
.voice-feedback.listening {
    color: var(--primary);
    animation: pulse 1s ease infinite;
}

/* Browser support notice */
.voice-unsupported {
    background: #fff3cd;
    color: #856404;
    padding: 10px 15px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-top: 10px;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 600px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .mode-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .flashcard {
        height: 250px;
    }

    .term {
        font-size: 2rem;
    }

    .meaning {
        font-size: 1.2rem;
    }

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

    .rating-grid {
        flex-direction: column;
    }

    .rating-btn {
        width: 100%;
    }

    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .category-select {
        width: 100%;
    }

    .mode-selector {
        gap: 5px;
    }

    .mode-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .header-buttons {
        gap: 5px;
    }
}

/* ===== DARK MODE STYLES ===== */
body.dark-mode {
    --background: #1a1a2e;
    --card-bg: #16213e;
    --text: #eaeaea;
    --text-light: #a0a0a0;
    --primary: #4ecca3;
    --primary-dark: #3db892;
    --secondary: #ffd369;
}

body.dark-mode .header h1 {
    color: var(--secondary);
}

body.dark-mode .flashcard-front {
    background: linear-gradient(135deg, #4ecca3, #3db892);
}

body.dark-mode .search-input,
body.dark-mode .category-select {
    background: var(--card-bg);
    color: var(--text);
    border-color: #2a2a4e;
}

body.dark-mode .mode-btn {
    background: var(--card-bg);
    color: var(--text);
    border-color: #2a2a4e;
}

body.dark-mode .mode-btn.active {
    background: var(--primary);
    color: #1a1a2e;
}

body.dark-mode .stat-card,
body.dark-mode .badge,
body.dark-mode .fillblank-card,
body.dark-mode .sentence-card,
body.dark-mode .builder-container,
body.dark-mode .fillblank-container {
    background: var(--card-bg);
}

body.dark-mode .favorite-item:hover {
    background: #2a2a4e;
}

body.dark-mode .answer-btn {
    background: var(--card-bg);
    border-color: #2a2a4e;
    color: var(--text);
}

body.dark-mode .answer-btn:hover {
    border-color: var(--primary);
}

body.dark-mode .draggable-word {
    background: var(--card-bg);
    border-color: #2a2a4e;
    color: var(--text);
}

body.dark-mode .nav-btn {
    background: #2a2a4e;
    color: #eaeaea;
}

body.dark-mode .nav-btn:hover {
    background: #3a3a5e;
}

body.dark-mode .flip-btn {
    background: var(--secondary);
    color: #1a1a2e;
}

/* Header Buttons */
.header-buttons {
    display: flex;
    gap: 10px;
}

.icon-toggle {
    background: var(--card-bg);
    border: 2px solid #ddd;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-toggle:hover {
    border-color: var(--primary);
    background: #f0f8f4;
}

body.dark-mode .icon-toggle {
    background: var(--card-bg);
    border-color: #2a2a4e;
}

body.dark-mode .icon-toggle:hover {
    border-color: var(--primary);
    background: #2a2a4e;
}

.icon-toggle .sound-off {
    display: none;
}

.icon-toggle.muted .sound-on {
    display: none;
}

.icon-toggle.muted .sound-off {
    display: inline;
}

/* ===== AUTH SCREEN ===== */
.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    padding: 20px;
}

.auth-container {
    background: white;
    padding: 40px 50px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.auth-logo {
    font-size: 4rem;
    margin-bottom: 10px;
}

.auth-container h1 {
    color: #1e3c72;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.auth-subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 1rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-input {
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    text-align: center;
    letter-spacing: 2px;
    transition: border-color 0.3s;
}

.auth-input:focus {
    outline: none;
    border-color: #1e3c72;
}

.auth-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #00b894, #00a085);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 184, 148, 0.4);
}

.auth-error {
    color: #e74c3c;
    margin-top: 15px;
    font-weight: 500;
}

.auth-hint {
    color: #999;
    font-size: 0.85rem;
    margin-top: 20px;
}

body.dark-mode .auth-screen {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

body.dark-mode .auth-container {
    background: #16213e;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

body.dark-mode .auth-container h1 {
    color: #4ecca3;
}

body.dark-mode .auth-subtitle {
    color: #a0a0a0;
}

body.dark-mode .auth-input {
    background: #1a1a2e;
    border-color: #2a2a4e;
    color: #eaeaea;
}

body.dark-mode .auth-input:focus {
    border-color: #4ecca3;
}

body.dark-mode .auth-hint {
    color: #666;
}

.logout-btn {
    opacity: 0.7;
}

.logout-btn:hover {
    opacity: 1;
}

/* ===== DIFFICULTY BADGE ===== */
.difficulty-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.difficulty-badge.beginner {
    background: #4caf50;
    color: white;
}

.difficulty-badge.intermediate {
    background: #ff9800;
    color: white;
}

.difficulty-badge.advanced {
    background: #f44336;
    color: white;
}

/* ===== FILL-IN-THE-BLANK STYLES ===== */
.fillblank-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.fillblank-start h2,
.fillblank-results h2 {
    color: var(--primary);
    margin-bottom: 15px;
}

.mode-description {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.fillblank-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-weight: 600;
}

.fillblank-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.fillblank-sentence {
    font-size: 1.4rem;
    line-height: 1.8;
    margin-bottom: 15px;
    color: var(--text);
}

.fillblank-hint {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 20px;
    font-style: italic;
}

.fillblank-input-container {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.fillblank-input {
    padding: 12px 20px;
    font-size: 1.1rem;
    border: 2px solid #ddd;
    border-radius: var(--radius);
    width: 250px;
    text-align: center;
    transition: var(--transition);
}

.fillblank-input:focus {
    outline: none;
    border-color: var(--primary);
}

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

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

.submit-btn {
    padding: 12px 25px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

.fillblank-feedback {
    padding: 15px;
    border-radius: var(--radius);
    margin-top: 15px;
}

.fillblank-feedback.correct {
    background: #e8f5e9;
    color: var(--success);
}

.fillblank-feedback.incorrect {
    background: #ffebee;
    color: var(--error);
}

/* ===== SENTENCE BUILDER STYLES ===== */
.builder-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.builder-start h2,
.builder-results h2 {
    color: var(--primary);
    margin-bottom: 15px;
}

.builder-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-weight: 600;
}

.sentence-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    min-height: 100px;
}

.sentence-display {
    font-size: 1.4rem;
    line-height: 1.8;
}

.sentence-part {
    color: var(--text);
}

.word-blank {
    display: inline-block;
    min-width: 100px;
    padding: 5px 15px;
    margin: 0 5px;
    background: #f5f5f5;
    border: 2px dashed var(--primary);
    border-radius: var(--radius);
    color: var(--text-light);
    font-weight: 600;
    transition: var(--transition);
}

.word-blank.drag-over {
    background: #e3f2fd;
    border-style: solid;
}

.word-blank.filled {
    background: var(--secondary);
    border-style: solid;
    border-color: var(--secondary);
    color: #333;
}

.word-blank.correct {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.word-blank.incorrect {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

.word-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.draggable-word {
    padding: 10px 20px;
    background: var(--card-bg);
    border: 2px solid #ddd;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    user-select: none;
}

.draggable-word:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.draggable-word.selected {
    background: var(--secondary);
    border-color: var(--secondary);
    transform: scale(1.05);
}

.draggable-word.dragging {
    opacity: 0.5;
}

.draggable-word.correct-word {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.draggable-word.incorrect-word {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

.builder-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

.hint-btn, .skip-btn {
    padding: 10px 20px;
    border: 2px solid #ddd;
    border-radius: var(--radius);
    background: var(--card-bg);
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition);
}

.hint-btn:hover {
    border-color: var(--secondary);
    background: #fff8e1;
}

.skip-btn:hover {
    border-color: var(--text-light);
}

.hint-text {
    color: var(--secondary);
    font-style: italic;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.builder-feedback {
    padding: 15px;
    border-radius: var(--radius);
    font-weight: 600;
}

.builder-feedback.correct {
    background: #e8f5e9;
    color: var(--success);
}

.builder-feedback.incorrect {
    background: #ffebee;
    color: var(--error);
}

/* Results Score Styling (shared) */
.results-score {
    margin: 25px 0;
}

.big-score {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary);
}

.score-label {
    display: block;
    font-size: 1.2rem;
    color: var(--text-light);
}
