/* Quiz Styles */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --error-color: #dc3545;
    --bg-light: #f8f9fa;
    --text-dark: #333;
}

html[data-theme="dark"] {
    --bg-light: #252535;
    --text-dark: #e0e0e0;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background 0.3s ease;
}

html[data-theme="dark"] body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 800px;
    width: 100%;
    padding: 40px;
    animation: slideIn 0.5s ease-out;
}

html[data-theme="dark"] .container {
    background: #1f1f2e;
    color: #e0e0e0;
}

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

/* Header */
.quiz-header {
    position: relative;
    margin-bottom: 30px;
}

.header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

html[data-theme="dark"] .back-btn {
    background: rgba(255,255,255,0.1);
    color: #8b9dff;
    border-color: rgba(255,255,255,0.2);
}

.back-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateX(-5px);
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95em;
}

html[data-theme="dark"] .theme-toggle {
    background: rgba(255,255,255,0.1);
    color: #8b9dff;
    border-color: rgba(255,255,255,0.2);
}

.theme-toggle:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: scale(1.05);
}

html[data-theme="dark"] .theme-toggle:hover {
    background: rgba(255,255,255,0.2);
}

html[data-theme="light"] .moon-icon,
html[data-theme="light"] .dark-text {
    display: none;
}

html[data-theme="dark"] .sun-icon,
html[data-theme="dark"] .light-text {
    display: none;
}

h1 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 10px;
    font-size: 2.5em;
}

html[data-theme="dark"] h1 {
    color: #8b9dff;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

html[data-theme="dark"] .subtitle {
    color: #9fb3c8;
}

/* Screens */
.start-screen, .quiz-screen, .result-screen {
    display: none;
}

.start-screen.active, .quiz-screen.active, .result-screen.active {
    display: block;
}

/* Mode Selector */
.mode-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.mode-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.mode-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.mode-card h3 {
    margin-bottom: 10px;
    font-size: 1.3em;
}

.mode-card p {
    font-size: 0.9em;
    opacity: 0.9;
}

/* Language Selector */
.language-selector {
    text-align: center;
    margin-bottom: 20px;
}

.language-btn {
    padding: 10px 20px;
    margin: 0 10px;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
}

html[data-theme="dark"] .language-btn {
    background: #2d2d44;
    color: #8b9dff;
    border-color: #8b9dff;
}

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

html[data-theme="dark"] .language-btn.active {
    background: #8b9dff;
    color: #1f1f2e;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    margin-bottom: 20px;
    overflow: hidden;
}

html[data-theme="dark"] .progress-bar {
    background: #3a3a52;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    width: 0%;
    transition: width 0.3s;
}

/* Score Display */
.score-display {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.2em;
    color: var(--primary-color);
    font-weight: bold;
}

html[data-theme="dark"] .score-display {
    color: #8b9dff;
}

/* Question Card */
.question-card {
    background: var(--bg-light);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.question-text {
    font-size: 1.3em;
    color: var(--text-dark);
    margin-bottom: 25px;
    line-height: 1.6;
}

.question-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 20px;
}

/* Options */
.options {
    display: grid;
    gap: 15px;
}

.option-btn {
    padding: 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1em;
    text-align: left;
    transition: all 0.3s;
}

html[data-theme="dark"] .option-btn {
    background: #2d2d44;
    color: #e0e0e0;
    border-color: #3a3a52;
}

.option-btn:hover:not(.correct):not(.incorrect) {
    border-color: var(--primary-color);
    background: #f0f4ff;
}

html[data-theme="dark"] .option-btn:hover:not(.correct):not(.incorrect) {
    background: #3a3a52;
    border-color: #8b9dff;
}

.option-btn.correct {
    border-color: var(--success-color);
    background: #d4edda;
    animation: pulse 0.5s;
}

html[data-theme="dark"] .option-btn.correct {
    background: #1e4620;
    color: #6dd47e;
}

.option-btn.incorrect {
    border-color: var(--error-color);
    background: #f8d7da;
    animation: shake 0.5s;
}

html[data-theme="dark"] .option-btn.incorrect {
    background: #4a1f1f;
    color: #ff8080;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Buttons */
.next-btn {
    display: block;
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2em;
    cursor: pointer;
    transition: transform 0.3s;
    font-weight: 600;
}

.next-btn:hover {
    transform: translateY(-2px);
}

.next-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.restart-btn {
    padding: 15px 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1.2em;
    cursor: pointer;
    transition: transform 0.3s;
    font-weight: 600;
}

.restart-btn:hover {
    transform: scale(1.05);
}

/* Results */
.result-card {
    text-align: center;
    padding: 40px;
}

.result-score {
    font-size: 4em;
    color: var(--primary-color);
    font-weight: bold;
    margin: 20px 0;
}

html[data-theme="dark"] .result-score {
    color: #8b9dff;
}

.result-message {
    font-size: 1.5em;
    color: var(--text-dark);
    margin-bottom: 30px;
}

/* Timer */
.timer {
    text-align: center;
    font-size: 2em;
    color: var(--error-color);
    margin-bottom: 20px;
    font-weight: bold;
}

html[data-theme="dark"] .timer {
    color: #ff8080;
}

/* Topic Selector */
.topic-selector {
    margin-bottom: 30px;
}

.topic-selector label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-dark);
}

.topic-selector select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    font-size: 1em;
    background: white;
    color: var(--text-dark);
}

html[data-theme="dark"] .topic-selector select {
    background: #2d2d44;
    color: #e0e0e0;
    border-color: #8b9dff;
}
