@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Pro Color Palette */
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.25);
    --secondary: #f1f5f9;
    --secondary-hover: #e2e8f0;
    --secondary-text: #475569;
    --success: #10b981;
    --danger: #ef4444;
    --border-light: #e2e8f0;
    --border-focus: #93c5fd;
    --radius: 16px;
    --shadow-pro: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
}

* { box-sizing: border-box; font-family: 'Inter', sans-serif; margin: 0; padding: 0; }

body { 
    background-color: var(--bg-page); 
    color: var(--text-main); 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    min-height: 100vh; 
    padding: 20px;
}

.app-container { 
    width: 100%; 
    max-width: 600px; 
    padding: 40px 30px; 
    background: var(--bg-card); 
    border-radius: var(--radius); 
    box-shadow: var(--shadow-pro); 
    min-height: 80vh; 
    display: flex; 
    flex-direction: column; 
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
}

/* Premium Gradient Accent Line at the top of the card */
.app-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), #8b5cf6);
}

/* Screen Animations */
.screen { display: none; flex-direction: column; flex-grow: 1; animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.active-screen { display: flex; }

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

/* Typography */
#start-screen, #end-screen { text-align: center; justify-content: center; }
.header-icon { font-size: 54px; margin-bottom: 15px; }
h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 8px; color: var(--text-main); }
p { font-size: 16px; color: var(--text-muted); margin-bottom: 30px; line-height: 1.5; }

/* Inputs */
input[type="text"] { 
    width: 100%; 
    padding: 16px; 
    font-size: 16px; 
    background-color: #f8fafc;
    border: 2px solid var(--border-light); 
    border-radius: 12px; 
    margin-bottom: 25px; 
    outline: none; 
    transition: all 0.2s ease; 
}
input[type="text"]:focus { 
    background-color: #fff;
    border-color: var(--primary); 
    box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Buttons */
button { 
    padding: 16px; 
    font-size: 16px; 
    font-weight: 600; 
    border: none; 
    border-radius: 12px; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    width: 100%; 
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.btn-primary { background-color: var(--primary); color: white; box-shadow: 0 4px 6px -1px var(--primary-glow); }
.btn-primary:hover { background-color: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 10px 15px -3px var(--primary-glow); }
.btn-primary:active { transform: translateY(0); }

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

.btn-success { background-color: var(--success); color: white; box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.25); }
.btn-success:hover { background-color: #059669; transform: translateY(-2px); }

/* Exam Header & Timer */
.exam-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    font-weight: 600; 
    font-size: 15px; 
    margin-bottom: 25px; 
    padding-bottom: 15px; 
    border-bottom: 1px solid var(--border-light); 
    color: var(--text-muted); 
}
#timer-display {
    background: #fee2e2;
    color: var(--danger);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-variant-numeric: tabular-nums; /* Keeps timer from jumping */
}

/* Question Area */
#question-text { font-size: 20px; font-weight: 700; margin-bottom: 24px; color: var(--text-main); line-height: 1.4; }
.options-grid { display: flex; flex-direction: column; gap: 12px; margin-bottom: 40px; }

/* Option Cards */
.option-card { 
    padding: 18px 20px; 
    font-size: 16px; 
    font-weight: 500; 
    border: 2px solid var(--border-light); 
    border-radius: 12px; 
    background-color: #fff; 
    color: var(--text-main);
    cursor: pointer; 
    text-align: left; 
    transition: all 0.2s ease; 
    justify-content: flex-start;
}
.option-card:hover { border-color: var(--border-focus); background-color: #f0fdf4; }
.option-card.selected { 
    background-color: #eff6ff; 
    border-color: var(--primary); 
    color: var(--primary-hover); 
    font-weight: 600;
}

/* Navigation */
.navigation-buttons { display: flex; gap: 12px; margin-top: auto; }

/* Leaderboard */
.leaderboard-card { 
    border: 1px solid var(--border-light); 
    border-radius: 12px; 
    padding: 20px; 
    margin-bottom: 25px; 
    background: #fff;
}
.leaderboard-card h2 { font-size: 18px; margin-bottom: 15px; text-align: left; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 8px; text-align: left; border-bottom: 1px solid var(--border-light); }
th { color: var(--text-muted); font-size: 12px; text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px; }
td { font-weight: 500; color: var(--text-main); font-size: 15px; }
tr:last-child td { border-bottom: none; }
/* --- Add this to the BOTTOM of your style.css --- */

#review-section {
    max-height: 400px;
    overflow-y: auto;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
}

#review-section h2 {
    position: sticky;
    top: -20px;
    background: #f8fafc;
    padding: 10px 0;
    margin-top: 0;
    border-bottom: 2px solid #e2e8f0;
    z-index: 10;
}

.review-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: left;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.review-card p {
    margin-bottom: 8px;
    font-size: 14px;
}

.review-card p:first-child {
    font-weight: 700;
    color: var(--text-main);
    font-size: 15px;
}

.wrong-ans {
    color: var(--danger);
    font-weight: 600;
    background: #fee2e2;
    padding: 6px 10px;
    border-radius: 6px;
}

.correct-ans {
    color: var(--success);
    font-weight: 600;
    background: #d1fae5;
    padding: 6px 10px;
    border-radius: 6px;
}

.explanation {
    color: var(--text-muted);
    font-style: italic;
    background: #f1f5f9;
    padding: 8px 10px;
    border-radius: 6px;
    border-left: 3px solid var(--primary);
}
