:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #334155;
    --secondary-hover: #475569;
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --success: #22c55e;
    --error: #ef4444;
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-color);
    background-image: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15), transparent 40%),
                      radial-gradient(circle at bottom left, rgba(168, 85, 247, 0.15), transparent 40%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-container {
    width: 100%;
    max-width: 1000px;
    padding: 20px;
    margin: 0 auto;
}

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

h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
}

#progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--secondary);
    border-radius: 3px;
    overflow: hidden;
}

#progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.4s ease-out;
}

.hidden {
    display: none !important;
}

/* Start Screen */
.stats {
    display: flex;
    gap: 20px;
    margin: 25px 0;
}

.stat-box {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Buttons */
button {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

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

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

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--secondary-hover);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Test Screen */
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.badge {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

h3 {
    font-size: 1.3rem;
    line-height: 1.6;
    margin-bottom: 30px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.option-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    text-align: left;
    padding: 22px 25px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
}

.option-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.option-letter {
    background: rgba(255, 255, 255, 0.1);
    width: 30px;
    height: 30px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    margin-right: 15px;
    font-weight: 600;
    font-size: 0.9rem;
}

.option-btn.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.option-btn.correct {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}
.option-btn.correct .option-letter {
    background: var(--success);
}

.option-btn.wrong {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}
.option-btn.wrong .option-letter {
    background: var(--error);
}

@keyframes blinkCorrect {
    0% { background: rgba(34, 197, 94, 0.2); border-color: var(--success); }
    50% { background: rgba(34, 197, 94, 0.8); border-color: #fff; }
    100% { background: rgba(34, 197, 94, 0.2); border-color: var(--success); }
}

.option-btn.correct-blink {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.2);
    animation: blinkCorrect 0.5s ease-in-out 3;
}
.option-btn.correct-blink .option-letter {
    background: var(--success);
}

/* Results Screen */
.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--card-bg) 60%, transparent 61%), conic-gradient(var(--primary) 0%, var(--secondary) 0%);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px auto;
    font-size: 2rem;
    font-weight: 700;
}

#score-message {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-muted);
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
}

.review-list::-webkit-scrollbar {
    width: 6px;
}
.review-list::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 3px;
}

.review-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid var(--error);
}

.review-item h4 {
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.review-item p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.correct-ans {
    color: var(--success);
    font-weight: 600;
}

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

/* Responsive queries */
@media (max-width: 768px) {
    .app-container {
        padding: 15px;
    }
    h3 {
        font-size: 1.1rem;
    }
    .option-btn {
        padding: 12px 15px;
    }
}
