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

:root {
    --primary-color: #22cc44;
    --danger-color: #ff4444;
    --info-color: #3498db;
    --warning-color: #f39c12;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --text-dark: #34495e;
    --text-light: #7f8c8d;
    --border-color: #bdc3c7;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
    
    /* Light mode colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-body: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --text-primary: #34495e;
    --text-secondary: #7f8c8d;
    --border-light: #bdc3c7;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1e1e1e;
        --bg-secondary: #2a2a2a;
        --bg-body: linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 100%);
        --text-primary: #e0e0e0;
        --text-secondary: #a0a0a0;
        --border-light: #404040;
        --light-color: #2a2a2a;
        --text-dark: #e0e0e0;
        --text-light: #a0a0a0;
        --border-color: #404040;
        --dark-color: #0f0f0f;
    }
}

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

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

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    background: var(--bg-primary);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.header h1 {
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 700;
}

.header-stats {
    font-size: 1.1em;
    color: var(--text-light);
}

.question-counter {
    background: var(--info-color);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
    font-weight: 600;
}

/* Progress Bar */
.progress-section {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--bg-primary);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

.progress-text {
    text-align: center;
    margin-top: 10px;
    font-size: 0.9em;
    color: var(--text-light);
    font-weight: 600;
}

#progressPercent {
    color: var(--primary-color);
    font-weight: 700;
}

/* Quiz Container */
.quiz-container {
    background: var(--bg-primary);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
}

/* Question Card */
.question-card {
    margin-bottom: 30px;
}

.question-text {
    font-size: 1.4em;
    color: var(--text-primary);
    margin-bottom: 30px;
    line-height: 1.8;
    font-weight: 600;
}

/* Options Container */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.option-group {
    display: flex;
}

.option-btn {
    flex: 1;
    padding: 18px 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.05em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
}

.option-btn:hover:not(.disabled) {
    border-color: var(--info-color);
    background: rgba(52, 152, 219, 0.05);
    transform: translateX(5px);
}

.option-btn.selected {
    border-color: var(--info-color);
    background: rgba(52, 152, 219, 0.1);
    font-weight: 600;
}

.option-btn.correct {
    border-color: #22cc44;
    background: rgba(34, 204, 68, 0.15);
    color: #22cc44;
    box-shadow: 0 0 15px rgba(34, 204, 68, 0.4), inset 0 0 10px rgba(34, 204, 68, 0.1);
    animation: correctGlow 0.6s ease;
}

.option-btn.incorrect {
    border-color: #ff4444;
    background: rgba(255, 68, 68, 0.15);
    color: #ff4444;
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.4);
    animation: incorrectShake 0.5s ease;
}

@keyframes correctGlow {
    0% {
        box-shadow: 0 0 0 rgba(34, 204, 68, 0.4), inset 0 0 0 rgba(34, 204, 68, 0.1);
    }
    50% {
        box-shadow: 0 0 20px rgba(34, 204, 68, 0.6), inset 0 0 15px rgba(34, 204, 68, 0.2);
    }
    100% {
        box-shadow: 0 0 15px rgba(34, 204, 68, 0.4), inset 0 0 10px rgba(34, 204, 68, 0.1);
    }
}

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

.option-btn.disabled {
    cursor: not-allowed;
    opacity: 0.5;
    pointer-events: none;
}

.option-btn.disabled:not(.correct):not(.incorrect) {
    animation: fadeOut 0.4s ease forwards;
}

.option-letter {
    font-weight: 700;
    color: white;
    background: var(--info-color);
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1em;
}

.option-btn.selected .option-letter {
    background: var(--info-color);
}

.option-btn.correct .option-letter {
    background: var(--primary-color);
}

.option-btn.incorrect .option-letter {
    background: var(--danger-color);
}

.option-text {
    flex: 1;
    word-break: break-word;
}

/* Feedback Area */
.feedback-area {
    background: var(--bg-secondary);
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    display: none;
}

.feedback-area.hidden {
    display: none;
}

.feedback-area.show {
    display: block;
    animation: slideIn 0.3s ease;
}

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

#feedbackContent {
    font-size: 1.05em;
    line-height: 1.8;
    color: var(--text-primary);
}

.feedback-area.hidden {
    display: none;
}

.feedback-area.show {
    display: block;
    animation: slideIn 0.3s ease;
}

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

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0.5;
        transform: scale(0.95);
    }
}

#feedbackContent {
    font-size: 1.05em;
    line-height: 1.8;
    color: var(--text-dark);
}

.feedback-label {
    font-weight: 700;
    color: #22cc44;
    margin-bottom: 15px;
    display: block;
    font-size: 1.2em;
}

.feedback-explanation {
    color: #0084ff;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    font-style: italic;
}

.feedback-wrong {
    color: #ff4444;
    font-weight: 700;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.feedback-area.show {
    border-left-color: #22cc44;
}

.feedback-area:has(.feedback-wrong) {
    border-left-color: #ff4444;
}

/* Navigation Section */
.navigation-section {
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
    margin-top: 30px;
    color: var(--text-primary);
}

.nav-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.nav-btn {
    flex: 1;
    padding: 14px 24px;
    font-size: 1.05em;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-btn-prev {
    background: var(--border-color);
    color: var(--text-primary);
}

.nav-btn-prev:hover:not(:disabled) {
    background: var(--text-light);
    color: var(--bg-primary);
    transform: translateX(-5px);
}

.nav-btn-next {
    background: var(--info-color);
    color: white;
}

.nav-btn-next:hover:not(:disabled) {
    background: #2980b9;
    transform: translateX(5px);
}

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

.quick-jump {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.quick-jump label {
    font-weight: 600;
    color: var(--text-primary);
}

.quick-jump input {
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1em;
    width: 150px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.quick-jump input:focus {
    outline: none;
    border-color: var(--info-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.jump-btn {
    padding: 10px 20px;
    background: var(--warning-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.jump-btn:hover {
    background: #e67e22;
    transform: scale(1.05);
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: white;
    font-size: 0.9em;
}

.footer p {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.8em;
    }

    .quiz-container {
        padding: 20px;
    }

    .question-text {
        font-size: 1.2em;
    }

    .option-btn {
        padding: 15px;
        font-size: 1em;
    }

    .option-letter {
        width: 35px;
        height: 35px;
        font-size: 0.9em;
    }

    .nav-buttons {
        flex-direction: column;
    }

    .quick-jump {
        flex-direction: column;
        align-items: stretch;
    }

    .quick-jump input {
        width: 100%;
    }

    .nav-btn {
        width: 100%;
    }
}

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

.show {
    display: block !important;
}
