/* Rezi - Medical Residency Exam Prep Platform */
/* Light theme, study-focused design */

:root {
    --bg: #f8f9fa;
    --card: #ffffff;
    --text: #1a1a2e;
    --text-light: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --primary: #2563eb;
    --primary-light: #dbeafe;
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --kumar: #2563eb;
    --kumar-bg: #eff6ff;
    --lawrence: #10b981;
    --lawrence-bg: #ecfdf5;
    --sinopsis: #f59e0b;
    --sinopsis-bg: #fffbeb;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Navbar --- */
.navbar {
    position: sticky;
    top: 0;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-light);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-logout {
    color: var(--danger) !important;
}

.nav-logout:hover {
    background: var(--danger-light) !important;
    color: var(--danger) !important;
}

.exam-countdown {
    background: var(--warning-light);
    color: #92400e;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
    width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Cards --- */
.card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 24px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

/* --- Page Titles --- */
.page-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.page-subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

/* --- Dashboard --- */
.dashboard-welcome {
    margin-bottom: 32px;
}

.dashboard-welcome h1 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2rem;
    margin-bottom: 4px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 4px;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.book-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 24px;
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    display: block;
}

.book-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.book-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.3rem;
    color: white;
    margin-bottom: 16px;
}

.book-card h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.book-card .book-meta {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 12px;
}

/* --- Progress Bar --- */
.progress-bar {
    background: var(--border-light);
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
    background: linear-gradient(90deg, var(--primary), #60a5fa);
}

.progress-fill.green {
    background: linear-gradient(90deg, var(--success), #6ee7b7);
}

.progress-fill.orange {
    background: linear-gradient(90deg, var(--warning), #fcd34d);
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 6px;
}

/* --- Chapter List --- */
.chapter-grid {
    display: grid;
    gap: 12px;
}

.chapter-item {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
}

.chapter-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.chapter-num {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
    flex-shrink: 0;
}

.chapter-info {
    flex: 1;
    min-width: 0;
}

.chapter-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chapter-info .chapter-meta {
    font-size: 0.8rem;
    color: var(--text-light);
}

.chapter-badges {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-read {
    background: var(--success-light);
    color: #065f46;
}

.badge-unread {
    background: var(--border-light);
    color: var(--text-muted);
}

.badge-score {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-score.low {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-score.mid {
    background: var(--warning-light);
    color: #92400e;
}

/* --- Reading View --- */
.reading-view {
    max-width: 800px;
    margin: 0 auto;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-sep {
    color: var(--text-muted);
}

.reading-header {
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.reading-header h1 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.75rem;
    line-height: 1.3;
    margin-bottom: 8px;
}

.reading-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-light);
    flex-wrap: wrap;
}

.reading-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.reading-content {
    font-size: 17px;
    line-height: 1.8;
    color: #333;
}

.reading-content h2 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.4rem;
    margin: 32px 0 16px;
    color: var(--text);
}

.reading-content h3 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.2rem;
    margin: 24px 0 12px;
    color: var(--text);
}

.reading-content p {
    margin-bottom: 16px;
}

.reading-content ul, .reading-content ol {
    margin: 12px 0 16px 24px;
}

.reading-content li {
    margin-bottom: 6px;
}

.reading-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.reading-content th, .reading-content td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
    font-size: 0.9rem;
}

.reading-content th {
    background: var(--bg);
    font-weight: 600;
}

.reading-actions {
    display: flex;
    gap: 12px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.chapter-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    gap: 12px;
}

.chapter-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    font-size: 0.9rem;
    transition: var(--transition);
    max-width: 45%;
}

.chapter-nav a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.chapter-nav .nav-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

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

.btn-primary:hover {
    background: #1d4ed8;
}

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

.btn-success:hover {
    background: #059669;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

.btn-sm {
    padding: 6px 16px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* --- Quiz --- */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.quiz-header {
    margin-bottom: 32px;
}

.quiz-progress-bar {
    background: var(--border-light);
    border-radius: 10px;
    height: 6px;
    margin-top: 12px;
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.question-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.question-number {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.question-text {
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.6;
    margin-bottom: 20px;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    background: var(--card);
}

.option-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.option-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.option-card.correct {
    border-color: var(--success);
    background: var(--success-light);
}

.option-card.wrong {
    border-color: var(--danger);
    background: var(--danger-light);
}

.option-card.disabled {
    cursor: default;
    pointer-events: none;
}

.option-letter {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    color: var(--text-light);
}

.option-card.selected .option-letter {
    background: var(--primary);
    color: white;
}

.option-card.correct .option-letter {
    background: var(--success);
    color: white;
}

.option-card.wrong .option-letter {
    background: var(--danger);
    color: white;
}

.option-text {
    flex: 1;
    font-size: 0.95rem;
    padding-top: 4px;
}

.explanation {
    margin-top: 12px;
    padding: 12px 16px;
    background: #f0f9ff;
    border-left: 3px solid var(--primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.9rem;
    color: #1e40af;
    display: none;
}

.explanation.show {
    display: block;
}

/* --- Quiz Results --- */
.quiz-results {
    text-align: center;
    padding: 40px 24px;
}

.score-circle {
    width: 160px;
    height: 160px;
    margin: 0 auto 24px;
    position: relative;
}

.score-circle svg {
    width: 160px;
    height: 160px;
    transform: rotate(-90deg);
}

.score-circle .circle-bg {
    fill: none;
    stroke: var(--border-light);
    stroke-width: 10;
}

.score-circle .circle-fill {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.score-circle .circle-fill.good {
    stroke: var(--success);
}

.score-circle .circle-fill.ok {
    stroke: var(--warning);
}

.score-circle .circle-fill.bad {
    stroke: var(--danger);
}

.score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: 700;
}

.score-value small {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-light);
}

.results-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 24px 0 32px;
}

.result-stat {
    text-align: center;
}

.result-stat .stat-num {
    font-size: 1.75rem;
    font-weight: 700;
}

.result-stat .stat-num.green {
    color: var(--success);
}

.result-stat .stat-num.red {
    color: var(--danger);
}

.result-stat .stat-lbl {
    font-size: 0.85rem;
    color: var(--text-light);
}

.wrong-answers-review {
    text-align: left;
    margin-top: 32px;
}

.wrong-answers-review h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--danger);
}

.wrong-answer-item {
    background: var(--card);
    border: 1px solid var(--danger-light);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
}

.wrong-answer-item .wa-question {
    font-weight: 500;
    margin-bottom: 8px;
}

.wrong-answer-item .wa-your {
    color: var(--danger);
    font-size: 0.9rem;
}

.wrong-answer-item .wa-correct {
    color: var(--success);
    font-size: 0.9rem;
    font-weight: 600;
}

/* --- Progress Page --- */
.progress-section {
    margin-bottom: 32px;
}

.progress-section h2 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.3rem;
    margin-bottom: 16px;
}

.progress-chapter-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-chapter-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.progress-chapter-item .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.read {
    background: var(--success);
}

.status-dot.unread {
    background: var(--border);
}

.progress-chapter-item .ch-title {
    flex: 1;
}

.progress-chapter-item .ch-score {
    font-weight: 600;
    font-size: 0.85rem;
}

/* CSS-only bar chart */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 120px;
    padding: 0 8px;
}

.bar-chart .bar {
    flex: 1;
    border-radius: 4px 4px 0 0;
    min-width: 20px;
    position: relative;
    transition: height 0.5s ease;
}

.bar-chart .bar .bar-label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* --- Login Page --- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 20px;
}

.login-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-logo {
    width: 64px;
    height: 64px;
    background: var(--primary);
    color: white;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.8rem;
    margin: 0 auto 20px;
}

.login-card h1 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.login-card .login-subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 6px;
    color: var(--text);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--card);
    color: var(--text);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.login-error {
    background: var(--danger-light);
    color: var(--danger);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* --- Flash Messages --- */
.flash {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9rem;
    font-weight: 500;
}

.flash-success {
    background: var(--success-light);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.flash-error {
    background: var(--danger-light);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.flash-info {
    background: var(--primary-light);
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* --- Activity List --- */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.activity-icon.read-icon {
    background: var(--primary-light);
    color: var(--primary);
}

.activity-icon.quiz-icon {
    background: var(--success-light);
    color: var(--success);
}

.activity-info {
    flex: 1;
}

.activity-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- Streak --- */
.streak-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.streak-fire {
    font-size: 2rem;
}

.streak-info .streak-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: #92400e;
}

.streak-info .streak-label {
    font-size: 0.85rem;
    color: #92400e;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-light);
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 16px;
}

/* --- Footer --- */
.footer {
    text-align: center;
    padding: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

/* --- Two Column Layout --- */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--card);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        padding: 16px;
        gap: 4px;
    }

    .nav-menu.open {
        display: flex;
    }

    .nav-menu a {
        padding: 12px 16px;
    }

    .nav-exam-badge {
        padding: 8px 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .books-grid {
        grid-template-columns: 1fr;
    }

    .two-col {
        grid-template-columns: 1fr;
    }

    .dashboard-welcome h1 {
        font-size: 1.5rem;
    }

    .reading-header h1 {
        font-size: 1.3rem;
    }

    .results-stats {
        gap: 20px;
    }

    .chapter-item {
        flex-wrap: wrap;
    }

    .chapter-badges {
        width: 100%;
        margin-top: 4px;
    }

    .reading-actions {
        flex-direction: column;
    }

    .btn-block-mobile {
        width: 100%;
        justify-content: center;
    }

    .chapter-nav {
        flex-direction: column;
    }

    .chapter-nav a {
        max-width: 100%;
    }

    .main-content {
        padding: 16px;
    }

    .login-card {
        padding: 32px 24px;
    }

    .score-circle {
        width: 130px;
        height: 130px;
    }

    .score-circle svg {
        width: 130px;
        height: 130px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-value {
        font-size: 1.5rem;
    }
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* --- Selection --- */
::selection {
    background: var(--primary-light);
    color: var(--primary);
}

/* --- No content placeholder --- */
.no-content {
    padding: 40px;
    text-align: center;
    color: var(--text-light);
    font-style: italic;
}

/* Text to Speech button */
.tts-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #f0f7ff;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    color: #2563eb;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.tts-btn:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}
.tts-btn.playing {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.tts-btn.playing svg {
    stroke: #fff;
}
@media (max-width: 768px) {
    .tts-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

/* --- Exam Timer --- */
.exam-timer {
    position: fixed;
    top: 70px;
    right: 20px;
    background: var(--card);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 12px 20px;
    text-align: center;
    z-index: 90;
    transition: all 0.3s ease;
}

.exam-timer .timer-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.exam-timer .timer-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.exam-timer.warning {
    border-color: var(--danger);
    background: var(--danger-light);
}

.exam-timer.warning .timer-value {
    color: var(--danger);
}

/* --- Question Navigator --- */
.question-navigator {
    position: fixed;
    top: 160px;
    right: 20px;
    width: 220px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 16px;
    z-index: 80;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.question-navigator .nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.question-nav-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
}

.question-nav-item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.question-nav-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.question-nav-item.answered {
    background: var(--primary);
    color: white;
}

.question-nav-item.current {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.exam-layout {
    position: relative;
}

.exam-container {
    max-width: 760px;
    margin-right: 260px;
}

/* --- Stat Circle --- */
.stat-circle {
    position: relative;
    display: inline-block;
}

/* --- Weak / Strong Chapter Cards --- */
.weak-chapter-card {
    border-left: 4px solid var(--danger);
}

.strong-chapter-card {
    border-left: 4px solid var(--success);
}

/* --- Recommendation Card --- */
.recommendation-card {
    border-left: 4px solid var(--primary);
}

/* --- Exam Responsive --- */
@media (max-width: 1024px) {
    .exam-container {
        margin-right: 0;
        max-width: 800px;
    }

    .question-navigator {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: none;
        border-radius: var(--radius) var(--radius) 0 0;
        z-index: 95;
        padding: 12px 16px;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
    }

    .question-nav-grid {
        grid-template-columns: repeat(10, 1fr);
        gap: 3px;
        max-height: 90px;
        overflow-y: auto;
    }

    .question-nav-item {
        width: 32px;
        height: 32px;
        font-size: 0.7rem;
    }

    .exam-timer {
        top: 64px;
        right: 8px;
        padding: 8px 14px;
    }

    .exam-timer .timer-value {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .question-nav-grid {
        grid-template-columns: repeat(8, 1fr);
    }

    .question-nav-item {
        width: 28px;
        height: 28px;
        font-size: 0.65rem;
    }
}

/* Fix mobile horizontal scroll */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}
.container, .chapters-grid, .reading-view, .quiz-container {
    max-width: 100%;
    overflow-x: hidden;
}
@media (max-width: 768px) {
    .chapters-grid {
        grid-template-columns: 1fr !important;
        padding: 0 4px;
    }
    .reading-meta {
        flex-wrap: wrap;
    }
    .breadcrumb {
        font-size: 0.8rem;
        overflow-x: auto;
        white-space: nowrap;
    }
}
