/* Shared site design tokens — matches user/index.php */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #a855f7;
    --accent: #06b6d4;
    --dark: #0f172a;
    --light: #f8fafc;
    --gray: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* {
    font-family: 'Hind Siliguri', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 100vh;
    color: var(--dark);
    overflow-x: hidden;
}

/* Section headings */
.section-title {
    font-weight: 700;
    color: var(--dark);
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--gray);
    font-size: 0.95rem;
    margin-bottom: 0;
}

.section-divider {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    margin: 0.8rem auto 0;
}

/* Page shell */
.page-shell {
    padding: 2.5rem 0 3.5rem;
    position: relative;
    z-index: 1;
}

/* Cards */
.exam-showcase-card {
    background: #ffffff;
    border-radius: 24px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    height: 100%;
    transition: all 0.4s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.exam-showcase-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.12);
}

.exam-showcase-header {
    padding: 1.4rem 1.5rem;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.exam-showcase-header.daily,
.exam-showcase-header.result {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.exam-showcase-header.weekly {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.exam-showcase-header h5,
.exam-showcase-header h4 {
    margin: 0;
    font-weight: 600;
    font-size: 1.05rem;
}

.exam-showcase-header .exam-type-badge {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

.exam-showcase-body {
    padding: 1.5rem;
}

.exam-showcase-body h6 {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.4rem;
}

.exam-showcase-body p.exam-desc {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    min-height: 2.7em;
}

.exam-showcase-meta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.exam-showcase-meta .meta-item {
    background: var(--light);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 0.75rem 0.4rem;
    text-align: center;
}

.exam-showcase-meta .meta-item strong {
    display: block;
    font-size: 1.05rem;
    color: var(--dark);
}

.exam-showcase-meta .meta-item small {
    color: var(--gray);
    font-size: 0.72rem;
}

.exam-showcase-status {
    font-size: 0.85rem;
    border-radius: 10px;
    padding: 0.55rem 0.8rem;
    margin-bottom: 1rem;
    display: block;
}

.exam-showcase-status.ok {
    background: #dcfce7;
    color: #166534;
}

.exam-showcase-status.wait {
    background: #fef3c7;
    color: #92400e;
}

.exam-showcase-status.none {
    background: #f1f5f9;
    color: var(--gray);
}

.exam-showcase-status.info {
    background: #e0f2fe;
    color: #075985;
}

/* Buttons */
.exam-showcase-btn,
.btn-glow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.4rem;
    border-radius: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.exam-showcase-btn {
    width: 100%;
}

.exam-showcase-btn.daily,
.btn-glow {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
}

.exam-showcase-btn.weekly {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: #fff;
}

.exam-showcase-btn:hover,
.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.25);
    color: #fff;
}

.btn-outline-glow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.4rem;
    border-radius: 14px;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid rgba(99, 102, 241, 0.35);
    color: var(--primary);
    background: transparent;
    transition: all 0.3s ease;
}

.btn-outline-glow:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: var(--primary);
    color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.btn-stack > * {
    flex: 1 1 180px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--gray);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
    display: block;
}

/* Leaderboard */
.leaderboard-card {
    background: #fff;
    border-radius: 24px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.leaderboard-card .card-header-custom {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.leaderboard-card .card-body-custom {
    padding: 1.25rem 1.5rem;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th {
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray);
    padding: 0.65rem 0.75rem;
    border-bottom: 2px solid #e2e8f0;
    background: var(--light);
}

.leaderboard-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--dark);
    vertical-align: middle;
}

.leaderboard-table tr:last-child td {
    border-bottom: none;
}

.leaderboard-table tr.top-1 td { background: #fffbeb; }
.leaderboard-table tr.top-2 td { background: #f8fafc; }
.leaderboard-table tr.top-3 td { background: #fff7ed; }

.rank-medal {
    font-weight: 700;
    color: var(--primary);
}

/* Result page */
.result-shell .score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    border: 4px solid rgba(255, 255, 255, 0.5);
}

.result-shell .score-circle .score-value {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
}

.result-shell .score-circle .score-max {
    font-size: 0.95rem;
    opacity: 0.9;
}

.result-shell .stat-box {
    text-align: center;
    padding: 1.1rem 0.75rem;
    border-radius: 16px;
    background: var(--light);
    border: 1px solid rgba(0, 0, 0, 0.05);
    height: 100%;
    margin-bottom: 1rem;
}

.result-shell .stat-box h3 {
    font-weight: 800;
    margin: 0.35rem 0 0.15rem;
    font-size: 1.5rem;
    color: var(--dark);
}

.result-shell .stat-box small {
    color: var(--gray);
}

.result-shell .stat-correct { background: #dcfce7; color: #166534; }
.result-shell .stat-correct h3 { color: #166534; }
.result-shell .stat-wrong { background: #fee2e2; color: #991b1b; }
.result-shell .stat-wrong h3 { color: #991b1b; }
.result-shell .stat-skipped { background: #f1f5f9; color: var(--gray); }
.result-shell .stat-time { background: #e0f2fe; color: #075985; }
.result-shell .stat-time h3 { color: #075985; }

.result-shell .detail-table th {
    width: 40%;
    font-weight: 600;
    color: var(--gray);
    border-color: #f1f5f9;
}

.result-shell .detail-table td {
    font-weight: 600;
    color: var(--dark);
    border-color: #f1f5f9;
}

/* Review page */
.review-summary {
    background: #fff;
    border-radius: 24px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.review-summary .sum-item {
    text-align: center;
}

.review-summary .sum-item h4 {
    font-weight: 800;
    margin-bottom: 0.15rem;
}

.question-review {
    background: #fff;
    border-radius: 24px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-left: 6px solid #e2e8f0;
    transition: transform 0.3s ease;
}

.question-review:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(99, 102, 241, 0.1);
}

.question-review.correct { border-left-color: var(--success); }
.question-review.wrong { border-left-color: var(--danger); }
.question-review.skipped { border-left-color: var(--gray); }

.q-number {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    padding: 0.25rem 0.85rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.option-review {
    padding: 0.8rem 1rem;
    margin: 0.5rem 0;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    background: var(--light);
    font-size: 0.95rem;
}

.option-review.correct-answer {
    background: #dcfce7;
    border-color: var(--success);
    color: #166534;
    font-weight: 600;
}

.option-review.user-answer {
    background: #fef3c7;
    border-color: var(--warning);
    color: #92400e;
}

.option-review.user-answer.wrong-answer {
    background: #fee2e2;
    border-color: var(--danger);
    color: #991b1b;
}

.status-badge {
    display: inline-block;
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
    float: end;
}

.status-correct { background: var(--success); color: #fff; }
.status-wrong { background: var(--danger); color: #fff; }
.status-skipped { background: var(--gray); color: #fff; }

/* Take-exam focused chrome */
body.exam-mode {
    background: #f1f5f9;
}

.exam-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    padding: 0.9rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.25);
}

.exam-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.exam-title {
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.exam-title a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.9rem;
}

.timer {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.45rem 1.1rem;
    border-radius: 999px;
    font-size: 1.15rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 110px;
    text-align: center;
}

.timer.warning {
    background: rgba(245, 158, 11, 0.35);
    animation: pulse 1s infinite;
}

.timer.danger {
    background: rgba(239, 68, 68, 0.4);
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.progress-section {
    background: #fff;
    padding: 1rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.progress-bar-custom {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s;
}

.question-card {
    background: #fff;
    border-radius: 24px;
    padding: 1.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 1.25rem;
    min-height: 340px;
}

.question-number {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    padding: 0.3rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.question-text {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 1.4rem;
    line-height: 1.65;
}

.option-item {
    display: block;
    width: 100%;
    padding: 0.95rem 1.1rem;
    margin: 0.6rem 0;
    text-align: left;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    color: var(--dark);
}

.option-item:hover {
    border-color: var(--primary);
    background: #eef2ff;
}

.option-item.selected {
    border-color: var(--primary);
    background: #eef2ff;
    font-weight: 600;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.option-item .opt-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    margin-right: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--dark);
}

.option-item.selected .opt-key {
    background: var(--primary);
    color: #fff;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
    gap: 0.75rem;
}

.btn-nav {
    padding: 0.75rem 1.75rem;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-prev {
    background: #e2e8f0;
    color: var(--dark);
}

.btn-prev:hover {
    background: #cbd5e1;
}

.btn-next,
.btn-submit {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
}

.btn-next:hover,
.btn-submit:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    color: #fff;
}

.btn-submit {
    padding: 0.75rem 2.25rem;
    background: linear-gradient(135deg, var(--success), #059669);
}

.nav-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.nav-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    background: #e2e8f0;
    color: var(--gray);
}

.nav-dot.current {
    background: var(--primary);
    color: #fff;
    transform: scale(1.15);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.45);
}

.nav-dot.answered {
    background: var(--success);
    color: #fff;
}

.nav-dot.unanswered {
    background: #e2e8f0;
    color: var(--gray);
}

.nav-dot:hover {
    transform: scale(1.1);
}

.question-container {
    display: none;
}

.question-container.active {
    display: block;
}

.submit-bar {
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    padding: 1rem 0;
    border-top: 2px solid #e2e8f0;
    z-index: 50;
}

.answered-count {
    font-weight: 700;
    color: var(--primary);
}

@media (max-width: 576px) {
    .exam-showcase-meta {
        grid-template-columns: repeat(2, 1fr);
    }

    .btn-stack > * {
        flex: 1 1 100%;
    }
}
