/* ============================================================
   Question Bank – Futuristic Projector UI  v4
   Senior UX: correct overflow, vertical centering, full bleed
   ============================================================ */

@import url("../assets/fonts/local-fonts.css");

/* ── Root Tokens ── */
:root {
  --qb-primary: #6366f1;
  --qb-secondary: #ec4899;
  --qb-accent: #10b981;
  --qb-amber: #f59e0b;
  --qb-cyan: #06b6d4;
  --qb-violet: #a855f7;
  --qb-opt-bg: rgba(22, 34, 56, 0.85);
}

.qb-font-bn {
  font-family: "Hind Siliguri", "Exo 2", sans-serif;
}

/* ══════════════════════════════════════════════
   PROJECTOR SHELL
   Fixed padding on all 4 sides = breathing room
   No overflow:hidden here — that clips shadows!
   ══════════════════════════════════════════════ */
.projector-view {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 32px 22px 32px;
  /* ← top | right | bottom | left */
  box-sizing: border-box;
  position: relative;
}

/* Subtle animated grid overlay */
.projector-view::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.035) 1px, transparent 1px);
  background-size: 52px 52px;
  pointer-events: none;
  z-index: 0;
}

/* ══════════════════════════════════════════════
   MCQ / CQ VIEW CONTAINER
   ══════════════════════════════════════════════ */
.qb-view {
  display: none;
  /* JS switches to flex */
  flex-direction: column;
  height: 100%;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* ══════════════════════════════════════════════
   HEADER BAR  (unchanged — it's perfect)
   ══════════════════════════════════════════════ */
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 22px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 14px;
  margin-bottom: 10px;
  backdrop-filter: blur(14px);
  flex-shrink: 0;
  position: relative;
}

.header-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(
    90deg,
    rgba(99, 102, 241, 0.12),
    rgba(236, 72, 153, 0.07),
    rgba(6, 182, 212, 0.09)
  );
  pointer-events: none;
}

#mcqTitle,
#cqTitle {
  font-family: "Exo 2", sans-serif;
  font-size: clamp(1rem, 2.2vw, 1.5rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.4px;
  text-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
  display: flex;
  align-items: center;
  gap: 10px;
}

#mcqTitle::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.2em;
  background: linear-gradient(180deg, var(--qb-primary), var(--qb-secondary));
  border-radius: 4px;
  flex-shrink: 0;
}

#mcqTimer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Exo 2", monospace;
  font-size: clamp(1.2rem, 2.4vw, 1.75rem);
  font-weight: 900;
  color: var(--qb-cyan);
  text-shadow: 0 0 16px rgba(6, 182, 212, 0.55);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: 10px;
  padding: 5px 18px;
}

/* ── Timer Progress Bar ── */
.timer-bar-container {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  margin-bottom: 14px;
  overflow: hidden;
  flex-shrink: 0;
}

.timer-bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #f59e0b 55%, #ef4444 100%);
  width: 100%;
  transition: width 1s linear;
  border-radius: 6px;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.55);
}

/* ══════════════════════════════════════════════
   CONTENT AREA + INNER WRAPPER
   content-area: fills remaining height, scrolls
   qb-content-inner: flex column, fills height
   ══════════════════════════════════════════════ */
.content-area {
  flex: 1;
  min-height: 0;
  /* critical for flex children to scroll */
  overflow-y: auto;
  overflow-x: hidden;
  /* Generous padding so box-shadow glows NEVER clip */
  padding: 6px 8px 8px 8px;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.35) transparent;
}

.content-area::-webkit-scrollbar {
  width: 4px;
}

.content-area::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.35);
  border-radius: 4px;
}

/* Inner wrapper: fills height, becomes flex parent for question layouts */
.qb-content-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* The slide-in animation wrapper also fills height */
.mcq-enter {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: slideInUp 0.4s cubic-bezier(0.22, 0.68, 0, 1.2) both;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ══════════════════════════════════════════════
   TYPE 1 & 2 — Full screen, vertically centred
   Max-width centred block: no wasted side space
   ══════════════════════════════════════════════ */
.mcq-simple-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* vertical centre */
  align-items: stretch;
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  /* horizontal centre */
  padding: 20px 0;
  gap: 0;
}

/* ── Question Stem ── */
.mcq-q-text {
  font-size: clamp(1.55rem, 3.4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 20px;
  color: #eef4ff;
  text-shadow: 0 0 36px rgba(99, 102, 241, 0.25);
}

/* ── Optional image ── */
.mcq-q-img img {
  max-height: 22vh;
  max-width: 100%;
  border-radius: 12px;
  border: 2px solid rgba(99, 102, 241, 0.2);
  object-fit: contain;
  margin-bottom: 16px;
  display: block;
  background-color: white;
}

/* ── Points block (i/ii/iii) ── */
.mcq-points {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  padding: 18px 22px;
  background: rgba(6, 182, 212, 0.065);
  border: 1px solid rgba(6, 182, 212, 0.22);
  border-radius: 14px;
}

.mcq-point {
  font-size: clamp(1.15rem, 2.5vw, 1.65rem);
  color: #cce8f4;
}

.mcq-subtext {
  font-size: clamp(0.92rem, 1.85vw, 1.2rem);
  color: var(--qb-amber);
  font-weight: 700;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ── Options 2×2 grid ── */
.mcq-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ── Single Option Card ── */
.mcq-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  background: var(--qb-opt-bg);
  border: 1.5px solid rgba(99, 102, 241, 0.18);
  border-radius: 14px;
  font-size: clamp(1.08rem, 2.35vw, 1.6rem);
  line-height: 1.35;
  color: #dde8f8;
  cursor: default;
  /* transition covers transform AND box-shadow */
  transition:
    border-color 0.25s,
    background 0.25s,
    transform 0.35s cubic-bezier(0.22, 0.68, 0, 1.2),
    box-shadow 0.35s ease;
  backdrop-filter: blur(10px);
  /* overflow:hidden removed so box-shadow can extend beyond border */
  position: relative;
}

.mcq-option .opt-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--qb-primary), #4f46e5);
  border-radius: 50%;
  font-weight: 800;
  font-size: clamp(0.88rem, 1.7vw, 1.05rem);
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.45);
}

/* ══════════════════════════════════════════════
   CORRECT ANSWER  (no clipping possible)
   box-shadow goes outward — parent has no overflow:hidden
   ══════════════════════════════════════════════ */
.mcq-option.correct {
  background: rgba(16, 185, 129, 0.18);
  border-color: #10b981;
  border-width: 2px;
  color: #6ee7b7;
  transform: scale(1.03);
  z-index: 5;
  position: relative;
  /* layered shadow: ring + spread + distant glow */
  box-shadow:
    0 0 0 3px rgba(16, 185, 129, 0.45),
    0 0 28px 4px rgba(16, 185, 129, 0.65),
    0 0 56px 8px rgba(16, 185, 129, 0.22);
  animation: correctGlow 1.6s ease-in-out infinite alternate;
}

.mcq-option.correct .opt-label {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.75);
}

@keyframes correctGlow {
  from {
    box-shadow:
      0 0 0 2px rgba(16, 185, 129, 0.35),
      0 0 18px 2px rgba(16, 185, 129, 0.55),
      0 0 38px 6px rgba(16, 185, 129, 0.18);
  }

  to {
    box-shadow:
      0 0 0 4px rgba(16, 185, 129, 0.6),
      0 0 38px 8px rgba(16, 185, 129, 0.85),
      0 0 72px 14px rgba(16, 185, 129, 0.28);
  }
}

/* Wrong options: dim only, no inline styles */
.mcq-option.wrong-dim {
  opacity: 0.2;
  transform: scale(0.97);
  filter: grayscale(0.5) brightness(0.55);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease,
    filter 0.4s ease;
}

/* ══════════════════════════════════════════════
   TYPE 3 — Passage LEFT | Question RIGHT
   Two-column, content centred vertically
   ══════════════════════════════════════════════ */
.mcq-type3-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 40% 1fr;
  gap: 20px;
  align-items: center;
  padding: 4px 0;
}

/* ── Passage Panel ── */
.mcq-passage-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(99, 102, 241, 0.075);
  border: 1.5px solid rgba(99, 102, 241, 0.28);
  border-radius: 16px;
  padding: 22px 24px;
  position: relative;
  align-self: stretch;
  backdrop-filter: blur(12px);
}

.mcq-passage-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--qb-primary), var(--qb-secondary));
  border-radius: 4px 0 0 4px;
}

.mcq-passage-hint {
  font-size: clamp(0.78rem, 1.4vw, 0.98rem);
  color: var(--qb-cyan);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 14px;
}

.mcq-passage {
  font-size: clamp(1.1rem, 2.2vw, 1.55rem);
  line-height: 1.78;
  color: #ccddf0;
  text-align: justify;
}

.mcq-passage-img img,
.cq-passage-img img {
  max-width: 100%;
  max-height: 18vh;
  border-radius: 10px;
  margin-top: 14px;
  object-fit: contain;
  border: 1px solid rgba(99, 102, 241, 0.2);
  background-color: white;
}

/* ── Question Panel (right col for Type 3) ── */
.mcq-question-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  align-self: stretch;
}

/* ══════════════════════════════════════════════
   TYPE 4 — Passage LEFT | Q1 (top) + Q2 (bottom)
   Clear visual gap + coloured top-border separators
   ══════════════════════════════════════════════ */
.mcq-type4-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 36% 1fr;
  gap: 20px;
  align-items: start;
  padding: 4px 0;
}

.mcq-type4-questions {
  display: flex;
  flex-direction: column;
  gap: 18px;
  /* ← visible gap between Q1 and Q2 */
  align-self: stretch;
}

/* Sub-question cards */
.mcq-sub-question {
  background: rgba(12, 20, 40, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  backdrop-filter: blur(8px);
}

.mcq-sub-question[data-sub="1"] {
  border-top: 3px solid rgba(99, 102, 241, 0.6);
}

.mcq-sub-question[data-sub="2"] {
  border-top: 3px solid rgba(236, 72, 153, 0.6);
}

/* Scale down fonts inside sub-questions to fit both on screen */
.mcq-sub-question .mcq-q-text {
  /* font-size: clamp(1.02rem, 2.05vw, 1.4rem); */
  margin-bottom: 6px;
}

.mcq-sub-question .mcq-points {
  padding: 10px 14px;
  gap: 6px;
  margin-bottom: 8px;
}

/* .mcq-sub-question .mcq-point {
  font-size: clamp(.9rem, 1.85vw, 1.2rem);
} */

.mcq-sub-question .mcq-subtext {
  font-size: clamp(0.78rem, 1.5vw, 0.98rem);
  margin-bottom: 8px;
}

.mcq-sub-question .mcq-options-grid {
  gap: 8px;
}

.mcq-sub-question .mcq-option {
  padding: 11px 16px;
  /* font-size: clamp(0.9rem, 1.9vw, 1.22rem); */
  gap: 12px;
  border-radius: 10px;
}

.mcq-sub-question .mcq-option .opt-label {
  min-width: 34px;
  height: 34px;
  font-size: clamp(0.78rem, 1.4vw, 0.9rem);
}

/* ══════════════════════════════════════════════
   WAITING SCREEN
   ══════════════════════════════════════════════ */
.waiting-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 16px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.waiting-screen .ws-icon {
  font-size: clamp(4rem, 10vw, 7rem);
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(99, 102, 241, 0.8));
}

.waiting-screen .ws-title {
  font-family: "Exo 2", sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  background: linear-gradient(
    135deg,
    var(--qb-primary),
    var(--qb-secondary),
    var(--qb-cyan)
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 4s ease-in-out infinite;
}

.waiting-screen .ws-subtitle {
  font-size: clamp(1rem, 2vw, 1.4rem);
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.ws-dots {
  display: flex;
  gap: 9px;
  justify-content: center;
  margin-top: 8px;
}

.ws-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--qb-primary);
  animation: bounce 1.2s infinite ease-in-out;
}

.ws-dot:nth-child(2) {
  animation-delay: 0.2s;
  background: var(--qb-secondary);
}

.ws-dot:nth-child(3) {
  animation-delay: 0.4s;
  background: var(--qb-cyan);
}

@keyframes bounce {
  0%,
  80%,
  100% {
    transform: scale(0.65);
    opacity: 0.45;
  }

  40% {
    transform: scale(1.25);
    opacity: 1;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-14px);
  }
}

@keyframes gradientShift {
  0%,
  100% {
    filter: hue-rotate(0deg);
  }

  50% {
    filter: hue-rotate(30deg);
  }
}

/* ══════════════════════════════════════════════
   QUIZ ENDED SCREEN
   ══════════════════════════════════════════════ */
.qb-quiz-end {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.qb-quiz-end-icon {
  font-size: clamp(3rem, 8vw, 6rem);
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(16, 185, 129, 0.8));
}

.qb-quiz-end-text {
  font-family: "Exo 2", sans-serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 900;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ══════════════════════════════════════════════
   CREATIVE QUESTIONS
   ══════════════════════════════════════════════ */
.cq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 16px;
  padding: 2px 2px;
}

.cq-container {
  background: rgba(18, 8, 38, 0.68);
  border: 1.5px solid rgba(168, 85, 247, 0.25);
  border-radius: 16px;
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  animation: slideInUp 0.4s cubic-bezier(0.22, 0.68, 0, 1.2) both;
}

.cq-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--qb-violet),
    var(--qb-secondary),
    var(--qb-cyan)
  );
}

.cq-number-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--qb-violet), #7c3aed);
  border-radius: 50%;
  font-family: "Exo 2", sans-serif;
  font-weight: 900;
  font-size: 1.05rem;
  color: white;
  margin-bottom: 12px;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.6);
}

.cq-passage {
  font-size: clamp(0.98rem, 1.95vw, 1.25rem);
  line-height: 1.7;
  margin-bottom: 16px;
  color: #dde8ff;
  text-align: justify;
}

.cq-questions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

.cq-item {
  font-size: clamp(0.9rem, 1.8vw, 1.12rem);
  padding: 9px 14px;
  background: rgba(168, 85, 247, 0.055);
  border-radius: 9px;
  border-left: 3px solid transparent;
  color: #c4d0e8;
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.cq-item:nth-child(1) {
  border-left-color: #6366f1;
}

.cq-item:nth-child(2) {
  border-left-color: #ec4899;
}

.cq-item:nth-child(3) {
  border-left-color: #10b981;
}

.cq-item:nth-child(4) {
  border-left-color: #f59e0b;
}

.cq-label {
  font-family: "Exo 2", sans-serif;
  font-weight: 800;
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  flex-shrink: 0;
}

.cq-item:nth-child(1) .cq-label {
  color: #818cf8;
}

.cq-item:nth-child(2) .cq-label {
  color: #f472b6;
}

.cq-item:nth-child(3) .cq-label {
  color: #34d399;
}

.cq-item:nth-child(4) .cq-label {
  color: #fbbf24;
}

/* ══════════════════════════════════════════════
   SHARED / ADMIN STYLES
   ══════════════════════════════════════════════ */
.tabs-container {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.tab-btn {
  padding: 12px 24px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s;
}

.tab-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  color: white;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
}

.form-group label {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 5px;
  text-transform: uppercase;
  font-weight: 700;
}

.form-control {
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  font-size: 0.9rem;
  font-family: "Hind Siliguri", "Outfit", sans-serif;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

.data-table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 450px;
  margin-top: 20px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 12px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table th {
  background: #1e293b;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.lb-row {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  background: rgba(255, 255, 255, 0.05);
  padding: 15px 20px;
  border-radius: 12px;
}

.lb-rank {
  font-size: 1.5rem;
  font-weight: 900;
  width: 60px;
}

.lb-name {
  flex: 1;
  font-size: 1.3rem;
  font-weight: 700;
}

.lb-bar-container {
  flex: 2;
  height: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  margin: 0 20px;
  overflow: hidden;
}

.lb-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  width: 0%;
  transition: width 1s ease-out;
}

.lb-score {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent);
  width: 100px;
  text-align: right;
  font-size: clamp(0.9rem, 1.8vw, 1.12rem);
  padding: 9px 14px;
  background: rgba(168, 85, 247, 0.055);
  border-radius: 9px;
  border-left: 3px solid transparent;
  color: #c4d0e8;
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.cq-item:nth-child(1) {
  border-left-color: #6366f1;
}

.cq-item:nth-child(2) {
  border-left-color: #ec4899;
}

.cq-item:nth-child(3) {
  border-left-color: #10b981;
}

.cq-item:nth-child(4) {
  border-left-color: #f59e0b;
}

.cq-label {
  font-family: "Exo 2", sans-serif;
  font-weight: 800;
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  flex-shrink: 0;
}

.cq-item:nth-child(1) .cq-label {
  color: #818cf8;
}

.cq-item:nth-child(2) .cq-label {
  color: #f472b6;
}

.cq-item:nth-child(3) .cq-label {
  color: #34d399;
}

.cq-item:nth-child(4) .cq-label {
  color: #fbbf24;
}

/* ══════════════════════════════════════════════
   SHARED / ADMIN STYLES
   ══════════════════════════════════════════════ */
.tabs-container {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.tab-btn {
  padding: 12px 24px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s;
}

.tab-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  color: white;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
}

.form-group label {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 5px;
  text-transform: uppercase;
  font-weight: 700;
}

.form-control {
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  font-size: 0.9rem;
  font-family: "Hind Siliguri", "Outfit", sans-serif;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

.data-table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 450px;
  margin-top: 20px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 12px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table th {
  background: #1e293b;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.lb-row {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  background: rgba(255, 255, 255, 0.05);
  padding: 15px 20px;
  border-radius: 12px;
}

.lb-rank {
  font-size: 1.5rem;
  font-weight: 900;
  width: 60px;
}

.lb-name {
  flex: 1;
  font-size: 1.3rem;
  font-weight: 700;
}

.lb-bar-container {
  flex: 2;
  height: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  margin: 0 20px;
  overflow: hidden;
}

.lb-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  width: 0%;
  transition: width 1s ease-out;
}

.lb-score {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent);
  width: 100px;
  text-align: right;
}

.lb-row:nth-child(1) .lb-rank {
  color: #ffd700;
}

.lb-row:nth-child(2) .lb-rank {
  color: #c0c0c0;
}

.lb-row:nth-child(3) .lb-rank {
  color: #cd7f32;
}

.grid-input {
  width: 50px;
  padding: 5px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 4px;
  text-align: center;
}

.grid-input:focus {
  border-color: var(--primary);
  background: rgba(0, 0, 0, 0.5);
}

.game-container {
  padding: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.timer-bar-container {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  margin-bottom: 20px;
  overflow: hidden;
}

.cq-answer {
  color: #10b981;
  font-size: 0.9em;
  margin-top: 4px;
  padding-left: 20px;
}

.cq-ans-label {
  font-weight: bold;
  color: #10b981;
}

/* ══════════════════════════════════════════════
   MOBILE RESPONSIVE — Type 3 & Type 4
   Stack passage + question into single column
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Reduce shell padding on mobile */
  .projector-view {
    padding: 10px 12px 14px 12px;
  }

  /* TYPE 3 — stack into single column */
  .mcq-type3-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* TYPE 4 — stack into single column */
  .mcq-type4-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Passage container adjustments for mobile */
  .mcq-passage-container {
    padding: 16px 18px;
  }

  /* Options grid: single column on mobile */
  .mcq-options-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Slightly smaller option cards */
  .mcq-option {
    padding: 14px 18px;
    gap: 12px;
  }

  .mcq-option .opt-label {
    min-width: 36px;
    height: 36px;
  }

  /* Sub-question cards for type 4 */
  .mcq-sub-question {
    padding: 14px 16px;
  }

  /* Creative Questions: force single column on mobile
     The minmax(380px, 1fr) is wider than a phone screen */
  .cq-grid {
    grid-template-columns: 1fr;
  }

  .cq-container {
    padding: 16px 14px;
    /* Prevent any internal content from pushing width */
    overflow-x: hidden;
    max-width: 100%;
  }
}

/* Fix Columns left side for Marks Grid */
.sticky-col {
  position: sticky;
  box-sizing: border-box;
}

.data-table th.sticky-col {
  z-index: 20;
  background: #1e293b;
}

.data-table td.sticky-col {
  z-index: 15;
  background: #0f172a;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table tr:hover td.sticky-col {
  background: #1e293b;
}

/* Marks grid: ID → Roll → Name pinned left */
.sticky-id {
  left: 0;
  width: 90px;
  min-width: 90px;
  max-width: 90px;
}

.sticky-roll {
  left: 90px;
  width: 100px;
  min-width: 100px;
  max-width: 100px;
}

.sticky-name {
  left: 190px;
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-right: 2px solid rgba(255, 255, 255, 0.2) !important;
}

/* Student list & attendance: Roll → Name pinned left (no ID column) */
.no-id-sticky .sticky-roll {
  left: 0 !important;
}

.no-id-sticky .sticky-name {
  left: 100px !important;
}

@media (max-width: 768px) {
  .sticky-id {
    display: none !important;
  }

  .sticky-roll {
    left: 0 !important;
    width: 70px !important;
    min-width: 70px !important;
    max-width: 70px !important;
    font-size: 0.8rem;
    padding: 8px !important;
  }

  .sticky-name {
    left: 70px !important;
    width: 90px !important;
    min-width: 90px !important;
    max-width: 90px !important;
    font-size: 0.8rem;
    padding: 8px !important;
  }

  .no-id-sticky .sticky-roll {
    left: 0 !important;
  }

  .no-id-sticky .sticky-name {
    left: 70px !important;
  }
}
