/* ===================================================================
   CCE ONLINE EXAM (CBT) MOCK TEST - MODERN MINIMAL FULL-SCREEN INTERFACE
   Authentic Computer Based Test Interface with Fullscreen Immersion,
   Ultra-Clean Minimalist Glassmorphism, and Fluid Dynamic Layouts
   =================================================================== */

/* App Container Fullscreen & Reset */
body.cbt-mode {
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  user-select: none;
  position: fixed;
  inset: 0;
}

/* Fullscreen Mode Enhancements */
body.cbt-mode.is-fullscreen {
  cursor: default;
}

/* Fullscreen Entry Prompt Banner */
.cbt-fullscreen-prompt-bar {
  background: linear-gradient(90deg, #1e1b4b 0%, #312e81 50%, #065f46 100%);
  border-bottom: 1px solid rgba(99, 102, 241, 0.35);
  padding: 0.5rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  color: #e0e7ff;
  z-index: 60;
  animation: fadeIn 0.3s ease;
}

.cbt-fullscreen-prompt-bar.hidden {
  display: none !important;
}

.cbt-fs-prompt-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.cbt-fs-enter-btn {
  background: #10b981;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
  transition: all var(--transition-fast);
}

.cbt-fs-enter-btn:hover {
  background: #059669;
  transform: translateY(-1px);
}

.cbt-fs-dismiss-btn {
  background: transparent;
  color: #a5b4fc;
  font-size: 1rem;
  padding: 0 0.35rem;
  cursor: pointer;
  line-height: 1;
}

/* 1. TOP HEADER BAR */
.cbt-topbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.45rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  z-index: 50;
  height: 56px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

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

.cbt-logo-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
  flex-shrink: 0;
}

.cbt-title-group h1 {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.2;
}

.cbt-title-group .cbt-subtitle {
  font-size: 0.74rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cbt-badge-live {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.cbt-badge-live .live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  animation: pulseLive 1.5s infinite;
}

@keyframes pulseLive {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Header Quick Actions */
.cbt-top-tools {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.cbt-tool-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cbt-tool-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-glow);
  transform: translateY(-1px);
}

.cbt-tool-btn.highlight-fs {
  background: rgba(99, 102, 241, 0.16);
  color: var(--accent-primary);
  border-color: rgba(99, 102, 241, 0.35);
}

.cbt-tool-btn.highlight-fs:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

/* Candidate Profile Header Card */
.cbt-candidate-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.75rem 0.25rem 0.35rem;
  box-shadow: var(--shadow-sm);
}

.cbt-avatar-box {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--border-glow);
  overflow: hidden;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.cbt-candidate-info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.cbt-candidate-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.cbt-candidate-roll {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* 2. SUB-HEADER / SECTION & TIMER STRIP */
.cbt-subbar {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.35rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  z-index: 40;
  height: 48px;
}

.cbt-section-strip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.cbt-section-strip::-webkit-scrollbar { display: none; }

.cbt-section-label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-right: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.cbt-sec-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.cbt-sec-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.cbt-sec-tab.active {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
}

.cbt-sec-pill {
  font-size: 0.68rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.25);
  font-weight: 700;
}

.cbt-sec-tab.active .cbt-sec-pill {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
}

/* Modern Timer Display */
.cbt-timer-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.85rem;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.cbt-timer-icon {
  color: #10b981;
  display: flex;
  align-items: center;
}

.cbt-timer-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-right: 0.2rem;
}

.cbt-timer-digits {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #10b981;
  transition: color var(--transition-fast);
}

.cbt-timer-digits.warning {
  color: #f59e0b;
  animation: pulseAmber 1.2s infinite;
}

.cbt-timer-digits.critical {
  color: #ef4444;
  animation: pulseRed 0.8s infinite;
}

@keyframes pulseAmber {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes pulseRed {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.05); }
}

/* 3. MAIN EXAM LAYOUT (WORKSPACE + PALETTE) */
.cbt-main-workspace {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
  height: calc(100vh - 56px - 48px - 58px);
}

/* Left / Center: Question Canvas */
.cbt-question-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 1.5rem 2rem;
  background: var(--bg-primary);
  position: relative;
  scrollbar-width: thin;
}

/* Security Watermark */
.cbt-watermark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-repeat: repeat;
  background-size: 320px 180px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='180' viewBox='0 0 320 180'%3E%3Ctext x='40' y='90' fill='%2364748b' fill-opacity='0.035' font-family='monospace' font-weight='700' font-size='15' transform='rotate(-25 40 90)'%3EGSSSB-CCE-2026%3C/text%3E%3C/svg%3E");
  z-index: 1;
}

[data-theme="light"] .cbt-watermark {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='180' viewBox='0 0 320 180'%3E%3Ctext x='40' y='90' fill='%230f172a' fill-opacity='0.03' font-family='monospace' font-weight='700' font-size='15' transform='rotate(-25 40 90)'%3EGSSSB-CCE-2026%3C/text%3E%3C/svg%3E");
}

/* Question Header Bar */
.cbt-q-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.85rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cbt-q-meta-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cbt-q-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.cbt-q-marks {
  font-size: 0.76rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cbt-q-marks .mark-pos {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.cbt-q-marks .mark-neg {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.cbt-q-controls-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cbt-lang-select {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.cbt-font-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}
.cbt-font-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-glow);
}

/* Question Body Card */
.cbt-q-content-box {
  position: relative;
  z-index: 2;
  flex: 1;
  max-width: 1050px;
}

.cbt-q-number-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.cbt-q-text-en {
  font-size: 1.12rem;
  line-height: 1.65;
  color: var(--text-primary);
  margin-bottom: 1rem;
  white-space: pre-line;
  font-weight: 500;
}

.cbt-q-text-guj {
  font-size: 1.08rem;
  line-height: 1.7;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.06);
  border-left: 3px solid #38bdf8;
  padding: 0.85rem 1.15rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 1.75rem;
  white-space: pre-line;
  font-weight: 500;
}

[data-theme="light"] .cbt-q-text-guj {
  color: #0369a1;
  background: rgba(2, 132, 199, 0.08);
}

/* Options Cards */
.cbt-options-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.cbt-option-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.cbt-option-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  transform: translateX(4px);
}

.cbt-option-card.selected {
  background: rgba(99, 102, 241, 0.16);
  border-color: var(--border-active);
  box-shadow: 0 0 0 1px var(--border-active), var(--shadow-sm);
}

.cbt-radio-indicator {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.cbt-option-card.selected .cbt-radio-indicator {
  border-color: var(--accent-primary);
  background: var(--accent-primary);
}

.cbt-radio-indicator::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  transform: scale(0);
  transition: all var(--transition-fast);
}

.cbt-option-card.selected .cbt-radio-indicator::after {
  opacity: 1;
  transform: scale(1);
}

.cbt-option-key {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-muted);
  width: 24px;
}

.cbt-option-card.selected .cbt-option-key {
  color: var(--accent-primary);
}

.cbt-option-text {
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

/* 4. BOTTOM ACTION TOOLBAR */
.cbt-bottom-bar {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  z-index: 40;
  height: 58px;
}

.cbt-action-left,
.cbt-action-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.cbt-btn {
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.cbt-btn-review {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.3);
}
.cbt-btn-review:hover {
  background: rgba(168, 85, 247, 0.25);
  color: #d8b4fe;
}

.cbt-btn-clear {
  background: var(--bg-card);
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}
.cbt-btn-clear:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.cbt-btn-prev {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}
.cbt-btn-prev:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
}

.cbt-btn-savenext {
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}
.cbt-btn-savenext:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.55);
}

.cbt-btn-submit {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}
.cbt-btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.5);
}

/* 5. RIGHT QUESTION PALETTE SIDEBAR */
.cbt-palette-panel {
  width: 330px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: width var(--transition-normal), transform var(--transition-normal);
  z-index: 30;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.25);
}

.cbt-palette-panel.collapsed {
  width: 0;
  transform: translateX(100%);
  overflow: hidden;
}

/* Sidebar Toggle Arrow Tab */
.cbt-palette-toggle-tab {
  position: absolute;
  top: 50%;
  left: -22px;
  transform: translateY(-50%);
  width: 22px;
  height: 50px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-right: none;
  border-radius: 6px 0 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  z-index: 45;
  box-shadow: -3px 0 8px rgba(0, 0, 0, 0.15);
  transition: all var(--transition-fast);
}

.cbt-palette-toggle-tab:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

/* Status Legend */
.cbt-legend-box {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: var(--bg-card);
}

.cbt-legend-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.73rem;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.2;
}

.cbt-legend-item.full-width {
  grid-column: span 2;
}

/* Custom Status Icon Shapes */
.cbt-badge-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  position: relative;
}

/* State 1: Answered (Green Shield) */
.cbt-badge-answered,
.cbt-qbtn.answered {
  background: #16a34a !important;
  color: #fff !important;
  clip-path: polygon(0 0, 100% 0, 100% 75%, 50% 100%, 0 75%);
}

/* State 2: Not Answered (Red Shield) */
.cbt-badge-not-answered,
.cbt-qbtn.not-answered {
  background: #dc2626 !important;
  color: #fff !important;
  clip-path: polygon(0 0, 100% 0, 100% 75%, 50% 100%, 0 75%);
}

/* State 3: Not Visited (Gray Pill / Box) */
.cbt-badge-not-visited,
.cbt-qbtn.not-visited {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-secondary) !important;
  border-radius: 4px;
}
[data-theme="light"] .cbt-badge-not-visited,
[data-theme="light"] .cbt-qbtn.not-visited {
  background: #e2e8f0 !important;
  color: #475569 !important;
}

/* State 4: Marked for Review (Purple Circle) */
.cbt-badge-marked,
.cbt-qbtn.marked {
  background: #7c3aed !important;
  color: #fff !important;
  border-radius: 50% !important;
  clip-path: none !important;
}

/* State 5: Answered & Marked for Review */
.cbt-badge-marked-answered,
.cbt-qbtn.marked-answered {
  background: #7c3aed !important;
  color: #fff !important;
  border-radius: 50% !important;
  clip-path: none !important;
  position: relative;
}

.cbt-badge-marked-answered::after,
.cbt-qbtn.marked-answered::after {
  content: '';
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 8px;
  height: 8px;
  background: #22c55e;
  border: 1.5px solid #fff;
  border-radius: 2px;
}

/* Section Header in Palette */
.cbt-palette-section-head {
  padding: 0.6rem 1rem;
  background: var(--bg-card-hover);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cbt-palette-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.cbt-palette-subtext {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Number Grid */
.cbt-grid-container {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem;
  scrollbar-width: thin;
}

.cbt-palette-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
}

.cbt-qbtn {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  outline: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
}

.cbt-qbtn:hover {
  transform: scale(1.08);
  z-index: 5;
}

.cbt-qbtn.active-q {
  box-shadow: 0 0 0 3px #06b6d4, 0 0 14px rgba(6, 182, 212, 0.7);
  transform: scale(1.06);
  z-index: 6;
}

/* Bottom of Palette */
.cbt-palette-footer {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.cbt-stats-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-secondary);
}

/* 6. MODALS: INSTRUCTIONS, QUESTION PAPER, SCRATCHPAD, SUBMIT CONFIRM */
.cbt-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

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

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

.cbt-modal-window {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-xl);
  max-width: 820px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(99, 102, 241, 0.25);
  overflow: hidden;
}

.cbt-modal-head {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cbt-modal-head h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cbt-modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}
.cbt-modal-close:hover { color: var(--text-primary); }

.cbt-modal-body {
  padding: 1.75rem;
  overflow-y: auto;
  line-height: 1.65;
  color: var(--text-secondary);
  font-size: 0.94rem;
  scrollbar-width: thin;
}

.cbt-modal-foot {
  padding: 1.15rem 1.75rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.12);
}

/* Submit Confirmation Table */
.cbt-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.88rem;
}

.cbt-summary-table th,
.cbt-summary-table td {
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--border-subtle);
  text-align: center;
}

.cbt-summary-table th {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 700;
}

.cbt-summary-table td:first-child,
.cbt-summary-table th:first-child {
  text-align: left;
}

/* Scratchpad Canvas */
#scratchCanvas {
  border: 1px solid var(--border-subtle);
  background: #0f172a;
  border-radius: var(--radius-md);
  cursor: crosshair;
  touch-action: none;
}
[data-theme="light"] #scratchCanvas {
  background: #ffffff;
}

/* 7. POST-EXAM COMPREHENSIVE RESULT & ANALYTICS DASHBOARD */
.cbt-result-view {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 90;
  overflow-y: auto;
  padding: 2.5rem 1.5rem 6rem;
  display: none;
}

.cbt-result-view.active {
  display: block;
}

.cbt-result-container {
  max-width: 1180px;
  margin: 0 auto;
}

.cbt-result-hero {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.16) 0%, rgba(139, 92, 246, 0.12) 50%, rgba(14, 165, 233, 0.12) 100%);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.cbt-score-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.cbt-score-big {
  font-family: 'JetBrains Mono', monospace;
  font-size: 3.8rem;
  font-weight: 900;
  color: #10b981;
  line-height: 1;
}

.cbt-score-total {
  font-size: 1.35rem;
  color: var(--text-muted);
  font-weight: 600;
}

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

.cbt-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  backdrop-filter: blur(12px);
}

.cbt-kpi-val {
  font-size: 2rem;
  font-weight: 900;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 0.35rem;
}

.cbt-kpi-lbl {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Review Solutions Mode */
.cbt-review-section {
  margin-top: 3rem;
}

.cbt-review-filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.cbt-review-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cbt-review-tab.active {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
}

.cbt-solution-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(12px);
}

.cbt-solution-card.correct {
  border-left: 4px solid #10b981;
}

.cbt-solution-card.incorrect {
  border-left: 4px solid #ef4444;
}

.cbt-solution-card.skipped {
  border-left: 4px solid #f59e0b;
}

.cbt-sol-expl-box {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  margin-top: 1.15rem;
  font-size: 0.94rem;
  line-height: 1.65;
}

/* Responsive CBT Adjustments */
@media (max-width: 1024px) {
  .cbt-palette-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    height: 100%;
  }
}

@media (max-width: 768px) {
  .cbt-topbar {
    padding: 0.45rem 0.75rem;
  }
  .cbt-title-group h1 {
    font-size: 0.82rem;
  }
  .cbt-candidate-roll {
    display: none;
  }
  .cbt-bottom-bar {
    padding: 0.45rem 0.75rem;
  }
  .cbt-btn {
    padding: 0.45rem 0.85rem;
    font-size: 0.8rem;
  }
}
