/* UCAT Olympiad - Clean Light CBT Exam Engine & Scorecard Styles */

/* CBT Fullscreen Container */
.cbt-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: #f8fafc;
}

/* CBT Top Bar */
.cbt-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 2rem;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.cbt-brand-box {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.cbt-exam-details h2 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
}

.cbt-exam-details span {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 700;
}

.cbt-timer-wrapper {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: #f1f5f9;
    padding: 0.45rem 1.4rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.timer-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.cbt-timer-clock {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent-emerald);
}

.cbt-timer-clock.urgent {
    color: var(--accent-rose);
    animation: pulseRed 1s infinite;
}

.cbt-candidate-tag {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.88rem;
    color: var(--text-primary);
}

/* CBT Main Workspace Split */
.cbt-workspace {
    display: grid;
    grid-template-columns: 1fr 340px;
    flex: 1;
    overflow: hidden;
}

/* Left: Question Pane */
.cbt-question-pane {
    display: flex;
    flex-direction: column;
    padding: 2rem 2.5rem;
    overflow-y: auto;
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    position: relative;
}

.question-meta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.q-badge-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.q-number-pill {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.3rem 0.85rem;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 0.85rem;
}

.q-section-pill {
    background: var(--bg-subtle);
    color: var(--text-muted);
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

.marks-pill {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-emerald);
}

.question-body-text {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* Formula Container */
.question-formula-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.85rem;
    text-align: center;
    overflow-x: auto;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

/* Options List */
.cbt-options-grid {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 2rem;
}

.cbt-option-item {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cbt-option-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.cbt-option-item.selected {
    background: var(--primary-light);
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.opt-letter {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-subtle);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.88rem;
    flex-shrink: 0;
}

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

.opt-content {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Bottom Action Bar */
.cbt-bottom-bar {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    gap: 0.75rem;
    flex-wrap: wrap;
}

.bottom-left-actions, .bottom-right-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Right: Palette & Proctoring Pane */
.cbt-side-pane {
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    gap: 1.25rem;
    overflow-y: auto;
}

/* Question Palette */
.cbt-palette-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.palette-title {
    font-size: 0.9rem;
    font-weight: 800;
    margin-bottom: 0.85rem;
    color: var(--text-primary);
}

.palette-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-dot.answered, .palette-btn.status-answered {
    background: var(--accent-emerald);
    color: #fff;
}

.legend-dot.not-answered, .palette-btn.status-not_answered {
    background: var(--accent-rose);
    color: #fff;
}

.legend-dot.marked, .palette-btn.status-marked {
    background: var(--accent-purple);
    color: #fff;
}

.legend-dot.not-visited, .palette-btn.status-not_visited {
    background: var(--bg-subtle);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

.palette-btn {
    aspect-ratio: 1;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.palette-btn:hover {
    transform: scale(1.08);
}

.palette-btn.current-active {
    box-shadow: 0 0 0 2px var(--primary);
}

/* Math Symbol Toolbar */
.math-symbol-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
    background: #f1f5f9;
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.math-chip-btn {
    padding: 0.25rem 0.6rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.math-chip-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.formula-preview-box {
    min-height: 52px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.45rem;
    overflow-x: auto;
}

/* Scorecard & Solutions in Light Theme */
.scorecard-banner {
    background: linear-gradient(135deg, #e0e7ff 0%, #ecfdf5 100%);
    border: 1px solid #c7d2fe;
    border-radius: var(--radius-lg);
    padding: 2.8rem 2rem;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.scorecard-banner h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.verification-hash {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--accent-emerald);
    font-weight: 700;
    margin-top: 0.65rem;
}

.score-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.score-stat-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.75rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.score-stat-card .val {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--primary);
}

.score-stat-card .lbl {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
}

/* Solution Breakdown Cards */
.solution-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.6rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.solution-card.correct { border-left: 5px solid var(--accent-emerald); }
.solution-card.incorrect { border-left: 5px solid var(--accent-rose); }
.solution-card.skipped { border-left: 5px solid var(--accent-amber); }

.sol-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
}

.sol-num {
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-primary);
}

.sol-qtext {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.85rem;
}

.sol-formula {
    background: #f8fafc;
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    text-align: center;
    border: 1px solid var(--border-color);
}

.sol-answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.sol-ans-box {
    background: var(--bg-subtle);
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    border: 1px solid var(--border-color);
}

.sol-expl-box {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    padding: 1.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    color: #1e1b4b;
}

/* Teacher Question Card */
.tch-q-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.35rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.tch-q-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
}

.tch-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.tch-opt {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.tch-opt.correct-opt {
    border-color: var(--accent-emerald);
    background: var(--accent-emerald-light);
    color: #065f46;
}

/* Simultaneous test cards */
.simul-test-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.35rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.simul-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
}

.simul-metrics {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.85rem;
}

.simul-metrics .metric .val {
    display: block;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
}

.simul-metrics .metric .lbl {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.simul-bar-wrapper {
    height: 7px;
    background: var(--bg-subtle);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.simul-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent-cyan));
    border-radius: var(--radius-full);
}

/* ==========================================================================
   ENHANCED CBT EXAMINATION DASHBOARD & CANDIDATE PROFILE STYLING
   ========================================================================== */

/* Top Dashboard Bar for Done & Remaining Questions */
.cbt-live-summary-bar {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.65rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.cbt-counters-group {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.cbt-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.cbt-stat-pill.done {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.cbt-stat-pill.remaining {
    background: #fff1f2;
    color: #9f1239;
    border: 1px solid #fecdd3;
}

.cbt-stat-pill.review {
    background: #faf5ff;
    color: #6b21a8;
    border: 1px solid #e9d5ff;
}

.cbt-stat-pill.not-visited {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.cbt-stat-pill .num-badge {
    font-size: 0.95rem;
    font-weight: 800;
}

.cbt-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 240px;
}

.cbt-progress-track {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.cbt-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.cbt-progress-text {
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
}

/* Candidate Profile & Biometric Card in Side Pane */
.cbt-candidate-profile-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.15rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cbt-candidate-row {
    display: flex;
    gap: 0.85rem;
    align-items: center;
}

.cbt-photo-frame {
    position: relative;
    width: 62px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #2563eb;
    background: #f1f5f9;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
}

.cbt-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cbt-photo-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(16, 185, 129, 0.95);
    color: #ffffff;
    font-size: 0.58rem;
    font-weight: 800;
    text-align: center;
    padding: 0.1rem 0;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

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

.cbt-cand-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cbt-cand-roll {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: #1d4ed8;
    background: #eff6ff;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 0.25rem;
}

.cbt-cand-sub {
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.3;
}

.cbt-node-tag {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #e2e8f0;
    color: #64748b;
}

/* Sections Tab Bar */
.cbt-section-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.cbt-section-btn {
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.cbt-section-btn.active {
    background: #1e40af;
    color: #ffffff;
    border-color: #1e40af;
    box-shadow: 0 2px 4px rgba(30, 64, 175, 0.18);
}

/* Palette status colors and icons */
.palette-btn.status-answered {
    background: #10b981 !important;
    color: #ffffff !important;
    border-color: #059669 !important;
    position: relative;
}

.palette-btn.status-answered::after {
    content: "✓";
    font-size: 0.65rem;
    position: absolute;
    top: 2px;
    right: 3px;
    font-weight: 900;
}

.palette-btn.status-not_answered {
    background: #ef4444 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
}

.palette-btn.status-marked {
    background: #8b5cf6 !important;
    color: #ffffff !important;
    border-color: #7c3aed !important;
    border-radius: 50% !important;
}

.palette-btn.status-answered_marked {
    background: #8b5cf6 !important;
    color: #ffffff !important;
    border-color: #7c3aed !important;
    border-radius: 50% !important;
    position: relative;
}

.palette-btn.status-answered_marked::after {
    content: "";
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    right: 2px;
    border: 1px solid #ffffff;
}

.palette-btn.current-active {
    outline: 3px solid #2563eb !important;
    outline-offset: 1px;
    transform: scale(1.08);
}

/* Submission Summary Modal */
.cbt-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}

.cbt-modal-backdrop.show {
    display: flex;
}

.cbt-summary-card {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 540px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cbt-summary-card-header {
    background: #1e293b;
    color: #ffffff;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cbt-summary-card-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
}

.cbt-summary-card-body {
    padding: 1.5rem;
}

.cbt-summary-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0 1.25rem 0;
}

.cbt-summary-table th, .cbt-summary-table td {
    padding: 0.65rem 0.9rem;
    font-size: 0.88rem;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.cbt-summary-table th {
    background: #f8fafc;
    font-weight: 700;
    color: #334155;
}

.cbt-summary-footer {
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

