/* Base Styles */
:root {
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --secondary-color: #4f46e5;
    --text-color: #1f2937;
    --light-text-color: #6b7280;
    --background-color: #f3f4f6;
    --card-color: #fff;
    --success-color: #34d399;
    --error-color: #ef4444;
    --neutral-color: #f59e0b;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 12px;
    --progress-width: 10%;
    --gradient-bg: linear-gradient(135deg, #6366f1, #4f46e5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(129, 140, 248, 0.1), transparent 40%),
                radial-gradient(circle at bottom left, rgba(99, 102, 241, 0.1), transparent 40%);
    z-index: -1;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    background: var(--gradient-bg);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
    font-size: 1.8rem;
}

h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeInDown 1s ease-in-out;
}

header p {
    color: var(--light-text-color);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Main Content */
main {
    flex: 1;
    animation: fadeIn 1s ease-in-out;
}

section {
    background-color: var(--card-color);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient-bg);
}

section:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Progress Bar */
#progress-container {
    margin-bottom: 2rem;
}

#progress-bar {
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 9999px;
    margin-bottom: 0.8rem;
    overflow: hidden;
    position: relative;
}

#progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--progress-width);
    background: var(--gradient-bg);
    border-radius: 9999px;
    transition: width 0.5s ease-in-out;
    animation: pulse 2s infinite;
}

#progress-text {
    text-align: right;
    font-size: 0.9rem;
    color: var(--light-text-color);
    font-weight: 500;
}

/* Question Container */
#question-container {
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease-in-out;
}

#question-text {
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

#question-context {
    background-color: rgba(99, 102, 241, 0.08);
    border-left: 4px solid var(--primary-color);
    padding: 1.2rem;
    margin-bottom: 2rem;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-style: italic;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#question-context:hover {
    transform: translateX(5px);
}

/* Options */
#options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.option {
    display: flex;
    align-items: center;
    padding: 1.2rem;
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background-color: rgba(99, 102, 241, 0.05);
    transition: width 0.3s ease;
    z-index: 0;
}

.option:hover {
    border-color: var(--primary-light);
    transform: translateX(5px);
}

.option:hover::before {
    width: 100%;
}

.option.selected {
    border-color: var(--primary-color);
    background-color: rgba(99, 102, 241, 0.08);
    transform: scale(1.02);
}

.option input[type="radio"] {
    margin-right: 1rem;
    accent-color: var(--primary-color);
    z-index: 1;
    transform: scale(1.2);
}

.option label {
    z-index: 1;
    flex: 1;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.primary-btn {
    background: var(--gradient-bg);
    color: white;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.25);
}

.primary-btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: -100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.7s ease;
}

.primary-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    transform: translateY(-3px);
    box-shadow: 0 10px 15px rgba(99, 102, 241, 0.3);
}

.primary-btn:hover::after {
    left: 100%;
}

.primary-btn:active {
    transform: translateY(-1px);
}

.primary-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

#submit-btn, #next-btn, #restart-btn {
    width: 100%;
    margin-top: 1.5rem;
    letter-spacing: 0.025em;
}

/* Feedback Section */
#feedback-container {
    margin-bottom: 2rem;
}

#correct-answer-container,
#correct-explanation-container,
#wrong-explanation-container {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

#correct-answer-container {
    background-color: rgba(52, 211, 153, 0.08);
    border-left: 4px solid var(--success-color);
    animation: slideInRight 0.5s ease-out, fadeIn 0.5s ease-out;
}

#correct-explanation-container {
    background-color: rgba(245, 158, 11, 0.08);
    border-left: 4px solid var(--neutral-color);
    animation: slideInRight 0.7s ease-out, fadeIn 0.7s ease-out;
}

#wrong-explanation-container {
    background-color: rgba(239, 68, 68, 0.08);
    border-left: 4px solid var(--error-color);
    animation: slideInRight 0.9s ease-out, fadeIn 0.9s ease-out;
}

#correct-answer-container:hover,
#correct-explanation-container:hover,
#wrong-explanation-container:hover {
    transform: translateX(5px);
}

/* Completion Section */
#score-container {
    text-align: center;
    margin: 3rem 0;
    animation: bounce 1s ease;
}

#final-score {
    font-size: 3.5rem;
    font-weight: 800;
    background: var(--gradient-bg);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    margin: 1rem 0;
    position: relative;
}

#final-score::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 4px;
    background: var(--gradient-bg);
    border-radius: 2px;
}

/* Footer */
footer {
    text-align: center;
    margin-top: auto;
    padding: 1.5rem 0;
    color: var(--light-text-color);
    position: relative;
    z-index: 10;
}

footer a {
    font-weight: 500;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Transitions for section changes */
.hidden {
    display: none;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }
    
    section {
        padding: 1.8rem;
    }
    
    h1 {
        font-size: 2.4rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }
    
    .option {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.8rem 1.5rem;
    }
    
    section {
        padding: 1.5rem;
    }
    
    #final-score {
        font-size: 2.8rem;
    }
} 