/* ===== CSS Variables ===== */
:root {
    --bg-main: #FBFBFB;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F8FAFC;
    --border-color: rgba(0, 59, 148, 0.12);
    --border-hover: rgba(0, 59, 148, 0.25);
    
    --primary: #003B94;
    --primary-hover: #2E5EAA;
    --secondary: #C7E8F3;
    --accent: #2E5EAA;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #E63B2E;
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    --font-sans: 'Plus Jakarta Sans', sans-serif;
    
    --transition: all 0.2s ease-in-out;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 30px rgba(0,59,148,0.08);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== View Management ===== */
.view {
    display: none;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* ===== Top Navigation Bar ===== */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 64px;
    background: #003B94;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.top-nav-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-logo { width: auto; height: 48px; max-width: 250px; object-fit: contain; }

.brand-name {
    font-weight: 800;
    font-size: 1.25rem;
    color: #ffffff;
}

.top-nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.nav-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ffffff;
    color: #003B94;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 0.5rem;
    transition: var(--transition);
}

.profile-avatar:hover {
    box-shadow: 0 0 0 3px rgba(0, 59, 148, 0.15);
}

/* ===== Home Content ===== */
.home-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

.hero-section {
    text-align: center;
    padding: 3rem 1rem 2rem;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.hero-section p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* ===== Exam Type Cards ===== */
.exam-cards-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.exam-type-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.exam-type-card:hover:not(.disabled-card) {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.exam-type-card.expanded {
    border-color: var(--primary);
    background: linear-gradient(180deg, var(--bg-card) 0%, rgba(199,232,243,0.15) 100%);
}

.disabled-card {
    opacity: 0.55;
    cursor: not-allowed;
}

.card-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--secondary);
    color: var(--primary);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.card-badge.coming-soon {
    background: rgba(0,0,0,0.06);
    color: var(--text-muted);
}

.card-icon {
    width: 56px;
    height: 56px;
    background: rgba(0, 59, 148, 0.06);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exam-type-card h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
}

.disabled-card h2 {
    color: var(--text-muted);
}

.exam-type-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.card-arrow {
    font-size: 1.2rem;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.exam-type-card.expanded .card-arrow {
    transform: rotate(180deg);
}

/* ===== Drill-Down Area ===== */
.drilldown-area {
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.drilldown-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    animation: slideDown 0.3s ease forwards;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.drilldown-panel h3 {
    color: var(--primary);
    font-weight: 800;
    font-size: 1.15rem;
    margin-bottom: 1rem;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.breadcrumb-item {
    cursor: pointer;
    color: var(--primary);
    font-weight: 600;
    transition: var(--transition);
}

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

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

.breadcrumb-current {
    color: var(--text-main);
    font-weight: 700;
}

/* Tier / Year / Date cards inside drill-down */
.drill-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.drill-option {
    background: var(--bg-main);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drill-option:hover {
    border-color: var(--primary);
    background: var(--secondary);
}

.drill-option-text {
    font-weight: 700;
    color: var(--text-main);
}

.drill-option-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.drill-option-arrow {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.2rem;
}

/* Shift cards (final level) */
.shift-card {
    background: var(--bg-main);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem 1.25rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.shift-card:hover {
    border-color: var(--primary);
    background: var(--secondary);
}

.shift-card-info {
    display: flex;
    flex-direction: column;
}

.shift-card-title {
    font-weight: 700;
    color: var(--text-main);
}

.shift-card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.shift-card-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.shift-card-btn:hover {
    background: var(--primary-hover);
}

/* ===== Metrics Section ===== */
.metrics-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.section-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1.25rem;
}

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

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.metric-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-val {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ===== Shared: Buttons ===== */
button {
    cursor: pointer;
    border: none;
    outline: none;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    transition: var(--transition);
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }

.btn-secondary { background: var(--secondary); color: var(--primary); }
.btn-secondary:hover { background: #b0dceb; }

.btn-outline { background: transparent; border: 1px solid var(--border-color); color: var(--primary); }
.btn-outline:hover { border-color: var(--primary); background: rgba(0, 59, 148, 0.05); }

.btn-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.btn-warning:hover { background: rgba(245, 158, 11, 0.2); }

.btn-danger { background: rgba(230, 59, 46, 0.1); color: var(--danger); border: 1px solid rgba(230, 59, 46, 0.3); }
.btn-danger:hover { background: rgba(230, 59, 46, 0.2); }

.btn-large { font-size: 1.2rem; padding: 1rem 3rem; }

.back-link {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--primary-hover);
}

/* ===== Shared: App Header ===== */
.app-header {
    text-align: center;
    padding: 3rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(251, 251, 251, 0.8);
    backdrop-filter: blur(10px);
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.app-header p {
    color: var(--text-muted);
}

/* ===== Instructions View ===== */
.instructions-container {
    max-width: 800px;
    margin: 3rem auto;
    background: var(--bg-card);
    padding: 3rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.instructions-container h2 {
    margin-bottom: 1.5rem;
    color: var(--primary);
    font-weight: 800;
}

.inst-list {
    margin-left: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    color: var(--text-main);
    font-size: 1.1rem;
    line-height: 1.5;
}

.inst-action {
    margin-top: 3rem;
    text-align: center;
}

/* ===== Exam View ===== */
.exam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.exam-title {
    font-weight: 700;
    color: var(--primary);
}

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

.exam-layout {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    height: calc(100vh - 75px);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    overflow: hidden;
}

.sidebar {
    width: 320px;
    background: rgba(0, 59, 148, 0.02);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
}

/* Section Tabs */
.section-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    overflow-x: auto;
    flex-shrink: 0;
}

.tab {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    transition: var(--transition);
}

.tab:hover { color: var(--primary); background: rgba(0, 59, 148, 0.05); }
.tab.active { color: var(--primary); background: var(--secondary); border: 1px solid rgba(0, 59, 148, 0.2); }
.tab.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* Question Area */
.question-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
}

/* ===== Exam View (1:1 CBT Structure - Exact Replica) ===== */
/* General Resets for CBT */
.cbt-layout * {
    font-family: Arial, Helvetica, sans-serif;
}

/* 1. CBT Header */
.cbt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #ffffff;
    border-bottom: 1px solid #cccccc;
}

.cbt-logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    color: #000;
    font-family: Arial, sans-serif;
}

.cbt-logo-placeholder {
    width: 40px;
    height: 40px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23d32f2f"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/></svg>') no-repeat center;
    background-size: contain;
}

.cbt-exam-name {
    font-size: 14px;
}

.cbt-zoom-controls {
    display: flex;
    gap: 10px;
    margin-left: 40px;
}

.cbt-btn-zoom {
    background: #1976d2;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.cbt-title-area {
    text-align: center;
    flex: 1;
}

.cbt-main-title {
    font-weight: bold;
    font-size: 16px;
    color: #000;
    margin-bottom: 5px;
}

.cbt-cand-info {
    font-size: 13px;
    color: #000;
    font-weight: bold;
}

.cbt-timer-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 20px;
}

.cbt-timer-label {
    font-size: 14px;
    font-weight: bold;
    color: #000;
    margin-bottom: 2px;
}

.cbt-timer-value {
    font-size: 18px;
    font-weight: bold;
    color: #d32f2f;
    background: #ffffcc;
    padding: 2px 10px;
    border: 1px solid #ffffcc;
}

.cbt-avatar {
    width: 60px;
    height: 60px;
    background: #eeeeee;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cccccc;
}

/* 2. CBT Subheader */
.cbt-subheader {
    display: flex;
    align-items: center;
    padding: 8px 20px;
    background: #ffffff;
    border-bottom: 1px solid #cccccc;
    gap: 20px;
}

.cbt-sub-links a {
    color: #e65100;
    font-weight: bold;
    font-size: 14px;
    text-decoration: underline;
    margin-right: 15px;
    font-family: Arial, sans-serif;
}

.cbt-warning-text {
    flex: 1;
    color: #d32f2f;
    font-weight: bold;
    font-size: 14px;
    font-family: Arial, sans-serif;
}

/* 3. Top Action Bar */
.cbt-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #ffffff;
    border-bottom: 1px solid #cccccc;
    overflow-x: auto;
    white-space: nowrap;
    gap: 50px;
}

.cbt-tabs {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.cbt-tab {
    background: #0000dd;
    color: white;
    padding: 5px 10px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    border: none;
    border-radius: 2px;
}

.cbt-tab.active {
    background: #008800;
}

.cbt-actions-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.cbt-btn-review, .cbt-btn-save {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
}

.cbt-stats-top {
    font-size: 13px;
    font-weight: bold;
    color: #000;
}

.cbt-stats-top span {
    background: yellow;
    color: black;
    padding: 1px 4px;
}

.cbt-last-mins {
    color: #d32f2f;
    font-weight: bold;
    font-size: 22px;
    margin-left: 10px;
}

.cbt-btn-submit-exam {
    background: #d32f2f;
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
}

/* 4. CBT Layout (Sidebar + Content) */
.cbt-layout {
    display: flex;
    height: calc(100vh - 170px);
    overflow: hidden;
    background: #ffffff;
}

/* Sidebar */
.cbt-sidebar {
    width: 280px;
    border-right: 1px solid #cccccc;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.cbt-sidebar-header {
    text-align: center;
    padding: 10px 35px 10px 10px; /* added right padding for arrow */
    font-weight: bold;
    font-size: 14px;
    color: #000;
    border-bottom: 1px solid #cccccc;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    position: relative;
    word-break: break-word;
}

.cbt-sidebar-header::after {
    content: "◀";
    color: #3b82f6;
    font-size: 18px;
    position: absolute;
    right: 10px;
}

.cbt-sidebar-scroll {
    flex: 0 1 auto;
    overflow-y: auto;
    padding: 15px;
}

.cbt-q-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px 10px;
}

.cbt-q-box {
    width: 45px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0000dd;
    color: white;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    border-radius: 2px;
}

.cbt-q-box.answered {
    background: #008800;
}

.cbt-q-box.marked {
    background: #ff0000;
    color: white;
}

.cbt-q-box.answered.marked {
    background: #ffff00;
    color: black;
}

/* Analysis Box */
.cbt-analysis {
    border-top: 1px solid #cccccc;
    background: #ffffff;
}

.cbt-analysis-header {
    background: #cccccc;
    font-weight: bold;
    text-align: center;
    padding: 5px;
    font-size: 13px;
    color: #000;
}

.cbt-analysis-content {
    padding: 10px 15px;
}

.cbt-analysis-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 13px;
    color: #000;
}

.cbt-badge-answered, .cbt-badge-unanswered {
    background: yellow;
    color: black;
    font-weight: bold;
    padding: 1px 5px;
}

/* Main Content */
.cbt-content {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
}



.cbt-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid #cccccc;
    z-index: 1;
    background: #ffffff;
}

.cbt-q-num {
    font-weight: bold;
    font-size: 15px;
    color: #000;
}

.cbt-lang-select {
    font-size: 13px;
    color: #000;
    font-weight: bold;
}

.cbt-lang-select select {
    padding: 2px;
    border: 1px solid #cccccc;
    margin-left: 5px;
}

.cbt-question-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    z-index: 1;
}

.cbt-question-text {
    margin-bottom: 20px;
    font-size: 15px;
    color: #000;
    line-height: 1.5;
}

.cbt-options-container {
    display: flex;
    flex-direction: column;
}

.cbt-option {
    display: flex;
    align-items: flex-start;
    padding: 10px;
    border-top: 1px solid #eeeeee;
    border-bottom: 1px solid #eeeeee;
    background: #ffffff;
    cursor: pointer;
    margin-bottom: -1px; /* collapse borders */
}

.cbt-option input[type="radio"] {
    margin-top: 3px;
    margin-right: 15px;
}

.cbt-option-content {
    flex: 1;
    font-size: 14px;
    color: #000;
    line-height: 1.4;
}

/* ===== Results View ===== */
.results-header {
    position: relative;
}

.results-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.scorecard {
    background: var(--bg-card);
    border: 2px solid var(--secondary);
    border-radius: 16px;
    padding: 3rem;
    display: flex;
    align-items: center;
    justify-content: space-around;
    box-shadow: var(--shadow-lg);
}

.score-circle { text-align: center; }
.score-val { font-size: 4rem; font-weight: 800; color: var(--primary); }
.score-label { color: var(--text-muted); font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }

.stats { display: flex; flex-direction: column; gap: 1.5rem; }
.stat-box { display: flex; justify-content: space-between; align-items: center; min-width: 200px; padding: 1rem; background: rgba(0,0,0,0.02); border-radius: 8px; border: 1px solid var(--border-color); }
.stat-label { color: var(--text-muted); font-weight: 600; }
.stat-val { font-size: 1.25rem; font-weight: 700; }
.stat-val.success { color: var(--success); }
.stat-val.danger { color: var(--danger); }
.stat-val.info { color: var(--accent); }

/* Review Items */
.review-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.review-item.correct { border-left: 4px solid var(--success); }
.review-item.wrong { border-left: 4px solid var(--danger); }
.review-item.unattempted { border-left: 4px solid var(--text-muted); }

.review-options {
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 2px solid rgba(0, 59, 148, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: var(--text-muted);
}
.opt-correct { color: var(--success); font-weight: 700; }
.opt-wrong { color: var(--danger); text-decoration: line-through; }

/* AI Explanation Box */
.ai-explanation {
    margin-top: 1rem;
    padding: 1.5rem;
    background: var(--secondary);
    border: 1px solid rgba(0, 59, 148, 0.15);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ai-badge {
    align-self: flex-start;
    background: var(--primary);
    color: white;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.ai-text {
    line-height: 1.6;
    color: var(--text-main);
    overflow-wrap: break-word;
    word-break: break-word;
    overflow-x: auto;
}

/* Tables in Explanations and Review */
.ai-text table, .review-item table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
    font-size: 0.95rem;
    overflow-x: auto;
    display: table;
}

.ai-text th, .ai-text td, .review-item th, .review-item td {
    border: 1px solid rgba(0, 59, 148, 0.2);
    padding: 8px 12px;
    text-align: left;
}

.ai-text th, .review-item th {
    background: rgba(0, 59, 148, 0.08);
    font-weight: 700;
    color: var(--primary);
}

.ai-text img, .ai-text svg {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0.75rem auto;
}

.orig-exp {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed rgba(0, 59, 148, 0.2);
    font-size: 0.95rem;
    color: var(--primary);
    font-weight: 500;
}

/* ===== Tooltip Box ===== */
.tooltip-box {
    position: absolute;
    bottom: calc(100% + 12px);
    right: 0;
    width: 260px;
    background-color: var(--primary);
    color: var(--bg-main);
    padding: 1.2rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 59, 148, 0.25);
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: left;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(10px);
    pointer-events: none;
}

.tooltip-box.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tooltip-box::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 25px;
    border-width: 8px;
    border-style: solid;
    border-color: var(--primary) transparent transparent transparent;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .top-nav { padding: 0 1rem; }
    .brand-name { display: none; }
    .home-content { padding: 1rem; }
    .hero-section h1 { font-size: 1.75rem; }
    .exam-cards-section { grid-template-columns: 1fr; }
    .drill-options { grid-template-columns: 1fr; }
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .scorecard { flex-direction: column; gap: 2rem; padding: 2rem; }
}
