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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 500px;
    width: 100%;
    padding: 2rem;
}

.page {
    display: none;
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: all 0.3s ease;
}

.page.active {
    display: block;
}

.page.feedback-correct {
    background-color: #dcfce7;
    border: 2px solid #16a34a;
}

.page.feedback-incorrect {
    background-color: #fef2f2;
    border: 2px solid #dc2626;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #2563eb;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #2563eb;
    font-weight: 600;
}

.selection-container {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.dropdown-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dropdown-group label {
    font-weight: 600;
    color: #374151;
    font-size: 1.1rem;
}

select {
    padding: 0.75rem 1rem;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 1.1rem;
    background-color: white;
    color: #374151;
    cursor: pointer;
    transition: border-color 0.2s;
}

select:focus {
    outline: none;
    border-color: #2563eb;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin: 0.5rem;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin: 0.5rem;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.timer, .progress {
    font-weight: 600;
    color: #374151;
    font-size: 1.1rem;
}

.quiz-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.problem {
    font-size: 3rem;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 1rem;
}

#answer-input {
    width: 200px;
    padding: 1rem;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 1.5rem;
    text-align: center;
    font-weight: 600;
}

#answer-input:focus {
    outline: none;
    border-color: #2563eb;
}

.summary-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #f8fafc;
    border-radius: 8px;
    font-size: 1.2rem;
}

.stat-label {
    font-weight: 600;
    color: #374151;
}

.performance-message {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 2rem;
    padding: 1rem;
    border-radius: 8px;
}

.performance-message.success {
    background-color: #dcfce7;
    color: #16a34a;
}

.performance-message.needs-improvement {
    background-color: #fef3c7;
    color: #d97706;
}

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }
    
    .page {
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .selection-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .quiz-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .problem {
        font-size: 2.5rem;
    }
    
    #answer-input {
        width: 100%;
        max-width: 250px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
    }
}