/* Color Variables */
:root {
    --primary: #4361ee;
    --primary-dark: #3a0ca3;
    --secondary: #4895ef;
    --accent: #4cc9f0;
    --light: #f8f9fa;
    --dark: #212529;
    --success: #2ecc71;
    --danger: #e74c3c;
    --warning: #f39c12;
}

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

body {
    background-color: #f0f2f5;
    color: var(--dark);
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    animation: fadeIn 0.5s ease;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.description {
    color: #666;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* Level Selection */
.level-selection {
    text-align: center;
    display: none;
}

.level-selection.active {
    display: block;
}

.level-selection h2 {
    margin-bottom: 30px;
    color: var(--primary-dark);
}

.level-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.level-btn {
    padding: 15px;
    border: none;
    border-radius: 8px;
    background-color: var(--primary);
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.level-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* Quiz Area */
.quiz-area, .results {
    display: none;
}

.quiz-area.active, .results.active {
    display: block;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.question-container {
    margin: 30px 0;
}

#questionText {
    margin-bottom: 25px;
    font-size: 1.3rem;
    color: var(--dark);
}

.options-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.option-btn {
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background-color: white;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.option-btn.selected {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.option-btn.correct {
    background-color: var(--success);
    color: white;
    border-color: var(--success);
}

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

.next-btn {
    display: block;
    width: 100%;
    padding: 15px;
    margin-top: 20px;
    background-color: var(--secondary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

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

.next-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.button-container {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    gap: 10px;
}

.back-btn {
    padding: 10px 20px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.back-btn:hover {
    background-color: #5a6268;
}

/* Results Area */
.results {
    text-align: center;
}

.result-details {
    margin: 30px 0;
}

#finalScore {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--primary-dark);
}

#performanceComment {
    font-size: 1.2rem;
    color: #555;
}

.restart-btn {
    padding: 12px 25px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.restart-btn:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
}

/* Footer */
footer {
    text-align: center;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 600px) {
    .level-buttons {
        grid-template-columns: 1fr;
    }
    
    .quiz-header {
        flex-direction: column;
        gap: 10px;
    }
}