:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --correct-color: #2ecc71;
    --incorrect-color: #e74c3c;
    --text-color: #333;
    --light-gray: #f5f5f5;
    --medium-gray: #ddd;
    --dark-gray: #777;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f9f9f9;
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
}

.screen {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hidden {
    display: none !important;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group select, .form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--medium-gray);
    border-radius: 5px;
    font-size: 1rem;
}

.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s;
    align-self: center;
}

.btn:hover {
    background-color: var(--secondary-color);
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-weight: 600;
}

#question-text {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.option-btn {
    background-color: var(--light-gray);
    border: 1px solid var(--medium-gray);
    border-radius: 5px;
    padding: 12px;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s;
}

.option-btn:hover {
    background-color: var(--medium-gray);
}

.option-btn.correct {
    background-color: var(--correct-color);
    color: white;
}

.option-btn.incorrect {
    background-color: var(--incorrect-color);
    color: white;
}

#results-screen {
    text-align: center;
}

#score-display, #time-display {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

#score, #max-score, #time-taken {
    font-weight: 600;
    color: var(--primary-color);
}

#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--medium-gray);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#question-results {
    margin-top: 30px;
    text-align: left;
    width: 100%;
}

#results-container {
    margin-top: 15px;
}

.result-item {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
    background-color: var(--light-gray);
}

.result-item.correct {
    border-left: 5px solid var(--correct-color);
}

.result-item.incorrect {
    border-left: 5px solid var(--incorrect-color);
}

.result-question {
    font-weight: 600;
    margin-bottom: 8px;
}

.result-answer {
    margin-top: 8px;
    font-style: italic;
}

.result-explanation {
    margin-top: 8px;
    padding: 8px;
    background-color: white;
    border-radius: 3px;
}

.form-group input[type="number"] {
    width: 80px;
}