/* TCS iON COMPUTER BASED TEST (CBT) SIMULATOR STYLES */
/* Modeled after official SSC, CISF, and NTA CBT interfaces */

.cbt-container {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: #f1f5f9;
  color: #1e293b;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Header bar */
.cbt-header {
  background: #1e3a8a;
  color: #ffffff;
  padding: 0.6rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid #f59e0b;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.cbt-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cbt-exam-logo {
  width: 42px;
  height: 42px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #1e3a8a;
  font-size: 1.1rem;
  border: 2px solid #fbbf24;
}

.cbt-exam-info h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.cbt-exam-info p {
  font-size: 0.75rem;
  color: #bfdbfe;
  margin: 0;
}

.cbt-header-right {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

/* Candidate profile box */
.cbt-candidate-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cbt-candidate-photo {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #1e293b;
  border: 1px solid #fff;
}

.cbt-candidate-details {
  display: flex;
  flex-direction: column;
}

.cbt-cname {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.1;
}

.cbt-croll {
  font-size: 0.7rem;
  color: #93c5fd;
  font-family: monospace;
}

/* Real-time countdown timer */
.cbt-timer-box {
  background: #0f172a;
  border: 2px solid #fbbf24;
  border-radius: 6px;
  padding: 0.35rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.cbt-timer-label {
  font-size: 0.72rem;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 600;
}

.cbt-timer-display {
  font-family: 'Chakra Petch', monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fbbf24;
  letter-spacing: 1px;
}

.cbt-timer-box.warning {
  border-color: #ef4444;
  animation: pulse-border 1s infinite;
}

.cbt-timer-box.warning .cbt-timer-display {
  color: #ef4444;
}

@keyframes pulse-border {
  0%, 100% { border-color: #ef4444; }
  50% { border-color: #7f1d1d; }
}

/* Header Direct Submit / End Mock Button */
.btn-cbt-header-submit {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: 1px solid #34d399;
  border-radius: 6px;
  padding: 0.45rem 1.1rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
  white-space: nowrap;
}

.btn-cbt-header-submit:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.6);
}

.btn-cbt-header-submit:active {
  transform: translateY(1px);
}

/* Strict modal visibility rules to guarantee ending test clears the viewport */
#cbtModal:not(.active) {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

#cbtModal.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

/* Sub-header with Section Tabs */
.cbt-sub-header {
  background: #ffffff;
  border-bottom: 1px solid #cbd5e1;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cbt-sections-list {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
}

.cbt-section-tab {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-bottom: none;
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}

.cbt-section-tab:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.cbt-section-tab.active {
  background: #1e3a8a;
  color: #ffffff;
  border-color: #1e3a8a;
}

.cbt-language-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.cbt-lang-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
}

.cbt-lang-btn.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

/* Main CBT Body Layout */
.cbt-body {
  display: grid;
  grid-template-columns: 1fr 340px;
  flex: 1;
  overflow: hidden;
  background: #f8fafc;
}

/* Question Area */
.cbt-question-area {
  display: flex;
  flex-direction: column;
  border-right: 1px solid #cbd5e1;
  overflow-y: auto;
  background: #ffffff;
}

.cbt-q-header {
  padding: 0.75rem 1.5rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cbt-q-number {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.cbt-q-marks {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.78rem;
}

.mark-tag-pos {
  background: #dcfce7;
  color: #166534;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
}

.mark-tag-neg {
  background: #fee2e2;
  color: #991b1b;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
}

.cbt-q-content {
  padding: 1.75rem;
  flex: 1;
  overflow-y: auto;
}

.cbt-q-text {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #0f172a;
  margin-bottom: 1.75rem;
  font-weight: 500;
}

.cbt-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cbt-option-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.9rem 1.15rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cbt-option-item:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.cbt-option-item.selected {
  background: #eff6ff;
  border-color: #2563eb;
  box-shadow: 0 0 0 1px #2563eb;
}

.cbt-option-radio {
  margin-top: 0.2rem;
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
  cursor: pointer;
}

.cbt-option-label {
  font-weight: 700;
  color: #334155;
  min-width: 20px;
}

.cbt-option-text {
  font-size: 0.95rem;
  color: #1e293b;
  flex: 1;
}

/* Question Action Footer */
.cbt-action-footer {
  padding: 0.85rem 1.5rem;
  background: #f8fafc;
  border-top: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cbt-actions-left {
  display: flex;
  gap: 0.65rem;
}

.cbt-actions-right {
  display: flex;
  gap: 0.65rem;
}

.btn-cbt-action {
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}

/* TCS Action button colors */
.btn-cbt-review {
  background: #7c3aed;
  color: #fff;
}
.btn-cbt-review:hover { background: #6d28d9; }

.btn-cbt-clear {
  background: #ffffff;
  color: #475569;
  border-color: #cbd5e1;
}
.btn-cbt-clear:hover { background: #f1f5f9; color: #0f172a; }

.btn-cbt-save-next {
  background: #16a34a;
  color: #fff;
  font-weight: 700;
}
.btn-cbt-save-next:hover { background: #15803d; }

/* Right Palette: TCS Question Palette */
.cbt-palette-sidebar {
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  overflow-y: auto;
}

.cbt-palette-header {
  padding: 0.85rem 1rem;
  background: #e2e8f0;
  border-bottom: 1px solid #cbd5e1;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
  text-transform: uppercase;
}

/* Legend with standard TCS iON symbols */
.cbt-legend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.85rem;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

.cbt-legend-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  color: #475569;
}

.palette-badge {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Official TCS Palette Colors */
.badge-not-visited {
  background: #e2e8f0;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.badge-not-answered {
  background: #ea580c;
  color: #ffffff;
  clip-path: polygon(0% 0%, 100% 0%, 100% 75%, 50% 100%, 0% 75%);
}

.badge-answered {
  background: #16a34a;
  color: #ffffff;
  clip-path: polygon(0% 25%, 50% 0%, 100% 25%, 100% 100%, 0% 100%);
}

.badge-marked-review {
  background: #7c3aed;
  color: #ffffff;
  border-radius: 50%;
}

.badge-answered-review {
  background: #7c3aed;
  color: #ffffff;
  border-radius: 50%;
  position: relative;
}

.badge-answered-review::after {
  content: "";
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  border: 1px solid #ffffff;
}

/* Numbers grid */
.cbt-palette-numbers {
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
  flex: 1;
  align-content: start;
  overflow-y: auto;
}

.cbt-pal-btn {
  height: 38px;
  border: none;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
}

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

.cbt-pal-btn.current {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Palette bottom controls */
.cbt-palette-footer {
  padding: 1rem;
  background: #ffffff;
  border-top: 1px solid #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.btn-cbt-view-paper {
  background: #334155;
  color: #fff;
  border: none;
  padding: 0.55rem;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-cbt-submit-final {
  background: #dc2626;
  color: #fff;
  border: none;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.3);
}

.btn-cbt-submit-final:hover {
  background: #b91c1c;
}

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

.cbt-summary-table th {
  background: #1e3a8a;
  color: #ffffff;
  padding: 0.6rem 0.8rem;
  text-align: left;
}

.cbt-summary-table td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b;
}

.cbt-summary-table tr:nth-child(even) td {
  background: #f8fafc;
}

/* ==========================================================================
   PAUSE / RESUME / EXIT CONTROLS & TACTICAL OVERLAY
   ========================================================================== */

/* CBT Header Buttons */
.btn-cbt-header-pause {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: 1px solid #60a5fa;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  padding: 0.45rem 0.95rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.btn-cbt-header-pause:hover {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.4);
}

.btn-cbt-header-home {
  background: linear-gradient(180deg, #475569 0%, #334155 100%);
  color: #f1f5f9;
  border: 1px solid #64748b;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.btn-cbt-header-home:hover {
  background: linear-gradient(180deg, #64748b 0%, #475569 100%);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Pause Overlay Modal */
.cbt-pause-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: cbtFadeIn 0.25s ease-out;
}

@keyframes cbtFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.cbt-pause-card {
  background: #0f172a;
  border: 2px solid #3b82f6;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 35px rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  max-width: 580px;
  width: 90%;
  padding: 2.2rem 2rem;
  text-align: center;
  color: #f8fafc;
}

.cbt-pause-badge {
  display: inline-block;
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid #3b82f6;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  margin-bottom: 1.1rem;
}

.cbt-pause-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.cbt-pause-sub {
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 1.75rem;
}

.cbt-pause-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 1.1rem;
  margin-bottom: 1.75rem;
}

.pause-stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pause-stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #94a3b8;
  text-transform: uppercase;
}

.pause-stat-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fbbf24;
  font-family: monospace;
}

.cbt-pause-actions {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.btn-pause-resume {
  background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
  color: #ffffff;
  border: 1px solid #4ade80;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 0.85rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.4);
  transition: all 0.2s ease;
}

.btn-pause-resume:hover {
  background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(34, 197, 94, 0.5);
}

.btn-pause-home {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #475569;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-pause-home:hover {
  background: #334155;
  color: #ffffff;
  border-color: #64748b;
}

.cbt-pause-footer-note {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: #64748b;
}

