:root {
    /* Color Palette - Modern & Professional */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #ec4899;
    --bg-dark: #0f172a;
    --bg-light: #f8fafc;
    --text-dark: #f1f5f9;
    --text-light: #1e293b;
    --glass-bg-dark: rgba(30, 41, 59, 0.7);
    --glass-bg-light: rgba(255, 255, 255, 0.7);
    --glass-border-dark: rgba(255, 255, 255, 0.1);
    --glass-border-light: rgba(0, 0, 0, 0.1);
    --correct: #22c55e;
    --incorrect: #ef4444;
    --warning: #f59e0b;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg: var(--bg-dark);
    --text: var(--text-dark);
    --glass-bg: var(--glass-bg-dark);
    --glass-border: var(--glass-border-dark);
    --blob-1: #4338ca;
    --blob-2: #86198f;
    --blob-3: #1e3a8a;
}

[data-theme="light"] {
    --bg: var(--bg-light);
    --text: var(--text-light);
    --glass-bg: var(--glass-bg-light);
    --glass-border: var(--glass-border-light);
    --blob-1: #c7d2fe;
    --blob-2: #fbcfe8;
    --blob-3: #dbeafe;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    transition: background-color 0.5s ease;
}

/* Animated Background Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    filter: blur(80px);
}

.blob {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    opacity: 0.5;
    animation: move 20s infinite alternate;
}

.blob-1 { top: -10%; left: -10%; background: var(--blob-1); }
.blob-2 { bottom: -10%; right: -10%; background: var(--blob-2); animation-delay: -5s; }
.blob-3 { top: 40%; left: 30%; background: var(--blob-3); animation-delay: -10s; }

@keyframes move {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(100px, 50px) scale(1.2); }
}

/* Screen Transitions */
.screen {
    display: none;
    width: 100%;
    max-width: 600px;
    padding: 20px;
    animation: fadeIn 0.5s ease-out;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Glassmorphism Components */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    width: 100%;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon { font-size: 2rem; }
h1 { font-size: 1.5rem; font-weight: 800; }

/* Dashboard Styles */
.stats-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 16px;
    text-align: center;
}

.stat-label { font-size: 0.8rem; opacity: 0.7; display: block; margin-bottom: 4px; }
.stat-value { font-size: 1.5rem; font-weight: 700; }

.setup-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 32px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label { font-size: 0.9rem; font-weight: 600; }

.glass-select {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px;
    color: var(--text);
    font-size: 1rem;
    outline: none;
    cursor: pointer;
}

/* Buttons */
button {
    cursor: pointer;
    border: none;
    outline: none;
    font-weight: 600;
    transition: var(--transition);
}

.primary-btn {
    background: var(--primary);
    color: white;
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    font-size: 1.1rem;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.23);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    padding: 12px 24px;
    border-radius: 12px;
}

.secondary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Quiz UI */
.quiz-header {
    margin-bottom: 24px;
}

.progress-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.progress-bar-container {
    background: rgba(255, 255, 255, 0.1);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    background: var(--primary);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

.timer {
    font-size: 1.2rem;
    font-weight: 800;
    text-align: right;
    color: var(--secondary);
}

.question-section h2 {
    font-size: 1.3rem;
    margin-bottom: 24px;
    line-height: 1.4;
}

.options-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 32px;
}

.option-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--glass-border);
    padding: 16px;
    border-radius: 12px;
    text-align: left;
    color: var(--text);
    font-size: 1rem;
}

.option-btn:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.option-btn.correct {
    background: rgba(34, 197, 94, 0.2);
    border-color: var(--correct);
}

.option-btn.incorrect {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--incorrect);
}

.quiz-footer {
    display: flex;
    justify-content: space-between;
}

/* Results Screen */
.results-card {
    text-align: center;
}

.result-icon { font-size: 4rem; display: block; margin-bottom: 16px; }

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 8px solid var(--primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 24px auto;
}

#final-score { font-size: 3rem; font-weight: 800; }

.results-stats {
    display: flex;
    justify-content: space-around;
    margin: 32px 0;
}

.res-stat { display: flex; flex-direction: column; }
.res-label { font-size: 0.8rem; opacity: 0.7; }
.res-value { font-size: 1.2rem; font-weight: 700; }

.results-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Review Screen */
.review-list {
    margin-top: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.review-item {
    padding: 16px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 12px;
}

.review-item h3 { font-size: 1rem; margin-bottom: 8px; }
.review-item p { font-size: 0.9rem; margin-bottom: 4px; }
.status-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
}

/* Responsive Design */
@media (max-width: 480px) {
    .glass-card { padding: 24px; }
    h1 { font-size: 1.2rem; }
    .score-circle { width: 120px; height: 120px; }
}
