/* --- Root Variables for Easy Theming --- */
:root {
    --primary-color: #4a00e0;
    --secondary-color: #8e2de2;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --text-color: #333;
    --text-light: #fdfdfd;
    --bg-light: #ffffff;
    --font-family: 'Poppins', sans-serif;
}

/* --- Base & Body Styling --- */
body {
    font-family: var(--font-family);
    color: var(--text-color);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    background-attachment: fixed;
    box-sizing: border-box;
}

/* --- Glassmorphism Container --- */
.container {
    width: 100%;
    max-width: 900px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 40px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    color: var(--text-light);
}

/* --- Screen Transitions --- */
.screen {
    display: none;
    animation: fadeIn 0.6s ease-in-out;
}
.screen.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Typography --- */
.title {
    font-size: 2.5em;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.subtitle, #quiz-user-greeting {
    text-align: center;
    font-size: 1.2em;
    opacity: 0.9;
    margin-bottom: 30px;
}

/* --- Buttons & Inputs --- */
.btn {
    display: block;
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-light);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}
.btn-primary { background: linear-gradient(135deg, var(--secondary-color), var(--primary-color)); }
.btn-secondary { background-color: #6c757d; }
.btn-success { background-color: var(--success-color); }
.btn-danger { background-color: var(--danger-color); }

.input-field {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    font-size: 1.1em;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-light);
}
.input-field::placeholder { color: rgba(255, 255, 255, 0.7); }
.input-field:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* --- Quiz Form Styling --- */
#quiz-form {
    margin-top: 20px;
}
.question-item {
    margin-bottom: 35px;
    padding: 25px;
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.1);
    transition: background 0.3s ease;
}
.question-item p {
    font-weight: 600;
    font-size: 1.3em;
    margin: 0 0 20px 0;
}
.option {
    display: block;
    margin-bottom: 12px;
    padding: 15px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: background 0.2s ease;
    border: 2px solid transparent;
}
.option:hover {
    background: rgba(0, 0, 0, 0.25);
}
.option input[type="radio"] {
    margin-right: 15px;
    transform: scale(1.3);
    accent-color: var(--primary-color);
}
/* Style for the selected option */
input[type="radio"]:checked + label {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

/* --- Results Screen Styling --- */
#score-display {
    font-size: 1.8em;
    font-weight: 700;
    text-align: center;
    margin: 20px 0 40px;
}
.incorrect-question {
    margin-bottom: 25px;
    padding: 20px;
    border-radius: 10px;
    background-color: rgba(0,0,0,0.2);
}
.incorrect-question p { margin: 8px 0; }
.user-answer { color: #ff8a80; /* Light Red */ }
.correct-answer { color: #b9f6ca; /* Light Green */ }

.results-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

/* --- Responsive & Print --- */
@media (max-width: 768px) {
    body { padding: 10px; }
    .container { padding: 20px; }
    .title { font-size: 2em; }
    .results-actions { flex-direction: column; }
}

@media print {
    body {
        background: none;
        color: #000;
        padding: 0;
    }
    .container {
        box-shadow: none;
        border: none;
        padding: 0;
        backdrop-filter: none;
        background: none;
        color: #000;
    }
    .results-actions, .quiz-header, #submit-btn {
        display: none;
    }
    .incorrect-question {
        background-color: #f3f3f3;
        page-break-inside: avoid;
    }
    .user-answer { color: #D32F2F !important; }
    .correct-answer { color: #388E3C !important; }
}
