/* ========================== General ========================== */
:root {
  --header-height: 74px;
  --header-offset: var(--header-height);
  --marquee-offset: 0px;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  min-height: 100%;
  font-family: Arial, sans-serif;
  background: #f5f5f5;
  color: #000;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow-x: hidden; /* prevent horizontal shift on mobile */
}
h1, h2 {
  text-align: center;
}
button {
  cursor: pointer;
  padding: 6px 12px;
  margin: 5px;
  border: none;
  border-radius: 4px;
}

.hidden {
  display: none !important;
}
/* ========================== Sidebar ========================== */
.sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  top: 0;
  width: 0;
  position: fixed;
  left: 0;
  background: #1a1a2e;
  overflow-x: hidden;
  overflow-y: auto;
  transition: 0.5s;
  padding-top: 0;
  z-index: 1001;
  color: #fff;
  scrollbar-width: thin;
  scrollbar-color: #34495e #1a1a2e;
}
/* ========================== EXAM MODE BUTTON ========================== */
#examModeContainer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
#examModeBtn,
.sidebar-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 0 !important;
  padding: 11px 0 !important;
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 1.2px;
  text-decoration: none !important;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(239,68,68,0.35);
  transition: transform 0.2s, box-shadow 0.2s;
  text-align: center;
  font-family: inherit;
}
#examModeBtn::before {
  content: "⚡";
  font-size: 14px;
}
#practiceBtn::before {
  content: "\25A6";
  font-size: 12px;
}
#examModeBtn:hover,
.sidebar-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(239,68,68,0.5) !important;
  background: linear-gradient(135deg, #fbbf24 0%, #f87171 100%) !important;
}

.sidebar #questionBankBtn {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: flex-start !important;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 0 !important;
  padding: 11px 12px 11px 46px !important;
  gap: 0;
  background: #fff !important;
  color: #0f172a !important;
  border: 1px solid rgba(15,23,42,0.08) !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 20px rgba(15,23,42,.08) !important;
  font-family: 'Plus Jakarta Sans', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background .25s, transform .25s, box-shadow .25s;
}

.sidebar #questionBankBtn::before,
.sidebar #questionBankBtn::after {
  content: none !important;
}

/* icon box: same 24x24 size/position as examModeBtn/practiceBtn ::before */
.sidebar #questionBankBtn .icon {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(15,23,42,.06);
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

/* label block: same two-line layout as the baked-in SVG text on the other buttons */
.sidebar #questionBankBtn .lbl {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.2;
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
}

.sidebar #questionBankBtn .lbl small {
  font-size: 8.5px;
  font-weight: 500;
  opacity: .65;
  color: #0f172a;
}

.sidebar #questionBankBtn:hover {
  background: #f8fafc !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(15,23,42,.15) !important;
}

.sidebar #questionBankBtn:active {
  transform: scale(.97) !important;
}

/* ========================== SIDEBAR CLOSE BUTTON ========================== */
/* Unify vertical size of all 3 sidebar buttons to match Question Bank's height */
.sidebar #examModeBtn,
.sidebar #practiceBtn,
.sidebar #questionBankBtn {
  height: 52px !important;
}

.sidebar #examModeBtn,
.sidebar #practiceBtn {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 0 !important;
  padding: 11px 12px !important;
  color: transparent !important;
  font-size: 13px !important;
  line-height: 1.2;
  font-weight: 700 !important;
  letter-spacing: 0;
  text-decoration: none !important;
  border: none;
  border-radius: 10px;
  text-align: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background .25s, transform .25s, box-shadow .25s;
}
.sidebar #examModeBtn::before,
.sidebar #practiceBtn::before {
  position: absolute;
  top: 50%;
  left: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(255,255,255,.2);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  transform: translateY(-50%);
  pointer-events: none;
}
.sidebar #examModeBtn::after,
.sidebar #practiceBtn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 46px;
  right: 12px;
  height: 26px;
  transform: translateY(-50%);
  background-repeat: no-repeat;
  background-position: left center;
  background-size: auto 100%;
  pointer-events: none;
}
.sidebar #practiceBtn {
  background: #E8860A !important;
  box-shadow: 0 4px 20px rgba(232,134,10,.4) !important;
}
.sidebar #practiceBtn::before {
  content: "\1F4DD";
}
.sidebar #practiceBtn::after {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%20118%2028'%3E%3Ctext%20x%3D'0'%20y%3D'9'%20fill%3D'white'%20fill-opacity%3D'0.8'%20font-family%3D'Plus%20Jakarta%20Sans%2C%20Arial%2C%20sans-serif'%20font-size%3D'8.5'%20font-weight%3D'500'%3EStart%20learning%3C%2Ftext%3E%3Ctext%20x%3D'0'%20y%3D'23'%20fill%3D'white'%20font-family%3D'Plus%20Jakarta%20Sans%2C%20Arial%2C%20sans-serif'%20font-size%3D'13.5'%20font-weight%3D'700'%3EPractice%20Mode%3C%2Ftext%3E%3C%2Fsvg%3E");
}
.sidebar #practiceBtn:hover {
  background: #F5A623 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 28px rgba(232,134,10,.5) !important;
}
.sidebar #examModeBtn {
  background: #1A9E6B !important;
  box-shadow: 0 4px 20px rgba(26,158,107,.35) !important;
}
.sidebar #examModeBtn::before {
  content: "\23F1\FE0F";
}
.sidebar #examModeBtn::after {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2096%2028'%3E%3Ctext%20x%3D'0'%20y%3D'9'%20fill%3D'white'%20fill-opacity%3D'0.8'%20font-family%3D'Plus%20Jakarta%20Sans%2C%20Arial%2C%20sans-serif'%20font-size%3D'8.5'%20font-weight%3D'500'%3ESimulate%20exam%3C%2Ftext%3E%3Ctext%20x%3D'0'%20y%3D'23'%20fill%3D'white'%20font-family%3D'Plus%20Jakarta%20Sans%2C%20Arial%2C%20sans-serif'%20font-size%3D'13.5'%20font-weight%3D'700'%3EExam%20Mode%3C%2Ftext%3E%3C%2Fsvg%3E");
}
.sidebar #examModeBtn:hover {
  background: #1db87c !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 20px rgba(26,158,107,.35) !important;
}
.sidebar #examModeBtn:active,
.sidebar #practiceBtn:active {
  transform: scale(.97) !important;
}
.sidebar-close-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 14px 18px 10px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  margin: 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: color 0.15s;
}
.sidebar-close-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.04);
}
.sidebar-close-btn svg {
  flex-shrink: 0;
}
/* ========================== SIDEBAR NAV LINKS ========================== */
.sidebar-nav-links {
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding: 6px 0;
}
.sidebar-nav-link {
  display: flex !important;
  align-items: center;
  justify-content: flex-start !important;
  gap: 10px;
  color: #d1d5db !important;
  padding: 11px 22px !important;
  text-decoration: none !important;
  font-size: 14px !important;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  border-left: 2px solid transparent;
}
.sidebar-nav-link:hover {
  background: rgba(255,255,255,0.06) !important;
  color: #fff !important;
  border-left-color: #4fc3f7;
}
.sidebar-nav-link svg {
  flex-shrink: 0;
  opacity: 0.7;
}
.sidebar-dashboard-link {
  color: #4fc3f7 !important;
  font-weight: 600 !important;
}
.sidebar-dashboard-link svg {
  opacity: 1 !important;
  color: #4fc3f7;
}
.sidebar-dashboard-link:hover {
  background: rgba(79,195,247,0.08) !important;
  border-left-color: #4fc3f7 !important;
}
.sidebar a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  padding: 7px 18px;
  text-decoration: none;
  font-size: 14px;
}
.sidebar a:hover { background: #4CAF50; }
.dropdown-container {
  display: flex;
  flex-direction: column;
  height: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: height 0.24s ease, max-height 0.24s ease, opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  will-change: height, max-height, opacity, transform;
}
.dropdown-container.is-open {
  height: auto;
  max-height: 2200px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  padding-left: 20px;
  background: #0f3460;
}
.dropdown-container a { font-size: 14px; color: #fff; }
.arrow { transition: transform 0.3s; }
.arrow.rotate { transform: rotate(180deg); }

/* ========================== SUBJECT / TOPIC / SUBTOPIC LEVELS ========================== */

/* LEVEL 1 — SUBJECT: bold white, dark navy background */
.sidebar-subject {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: #162447 !important;
  color: #ffffff !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  padding: 9px 16px !important;
  border-left: 3px solid #4fc3f7 !important;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  text-align: left !important;
}
.sidebar-subject:hover {
  background: #1a3060 !important;
  color: #fff !important;
}

/* LEVEL 2 — TOPIC: warm amber/gold on slightly lighter navy */
.practice-subject-heading {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.subject-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  margin-right: 6px;
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.practice-subject-icon {
  min-width: 20px;
}

.practice-subject-label {
  min-width: 0;
}

.topic-container {
  background: #0d1e3a !important;
  padding-left: 0 !important;
}
.sidebar-topic {
  background: #0d1e3a !important;
  color: #fbbf24 !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  padding: 7px 16px 7px 20px !important;
  border-left: 3px solid #f59e0b !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px;
  text-align: left !important;
  width: 100%;
  box-sizing: border-box;
}
.sidebar-topic:hover {
  background: #132240 !important;
  color: #fcd34d !important;
}
.topic-arrow {
  font-size: 10px;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.subject-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 10px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
  transform-origin: center;
}

/* LEVEL 3 — SUBTOPIC: soft teal/cyan on deepest background */
.subtopic-container {
  background: #080f1e !important;
  padding-left: 0 !important;
}
.sidebar-subtopic {
  background: #080f1e !important;
  color: #5eead4 !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  padding: 6px 16px 6px 28px !important;
  border-left: 3px solid #14b8a6 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: left !important;
  width: 100%;
  box-sizing: border-box;
}
.sidebar-subtopic::before {
  content: "›";
  margin-right: 7px;
  color: #14b8a6;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}
.sidebar-subtopic:hover {
  background: #0c1628 !important;
  color: #99f6e4 !important;
}
.topic-arrow.rotate {
  transform: rotate(90deg);
}

.subject-arrow.rotate {
  transform: rotate(90deg);
}

body.practice-modal-open {
  overflow: hidden;
}

.practice-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #f7fbff 0%, #eef4ff 100%);
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateY(100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  overscroll-behavior: contain;
}

.practice-modal.hidden {
  display: none;
}

.practice-modal.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.practice-modal-content {
  min-height: 100%;
  padding: 16px;
  box-sizing: border-box;
}

.practice-modal .modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  margin: -16px -16px 18px;
  background: linear-gradient(135deg, #0d2150 0%, #1f4b99 100%);
  color: #fff;
  box-shadow: 0 10px 28px rgba(13, 33, 80, 0.18);
}

.practice-modal .modal-header h2 {
  margin: 0;
  text-align: left;
  font-size: clamp(1.4rem, 2.8vw, 1.9rem);
  letter-spacing: 0.6px;
}

.close-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.05);
  color: #333;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  appearance: none;
  flex-shrink: 0;
  transition: background 0.2s ease;
  transform: translateY(-0.5px);
}

.close-btn::before {
  content: none;
}

.close-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

.practice-modal .modal-header .close-btn {
  background: rgba(255, 255, 255, 0.92);
  color: #163563;
}

.practice-modal .modal-header .close-btn:hover {
  background: #ffffff;
}

.practice-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 24px;
}

.practice-status {
  padding: 18px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #d7e7f7;
  color: #1f2937;
  text-align: center;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.practice-status--error {
  color: #b42318;
  border-color: #f8d0d4;
  background: #fff5f6;
}

.practice-status--empty {
  color: #475467;
  background: #f8fbff;
}

.practice-subject-section {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #d7e7f7;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.practice-modal .sidebar-subject,
.practice-modal .sidebar-topic,
.practice-modal .sidebar-subtopic {
  width: 100%;
  margin: 0 !important;
  border: none;
  font-family: inherit;
  cursor: pointer;
}

.practice-modal .sidebar-subject {
  padding: 16px 18px !important;
  border-left: none !important;
  background: linear-gradient(135deg, #d8ebff 0%, #c3ddff 100%) !important;
  color: #0D47A1 !important;
  font-weight: 700 !important;
}

.practice-modal .sidebar-subject:hover {
  background: linear-gradient(135deg, #cbe3ff 0%, #b4d4ff 100%) !important;
  color: #0b3f94 !important;
}

.practice-modal .sidebar-subject .subject-arrow {
  color: currentColor;
}

.practice-modal .topic-container {
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}

.practice-modal .topic-container.is-open {
  padding: 0 12px 12px !important;
}

.practice-modal .sidebar-topic {
  margin-top: 12px !important;
  padding: 12px 14px !important;
  border-radius: 12px !important;
  border-left: none !important;
  background: #f9fbff !important;
  border: 1px solid #f2d59a !important;
  color: #b36a00 !important;
}

.practice-modal .sidebar-topic:hover {
  background: #fff7e8 !important;
  color: #9a5800 !important;
}

.practice-modal .subtopic-container {
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}

.practice-modal .subtopic-container.is-open {
  padding: 4px 0 0 !important;
}

.practice-modal .sidebar-subtopic {
  margin-top: 8px !important;
  padding: 12px 14px 12px 18px !important;
  border-radius: 12px !important;
  border-left: none !important;
  background: #ffffff !important;
  border: 1px solid #c5f0ea !important;
  color: #0f766e !important;
}

.practice-modal .sidebar-subtopic:hover {
  background: #f1fffd !important;
  color: #0b5f58 !important;
}

@media (max-width: 768px) {
  .practice-modal {
    width: 100%;
    height: 100%;
  }

  .practice-modal-content {
    padding: 12px;
  }

  .practice-modal .modal-header {
    margin: -12px -12px 16px;
    padding: 16px 12px 12px;
  }

  .practice-modal .sidebar-subject {
    padding: 14px 16px !important;
  }

  .practice-modal .topic-container {
    padding: 0 !important;
  }

  .practice-modal .topic-container.is-open {
    padding: 0 10px 10px !important;
  }

  .practice-modal .sidebar-topic,
  .practice-modal .sidebar-subtopic {
    font-size: 13px !important;
  }
}
/* ========================== Overlay ========================== */
#overlay {
  position: fixed;
  display: none;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.3);
  z-index: 4;
}
.sidebar-companion-holder {
  display: none;
}
@media (min-width: 1200px) {
  .sidebar-companion-holder {
    position: fixed;
    top: 0;
    left: 250px;
    width: 300px;
    min-height: 100vh;
    height: 100vh;
    z-index: 1002;
    background: #ffffff;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.14);
    display: block;
    overflow: hidden;
  }
}
@media (max-width: 1199px) {
  .sidebar-companion-holder {
    display: none !important;
  }
}
/* ========================== Header ========================== */
/* Header container (unchanged except ensuring it's the positioning context) */
/* ============================================================
   HEADER — clean single-row, no absolute-position conflicts
   ============================================================ */
.header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(90deg, #0d2150 0%, #1a3a80 50%, #1565c0 100%);
  box-shadow: 0 2px 12px rgba(0,0,0,0.35);
  z-index: 999;
  border-bottom: 2px solid rgba(79,195,247,0.6);
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Single flex row */
.header-bar {
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 14px;
  gap: 12px;
  box-sizing: border-box;
  width: 100%;
  overflow: visible;
}

/* Hamburger — plain flex, no absolute */
.openbtn {
  flex-shrink: 0;
  position: static;
  transform: none;
  top: auto;
  width: 38px;
  height: 38px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: inherit;
  color: white;
}
.openbtn:hover {
  background: rgba(255,255,255,0.18);
  transform: none;
  box-shadow: none;
}
.openbtn:active { background: rgba(255,255,255,0.28); transform: none; }
.openbtn span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

/* Brand */
.site-title {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  text-decoration: none;
  align-self: stretch;
}
.site-logo {
  width: auto;
  height: 62px;
  max-height: 62px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.55));
}
.brand-text {
  display: flex;
  align-items: baseline;
  transition: opacity 0.3s ease, max-width 0.35s ease;
  overflow: hidden;
  white-space: nowrap;
}
/* Only collapse brand text on mobile when search is active */
@media (max-width: 600px) {
  .header-search-wrap {
    max-width: 140px;
    margin-left: auto;
    flex: unset;
  }
  .header-search-wrap:focus-within {
    max-width: 100%;
    flex: 1;
  }
  .header-bar:has(.header-search-wrap:focus-within) .brand-text {
    opacity: 0;
    max-width: 0;
    pointer-events: none;
  }
}
.main-title {
  font-family: 'Rajdhani', 'Poppins', Arial, sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  line-height: 1;
}
.domain {
  font-family: 'Rajdhani', 'Poppins', Arial, sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #7dd3fc;
  margin-left: 1px;
}

/* Search — desktop: fills available space normally */
.header-search-wrap {
  flex: 1;
  position: relative;
  max-width: 400px;
  margin: 0 auto;
  transition: max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  transform: none !important;
}
.header-search-wrap .srch-ico {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.55;
  display: flex;
}
#searchBox {
  width: 100%;
  height: 36px;
  padding: 0 14px 0 36px;
  background: rgba(255,255,255,0.13);
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 18px;
  color: #fff;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
#searchBox::placeholder { color: rgba(255,255,255,0.5); }
#searchBox:focus {
  background: rgba(255,255,255,0.22);
  border-color: #7dd3fc;
  box-shadow: 0 0 0 3px rgba(125,211,252,0.2);
}
#searchResults,
#noResults {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: white;
  border: 1px solid #ccc;
  max-height: 250px;
  overflow-y: auto;
  z-index: 2000;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
#searchResults {
  display: none;
}
#searchResults .search-result-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  color: #333;
  line-height: 1.45;
}
#searchResults .search-result-item:hover {
  background: #f0f7ff;
}
#noResults {
  padding: 12px 14px;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}
.highlight {
  background-color: rgba(255, 135, 0, 0.25);
  color: #ff8700;
  font-weight: 600;
  border-radius: 4px;
  padding: 1px 3px;
}

/* Right-side actions */
.header-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Language toggle */
.lang-toggle-container {
  position: static;
  transform: none;
  top: auto; left: auto;
  display: flex;
}
.lang-toggle-btn,
.header-top .lang-toggle-btn,
.header-bottom .lang-toggle-btn,
.header .lang-toggle-btn {
  background: rgba(255,255,255,0.12) !important;
  color: #e0f2fe !important;
  border: 1.5px solid rgba(255,255,255,0.28) !important;
  border-radius: 16px !important;
  padding: 5px 12px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s !important;
  white-space: nowrap;
  width: auto !important;
  height: auto !important;
  min-width: unset !important;
  max-width: unset !important;
  min-height: unset !important;
  max-height: unset !important;
  line-height: 1.4 !important;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.lang-toggle-btn:hover {
  background: rgba(125,211,252,0.25) !important;
  border-color: #7dd3fc !important;
  transform: none !important;
}

/* Profile icon */
.header-login-icon {
  position: static;
  top: auto; right: auto;
  transform: none;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s;
}
.header-login-icon:hover { transform: scale(1.08); }
.header-login-icon:active { transform: scale(0.96); }
.header-login-icon img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.45);
  background: #1565c0;
  box-shadow: none;
  transition: border-color 0.2s;
}
.header-login-icon:hover img { border-color: #7dd3fc; box-shadow: none; }
.header-login-icon .fallback-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hide old two-row remnants */
.header-top, .header-bottom { display: none !important; }

/* Responsive */
@media (max-width: 600px) {
  .header-bar { padding: 0 8px; gap: 6px; }
  .main-title { font-size: 17px; letter-spacing: 1px; }
  .lang-toggle-btn,
  .header .lang-toggle-btn {
    display: inline-flex !important;
    padding: 4px 8px !important;
    font-size: 11px !important;
  }
}
/* ========================== Horizontal Menu ========================== */
.header-menu {
  display: none;
}
/* ========================== Marquee ========================== */
.marquee {
  position: fixed;
  top: var(--header-offset, 74px);
  left: 0;
  width: 100%;
  overflow: hidden;
  z-index: 500;
  display: none;
  background: transparent;
  border-top: none;
  border-bottom: none;
  color: #1f2937;
  padding: 0;
  opacity: 1;
  transform: translateY(0);
  transition: transform 0.3s ease, opacity 0.3s ease;
  will-change: transform, opacity;
}
body.home .marquee.is-visible {
  display: block;
}
body.home .marquee.is-visible.is-scroll-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}
.marquee-container {
  overflow: hidden;
  position: relative;
  width: 100%;
  background-color: transparent !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
}
.marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  white-space: nowrap;
  width: max-content;
  will-change: transform;
  animation: marquee-scroll var(--marquee-duration, 36s) linear infinite;
}
.marquee-group {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.marquee-link {
  color: inherit;
  text-decoration: none;
}
.marquee-link:hover {
  color: inherit;
}
.marquee-item:hover {
  opacity: 0.8;
}
.marquee-icon {
  flex-shrink: 0;
}
.marquee-text {
  display: inline-block;
}
.marquee-type-info {
  background-color: #e3f2fd;
  color: #0d47a1;
}
.marquee-type-warning {
  background-color: #fff3cd;
  color: #856404;
}
.marquee-type-success {
  background-color: #d1e7dd;
  color: #0f5132;
}
.marquee-type-urgent {
  background-color: #f8d7da;
  color: #721c24;
}
.marquee-type-promotion {
  background-color: #e8f5e9;
  color: #1b5e20;
}
.marquee-separator {
  opacity: 0.7;
  user-select: none;
}
@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-1 * var(--marquee-loop-distance, 50%))); }
}
.marquee-container:hover .marquee-track {
  animation-play-state: paused;
}
/* ========================== GAP BETWEEN HEADER & CONTENT ========================== */
.main-content {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}

#main {
  margin-top: var(--header-offset, 74px);
  display: flex;
  flex-direction: column;
  gap: 15px;
  flex: 1 0 auto;
  padding: 10px;
}

.mcq-protected-content {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
/* Adjust margin-top when marquee is visible */
body.home #main {
  margin-top: calc(var(--header-offset, 74px) + var(--marquee-offset, 0px));
  transition: margin-top 0.3s ease;
}
/* ======================= MCQ BOX ======================= */
.mcq {
  background-color: #b3e9ff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 15px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  min-height: 140px;
  box-sizing: border-box;
  transition: transform 0.2s ease, background-color 0.2s ease;
  width: 100%;
  max-width: 700px; /* Desktop max width */
  margin-left: auto;
  margin-right: auto;
}
/* Tablet screens */
@media screen and (max-width: 768px) {
  .mcq {
    max-width: 90%; /* almost full width */
    min-height: 120px; /* slightly shorter */
    padding: 10px;
  }
}
/* Mobile screens */
@media screen and (max-width: 480px) {
  .mcq {
    max-width: 95%; /* nearly full screen */
    min-height: 100px; /* shorter box */
    padding: 8px;
  }
}
.mcq p {
  font-weight: bold;
  color: #000;
  font-size: 16px;
  margin-bottom: 12px;
  line-height: 1.5;
}
.mcq label {
  font-weight: bold;
  color: #000;
  background-color: #fff;
  display: block;
  cursor: pointer;
  padding: 8px 10px;
  margin-bottom: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  white-space: normal;
  line-height: 1.4;
  transition: background-color 0.2s;
}
.mcq label:hover { background-color: #f0f0f0; }
.mcq input[type="checkbox"] { margin-right: 8px; }
/* Answer state classes */
.mcq label.correct {
  background-color: #4CAF50;
  color: #fff;
}
.mcq label.correct-blink {
  background-color: #4CAF50;
  color: #fff;
  animation: correctBlink 0.4s ease-in-out 3;
}
.mcq label.wrong {
  background-color: #f44336;
  color: #fff;
}
.mcq label.unattempted {
  background-color: #FFA500;
  color: #000; /* better contrast */
}

@keyframes correctBlink {
  0% {
    background-color: #4CAF50;
    opacity: 1;
  }
  50% {
    background-color: #4CAF50;
    opacity: 0.3;
  }
  100% {
    background-color: #4CAF50;
    opacity: 1;
  }
}
/* ========================== Buttons ========================== */
button.submit-btn {
  margin-left: 10px;
  background-color: #007BFF;
  color: #fff;
  font-weight: bold;
  padding: 8px 14px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s ease;
}
button.submit-btn:hover { background-color: #0056b3; }
/* ========================== Pagination ========================== */
/* ======================= PAGINATION PERFECT CENTERING FIX ======================= */
.pagination {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    margin-top: 20px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 !important; /* Remove all padding */
    gap: 10px !important;
}
/* Navigation row - perfect centering */
.pagination > div:first-of-type {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    margin-bottom: 0 !important;
    box-sizing: border-box !important;
    padding: 0 !important;
}
/* Exam buttons perfect centering */
.pagination .btn-blue,
.pagination .btn-red {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
    width: 80% !important;
    max-width: 400px !important;
}
/* Force all pagination buttons to have consistent styling and centering */
.pagination button {
    margin: 0 !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
}
/* Ensure anchor elements inside pagination match button layout and appearance */
.pagination a,
.pagination a.btn-green,
.pagination a.btn-blue,
.pagination a.btn-red,
.pagination span.btn-green {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  text-decoration: none !important;
  color: inherit !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}
/* Specific styling for navigation buttons */
.pagination .btn-green {
    min-width: 120px !important;
    height: 40px !important;
}

/* Question Bank numbered page boxes - UI only */
.numbered-pagination {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 12px 0 18px !important;
}

.numbered-pagination .btn-green.page-number,
.numbered-pagination .page-number {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 2.5rem !important;
    width: auto !important;
    height: 2.5rem !important;
    padding: 0.45rem 0.8rem !important;
    border: 1px solid #1f8f57 !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    color: #0d5d30 !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease !important;
}

.numbered-pagination .btn-green.page-number:hover,
.numbered-pagination .page-number:hover,
.numbered-pagination .btn-green.page-number:focus-visible,
.numbered-pagination .page-number:focus-visible {
    background: #eaf8f1 !important;
    border-color: #0d5d30 !important;
    color: #0d5d30 !important;
    text-decoration: none !important;
    outline: none !important;
}

.numbered-pagination .btn-green.page-number.current-page,
.numbered-pagination .page-number.current-page {
    background: #1f8f57 !important;
    border-color: #1f8f57 !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 2px rgba(31, 143, 87, 0.12) !important;
}

.numbered-pagination .btn-green.page-number.current-page:hover,
.numbered-pagination .page-number.current-page:hover,
.numbered-pagination .btn-green.page-number.current-page:focus-visible,
.numbered-pagination .page-number.current-page:focus-visible {
    background: #1f8f57 !important;
    border-color: #1f8f57 !important;
    color: #ffffff !important;
}

.numbered-pagination .pagination-ellipsis {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 1.2rem !important;
    height: 2.5rem !important;
    padding: 0 0.3rem !important;
    color: #456 !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    user-select: none !important;
}

@media screen and (max-width: 480px) {
    .numbered-pagination {
        gap: 6px !important;
        margin: 10px 0 16px !important;
    }

    .numbered-pagination .btn-green.page-number,
    .numbered-pagination .page-number,
    .numbered-pagination .pagination-ellipsis {
        min-width: 2.1rem !important;
        height: 2.1rem !important;
        padding: 0.28rem 0.55rem !important;
        border-radius: 7px !important;
        font-size: 0.85rem !important;
    }
}
/* Chrome-specific centering fix */
@media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution: .001dpcm) {
    .pagination {
        align-items: center !important;
        justify-content: center !important;
    }
   
    .pagination > div:first-of-type {
        justify-content: center !important;
    }
}
/* Ad container perfect centering */
.ad-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin: 20px 0 !important;
    box-sizing: border-box !important;
    padding: 0 !important;
}
.ad-holder {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}
/* Ensure main content area doesn't interfere with pagination centering */
#main {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
/* Mobile responsive adjustments - keep existing good behavior */
@media screen and (max-width: 768px) {
    .pagination {
        padding: 0 10px !important;
    }
   
    .pagination .btn-green {
        min-width: 100px !important;
    }
   
    .pagination .btn-blue,
    .pagination .btn-red {
        width: 90% !important;
    }
}
@media screen and (max-width: 480px) {
    .pagination {
        padding: 0 5px !important;
    }
   
    .pagination .btn-green {
        min-width: 90px !important;
        font-size: 14px !important;
        padding: 6px 10px !important;
    }
   
    .pagination .btn-blue,
    .pagination .btn-red {
        width: 95% !important;
    }
}
/* ========================== Exam Popup ========================== */
.exam-popup {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  overflow: auto;
}
.exam-popup.active {
  display: flex;
}
.exam-popup-content {
  background: #e6f3fa;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  border-radius: 8px;
  padding: 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.exam-popup-content > .close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  z-index: 10;
}
.exam-popup-heading-block {
  padding: 6px 40px 0 32px;
}
.exam-popup-heading-block h2 {
  margin: 0;
}
.exam-popup-heading-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.exam-popup-heading-actions .exam-heading-control {
  justify-content: center;
}
.exam-settings-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 14px;
  border: 1px solid #bfd8e6;
  border-radius: 999px;
  background: #ffffff;
  color: #0b5ed7;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(13, 110, 253, 0.12);
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.exam-settings-trigger:hover {
  background: #f5faff;
  border-color: #8fc2ff;
  box-shadow: 0 10px 22px rgba(13, 110, 253, 0.16);
  transform: translateY(-1px);
}
.exam-settings-trigger:focus-visible {
  outline: none;
  border-color: #8fc2ff;
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.18);
}
.exam-settings-trigger svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}
.exam-reset-trigger[data-subject-toggle-state="restore"] {
  border-color: #c7d2fe;
  color: #4338ca;
  box-shadow: 0 8px 18px rgba(67, 56, 202, 0.14);
}
.exam-reset-trigger[data-subject-toggle-state="restore"]:hover {
  background: #f5f3ff;
  border-color: #a5b4fc;
  box-shadow: 0 10px 22px rgba(67, 56, 202, 0.18);
}
.exam-reset-trigger {
  border-color: #f2c8cf;
  color: #b4233c;
  box-shadow: 0 8px 18px rgba(180, 35, 60, 0.12);
}
.exam-reset-trigger:hover {
  background: #fff6f7;
  border-color: #e6a4af;
  box-shadow: 0 10px 22px rgba(180, 35, 60, 0.18);
}
.exam-reset-trigger:focus-visible {
  border-color: #e08b98;
  box-shadow: 0 0 0 4px rgba(180, 35, 60, 0.18);
}
.exam-settings-popup {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(11, 31, 58, 0.28);
  border-radius: 8px;
  z-index: 20;
}
.exam-settings-popup:not([hidden]) {
  display: flex;
}
.exam-settings-popup-card {
  width: min(100%, 340px);
  padding: 16px;
  border-radius: 14px;
  border: 1px solid #dbe7ef;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
}
.exam-settings-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.exam-settings-popup-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #0b1f3a;
}
.exam-settings-popup-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 1px solid #dbe7ef;
  border-radius: 999px;
  background: #f8fbff;
  color: #516071;
  font-size: 20px;
  line-height: 1;
}
.exam-settings-popup-close:hover {
  background: #eef5ff;
  color: #0b5ed7;
}
.exam-settings-popup-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.exam-settings-popup-body .setting-btn {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
}
.exam-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.exam-action-row .setting-btn,
.exam-action-row .start-exam-btn {
  margin: 0;
}
.exam-action-row .exam-reset-btn {
  display: none;
}
.exam-action-row .start-exam-btn,
.exam-action-row .btn-green.start-exam {
  flex: 1 1 auto;
  width: auto;
  max-width: none;
}
.exam-subject {
  margin-bottom: 15px;
  border-bottom: 1px solid #dddddd;
  padding-bottom: 15px;
}
.subject-header {
  font-weight: bold;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 5px;
  transition: background 0.3s;
}
.subject-header:hover { background: #e9ecef; }
.subject-header .arrow { transition: transform 0.3s; }
.subject-header .arrow.rotate { transform: rotate(180deg); }
.subtopics-container {
  display: none;
  flex-direction: column;
  margin-top: 10px;
  padding-left: 20px;
}
.subtopic {
  display: flex;
  align-items: center;
  margin: 5px 0;
  padding: 5px;
}
.subtopic label {
  display: flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
}
.subtopic input[type="checkbox"] { margin-right: 8px; }
.start-exam-btn {
  margin-top: 10px;
  padding: 8px 16px;
  background: #28a745;
  color: #fff;
  border-radius: 6px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: 0.3s;
}
.start-exam-btn:hover { background: #218838; }
.exam-error {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: #f44336;
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.5s;
  z-index: 2100;
}
/* ======================= Timer & Page Info ======================= */
/* ======================= PAGE INFO & TIMER ALIGNMENT FIX ======================= */
.page-info {
    width: 100%;
    max-width: 700px; /* Match MCQ box max-width */
    margin: 0 auto 15px auto;
    box-sizing: border-box;
    padding: 0 12px; /* Match MCQ box padding */
}
.page-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 5px; /* Reduced from 10px to 5px */
    width: 100%;
    box-sizing: border-box;
}
/* Ensure proper text alignment and prevent cutoff */
.page-info-row > div {
    flex: 1;
    min-width: 0; /* Prevent flex items from overflowing */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.page-info-row > div:first-child {
    text-align: left;
    padding-right: 2px; /* Reduced from 5px */
}
.page-info-row > div:last-child {
    text-align: right;
    padding-left: 2px; /* Reduced from 5px */
}
/* Mobile responsiveness */
@media screen and (max-width: 768px) {
    .page-info {
        max-width: 90%; /* Match MCQ box mobile width */
        padding: 0 10px; /* Match MCQ box mobile padding */
    }
   
    .page-info-row {
        font-size: 14px; /* Slightly smaller on mobile */
        gap: 3px; /* Even smaller gap on mobile */
    }
}
@media screen and (max-width: 480px) {
    .page-info {
        max-width: 95%; /* Match MCQ box mobile width */
        padding: 0 8px; /* Match MCQ box mobile padding */
    }
   
    .page-info-row {
        font-size: 13px; /* Even smaller on very small screens */
        gap: 2px; /* Minimal gap on very small screens */
    }
   
    .exam-timer {
        font-size: 12px; /* Ensure timer text fits */
    }
}
/* Specific fix for timer to prevent cutoff */
.exam-timer {
    font-family: monospace;
    font-weight: 700;
    letter-spacing: -0.5px; /* Slightly tighter letter spacing */
}
/* ======================= Exam Mode ======================= */
body.exam-mode {
  background-color: #e9fff0;
}
/* MCQ boxes in exam mode */
body.exam-mode .mcq {
  background-color: #b3e9ff; /* Same as normal mode */
  border: 1px solid #dddddd;
}
/* Timer, page-info, pagination, scoreboard follow the page bg */
body.exam-mode .page-info,
body.exam-mode .exam-timer,
body.exam-mode .pagination {
  background: transparent !important;
  box-shadow: none !important;
}
/* ======================= Exam Buttons ======================= */
.btn-blue {
  background-color: #007bff; /* Bright Blue */
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.2s;
}
.btn-blue:hover {
  background-color: #0056b3; /* Darker blue on hover */
}
.btn-red {
  background-color: #f44336; /* Red */
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.2s;
}
.btn-red:hover {
  background-color: #c62828; /* Darker red on hover */
}
/* Ensure green buttons for Next/Previous */
.btn-green {
  background-color: #4CAF50; /* Green */
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.2s;
}
.btn-green:hover {
  background-color: #45a049; /* Darker green on hover */
}
.btn-green:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}
/* ========================== Responsive ========================== */
@media (min-width: 768px) {
  .mcq { width: 700px; margin: 0 auto; }
}
@media screen and (max-width: 768px) {
  .sidebar a, .dropdown-container a { font-size: 13px; padding: 7px 15px; }
  #searchBox { max-width: 220px; }
  .mcq { width: 95%; }
  .subtopics-container { padding-left: 10px; }
  .subject-header { padding: 8px; }
}
@media screen and (max-width: 480px) {
  #searchBox { max-width: 180px; }
  .mcq { width: 100%; padding: 10px; }
}
/* ======================= Setting Buttons ======================= */
.setting-btn {
  padding: 8px 12px;
  background-color: #6c757d;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s;
  flex: 1;
  min-width: 80px;
}
.setting-btn:hover {
  background-color: #5a6268;
}
.start-exam-btn {
  padding: 10px 20px;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s;
  width: 100%;
  max-width: 200px;
  margin: 0 auto;
}
.start-exam-btn:hover {
  background-color: #218838;
}
/* Responsive adjustments for marquee */
@media screen and (max-width: 768px) {
  .marquee {
    padding: 0;
  }
  .marquee-item {
    font-size: 13px;
    font-weight: 600;
  }
}
.lang-hindi .marquee-track {
    font-family: Arial, "Nirmala UI", "Mangal", sans-serif;
}
.marquee-item-lang-hi,
.marquee-text[lang="hi"] {
    font-family: Arial, "Nirmala UI", "Mangal", sans-serif;
}
@media (prefers-reduced-motion: reduce) {
  .marquee {
    transition: none;
  }
  body.home #main {
    transition: none;
  }
}
/* Explanation Button and Box */
.explain-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #6c757d;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  z-index: 10;
}
.explain-btn:hover {
  background-color: #5a6268;
}
.explanation-box {
  height: 0; /* collapsed by default */
  max-height: 0; /* collapsed by default */
  overflow-y: auto; /* vertical scroll */
  overflow-x: hidden; /* prevent horizontal scroll */
  background-color: #f8f9fa;
  border-left: 4px solid #007bff;
  margin-top: 10px;
  padding: 0 15px;
  box-sizing: border-box;
  word-wrap: break-word; /* wrap long words */
  word-break: break-word; /* break super long words */
  white-space: normal; /* normal wrapping */
  transition: max-height 0.3s ease;
  width: 100%; /* ensure fixed width */
  max-width: 100%; /* don't overflow container */
}
.explanation-box.open {
  height: 200px; /* fixed height */
  max-height: 200px; /* fixed height */
  padding: 15px;
  overflow-y: auto; /* scroll when content overflows vertically */
  overflow-x: hidden; /* prevent horizontal expansion */
}
.explanation-content {
  white-space: pre-line;
  line-height: 1.5;
}
/* Make MCQ boxes relative for positioning the explain button */
.mcq {
  position: relative;
  padding-top: 35px; /* Make space for the explain button */
}
/* ======================= UNIFIED SPINNER SYSTEM ======================= */
/* Base spinner — reused by all size variants */
.loading,
.spinner-loader {
  display: inline-block;
  border-radius: 50%;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.15);
  border-top-color: #007bff;
  animation: spin 0.85s ease-in-out infinite;
  flex-shrink: 0;
}

/* Small  – explanation box (original size) */
.loading {
  width: 20px;
  height: 20px;
  border-width: 3px;
}

/* Medium – sidebar */
.spinner-loader {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

/* Large  – practice / exam main content area */
.spinner-loader--lg {
  width: 44px;
  height: 44px;
  border-width: 4px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Centering wrappers */
.spinner-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 30px 0;
  box-sizing: border-box;
}

/* Sidebar-specific: fill the available sidebar height */
.spinner-wrapper--sidebar {
  height: 100%;
  min-height: 120px;
  padding: 0;
}

/* Full-screen center for practice/exam main area */
.spinner-wrapper--fullpage {
  min-height: 220px;
}

/* ======================= TWO-PHASE PRACTICE LOADER ======================= */
.practice-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 40px 20px;
  gap: 18px;
  box-sizing: border-box;
  width: 100%;
}

.practice-loader__status {
  font-size: 14px;
  color: #555;
  letter-spacing: 0.02em;
  min-height: 20px;
  transition: opacity 0.2s ease;
}

/* Determinate progress track — hidden until phase 2 */
.practice-loader__track {
  width: min(280px, 80%);
  height: 4px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 99px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.practice-loader__track.visible {
  opacity: 1;
}

.practice-loader__fill {
  height: 100%;
  width: 0%;
  background: #007bff;
  border-radius: 99px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Explanation Box with Scroll */
.explanation-box {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background-color: #f8f9fa;
  border-left: 4px solid #007bff;
  margin-top: 10px;
  padding: 0 15px;
}
.explanation-box.open {
  max-height: 200px; /* Reduced height to ensure scrolling */
  padding: 15px;
  margin-bottom: 8px;
  overflow-y: auto; /* Enable vertical scrolling */
}
/* Custom scrollbar styling */
.explanation-box.open::-webkit-scrollbar {
  width: 8px;
}
.explanation-box.open::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}
.explanation-box.open::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}
.explanation-box.open::-webkit-scrollbar-thumb:hover {
  background: #555;
}
.explanation-box[data-panel-type="details"] {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  border-left-color: #94a3b8;
}
.explanation-box.open[data-panel-type="details"] {
  padding: 10px;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.65) rgba(241, 245, 249, 0.8);
}
.question-details-panel {
  width: 100%;
  min-width: 0;
}
.question-details-table-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.question-details-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.15;
  color: #0f172a;
}
.question-details-table th,
.question-details-table td {
  padding: 7px 10px;
  white-space: nowrap;
  vertical-align: middle;
  border-right: 1px solid rgba(148, 163, 184, 0.18);
}
.question-details-table thead th {
  background: rgba(248, 250, 252, 0.96);
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}
.question-details-table tbody td {
  background: rgba(255, 255, 255, 0.85);
  color: #0f172a;
  font-weight: 500;
}
.question-details-table tbody tr:nth-child(even) td {
  background: rgba(248, 250, 252, 0.8);
}
.question-details-table tbody tr + tr td {
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}
.question-details-table th:last-child,
.question-details-table td:last-child {
  border-right: 0;
}
.question-details-table th:first-child,
.question-details-table td:first-child {
  text-align: center;
  width: 1%;
}
.question-details-table th:nth-child(3),
.question-details-table td:nth-child(3),
.question-details-table th:nth-child(4),
.question-details-table td:nth-child(4),
.question-details-table th:nth-child(5),
.question-details-table td:nth-child(5),
.question-details-table th:nth-child(6),
.question-details-table td:nth-child(6) {
  text-align: center;
}
.question-details-empty-state {
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}
@media screen and (max-width: 768px) {
  .question-details-table {
    font-size: 11px;
  }

  .question-details-table th,
  .question-details-table td {
    padding: 6px 8px;
  }
}
@media screen and (max-width: 480px) {
  .question-details-table {
    font-size: 10.5px;
  }

  .question-details-table th,
  .question-details-table td {
    padding: 5px 6px;
  }

  .question-details-table-scroll,
  .question-details-empty-state {
    border-radius: 10px;
  }
}
/* ======================= AD CONTAINER ======================= */
.ad-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 20px 0;
}
.ad-holder {
    width: 100%;
    max-width: 300px;
    height: 250px; /* Fixed height for desktop */
    background-color: #f5f5f5;
    border: 1px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}
.ad-content {
    text-align: center;
    color: #888;
}
.ad-content p:first-child {
    font-size: 12px;
    margin-bottom: 5px;
    color: #666;
}
.ad-placeholder {
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        #f0f0f0,
        #f0f0f0 10px,
        #e0e0e0 10px,
        #e0e0e0 20px
    );
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}
  /* Keep the interstitial wrapper wide enough for responsive ad units. */
.study-mode-top-banner {
  width: 100%;
  min-height: 112px;
  padding: 10px 0 0;
  box-sizing: border-box;
}
.study-mode-top-banner .ad-slot-wrapper {
  width: 100%;
  max-width: 728px;
  margin: 0 auto;
  box-sizing: border-box;
}
.study-mode-top-banner .ad-container {
  width: 100%;
  min-height: 100px;
  margin: 0;
}
.study-mode-top-banner .ad-holder {
  width: 100%;
  max-width: 728px;
  height: 90px;
}
.study-mode-top-banner .ad-content,
.study-mode-top-banner .ad-placeholder {
  width: 100%;
}
@media (max-width: 600px) {
  .study-mode-top-banner {
    min-height: 92px;
    padding-top: 8px;
  }
  .study-mode-top-banner .ad-container {
    min-height: 76px;
  }
  .study-mode-top-banner .ad-holder {
    height: 60px;
    min-height: 60px;
  }
}
  #main > .ad-slot-wrapper[data-ad-slot="in-content"] {
    width: 100%;
    max-width: 728px;
    box-sizing: border-box;
  }
  #main > .ad-slot-wrapper[data-ad-slot="in-content"] .ad-container {
    width: 100%;
    max-width: 100%;
  }
  #main > .ad-slot-wrapper[data-ad-slot="in-content"] .ad-holder {
    width: 100%;
    max-width: 728px;
    height: auto;
    min-height: 250px;
  }
  #main > .ad-slot-wrapper[data-ad-slot="in-content"] .ad-content {
    width: 100%;
  }
  #main > .ad-slot-wrapper[data-ad-slot="in-content"] .ad-placeholder {
    min-height: 250px;
    height: auto;
  }
/* For mobile devices, we can adjust the height if needed */
@media screen and (max-width: 480px) {
    .ad-holder {
        height: 200px; /* Slightly smaller on mobile */
    }

    #main > .ad-slot-wrapper[data-ad-slot="in-content"] .ad-holder {
      min-height: 200px;
    }

    #main > .ad-slot-wrapper[data-ad-slot="in-content"] .ad-placeholder {
      min-height: 200px;
    }
}
/* ======================= Setting Buttons - Mobile Fix ======================= */
.setting-buttons-row {
    display: flex;
    flex-wrap: wrap; /* allow wrapping */
    gap: 8px; /* spacing between buttons */
    justify-content: center; /* keep centered even if last moves down */
    width: 100%;
}
.setting-btn {
    flex: 0 0 auto; /* don't stretch */
    width: auto; /* natural width */
    min-width: 100px; /* consistent minimum */
    max-width: 120px; /* consistent maximum */
    padding: 8px 12px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
    text-align: center;
    white-space: nowrap; /* prevent breaking text */
}
.setting-btn:hover {
    background-color: #5a6268;
}
/* Small tablet screens */
@media screen and (max-width: 768px) {
    .setting-buttons-row {
        justify-content: center; /* center buttons if wrap occurs */
    }
}
/* Very small mobile */
@media screen and (max-width: 480px) {
    .setting-btn {
        min-width: 90px; /* allow slightly smaller */
        max-width: 110px;
    }
}
/* Start Exam row */
.start-exam-row {
  width: 100%;
  margin-top: 10px;
}
/* Make Start Exam button full width */
.btn-green.start-exam {
  display: block;
  width: 100%;
  max-width: none;
}
@media screen and (max-width: 480px) {
  .exam-popup-heading-block {
    padding-left: 24px;
    padding-right: 24px;
  }
  .exam-popup-heading-actions {
    justify-content: center;
  }
  .exam-popup-heading-actions .exam-heading-control {
    flex: 1 1 140px;
    width: auto;
    min-width: 0;
  }
  .exam-settings-trigger {
    width: 100%;
    justify-content: center;
  }
}
/* ======================= HINDI LANGUAGE SUPPORT ======================= */
.lang-hindi {
    font-family: Arial, "Nirmala UI", "Mangal", sans-serif;
}
/* Keep Poppins font specifically for the header title in Hindi mode */
.lang-hindi .header-top h1 {
    font-family: 'Poppins', Arial, sans-serif !important; /* Force Poppins for header */
}
.lang-hindi .sidebar a,
.lang-hindi #practiceBtn,
.lang-hindi .practice-modal .modal-header h2,
.lang-hindi .practice-modal .sidebar-subject,
.lang-hindi .practice-modal .sidebar-topic,
.lang-hindi .practice-modal .sidebar-subtopic,
.lang-hindi .header-menu button,
.lang-hindi .mcq p,
.lang-hindi .mcq label {
    font-family: Arial, "Nirmala UI", "Mangal", sans-serif;
}
.lang-hindi .sidebar #examModeBtn,
.lang-hindi .sidebar #practiceBtn {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}
/* ======================= SIDEBAR FOOTER & AUTH ======================= */
/* ======================= SIDEBAR FOOTER & AUTH ======================= */
.sidebar-footer {
  margin-top: auto;
  width: 100%;
  background: #1a1a2e;
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 12px 16px;
  text-align: center;
  box-sizing: border-box;
}

.sidebar-footer .login-btn,
.sidebar-footer .signup-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex-shrink: 0;
  padding: 9px 0;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: transform 0.2s, box-shadow 0.2s;
}
.sidebar-footer .login-btn {
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  color: white;
}
.sidebar-footer .login-btn:hover {
  transform: translateY(-2px); /* Only move up on hover */
  box-shadow: 0 5px 12px rgba(37,117,252,0.4);
}
.sidebar-footer .signup-btn {
  background: #4CAF50;
  color: white;
  border: 2px solid #4CAF50;
}
.sidebar-footer .signup-btn:hover {
  background: #45a049;
  border-color: #45a049;
  transform: translateY(-2px); /* Only move up on hover */
}
/* ======================= HEADER AUTH BUTTONS ======================= */
.header-auth-buttons {
  position: absolute; /* fixed relative to header */
  right: 15px; /* distance from right edge */
  top: 50%; /* vertically center with header */
  transform: translateY(-50%);
  display: flex;
  gap: 10px;
  z-index: 1001; /* above sidebar */
}
.header-auth-buttons .login-btn,
.header-auth-buttons .signup-btn {
  padding: 6px 14px;
  font-size: 14px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}
.header-auth-buttons .login-btn {
  background: transparent;
  color: #fff;
  border: 2px solid #4CAF50;
}
.header-auth-buttons .login-btn:hover {
  background: #4CAF50;
  color: white;
  transform: translateY(-2px);
}
.header-auth-buttons .signup-btn {
  background: #4CAF50;
  color: white;
  border: 2px solid #4CAF50;
}
.header-auth-buttons .signup-btn:hover {
  background: #45a049;
  border-color: #45a049;
  transform: translateY(-2px);
}
/* Auth Forms */
.auth-forms {
  padding: 15px 25px 0;
  border-top: 1px solid #444;
  margin-top: 15px;
}
.auth-form h4 {
  color: #fff;
  margin-bottom: 15px;
  text-align: center;
  font-size: 16px;
}
.auth-input {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #555;
  border-radius: 4px;
  background: #2d3748;
  color: #fff;
  font-size: 14px;
  box-sizing: border-box;
}
.auth-input:focus {
  outline: none;
  border-color: #4CAF50;
  background: #374151;
}
.auth-input::placeholder {
  color: #a0aec0;
}
.auth-submit-btn {
  width: 100%;
  padding: 10px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
  margin-bottom: 10px;
}
.auth-submit-btn:hover {
  background: #45a049;
}
.auth-switch {
  color: #a0aec0;
  font-size: 12px;
  text-align: center;
  margin: 0;
}
.auth-switch span {
  color: #4CAF50;
  cursor: pointer;
  text-decoration: underline;
  font-weight: 600;
}
.auth-switch span:hover {
  color: #45a049;
}
/* Form transitions */
.auth-form {
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
/* Responsive adjustments */
@media screen and (max-width: 768px) {
  .auth-buttons {
      padding: 0 20px;
  }
  .auth-btn {
      padding: 8px 12px;
      font-size: 13px;
  }
  .auth-forms {
      padding: 15px 20px 0;
  }
  /* Header buttons responsive */
  .header-auth-buttons {
      right: 10px;
      gap: 6px;
  }
  .header-auth-buttons .login-btn,
  .header-auth-buttons .signup-btn {
      padding: 5px 10px;
      font-size: 13px;
  }
}
/* ======================= MODE HEADINGS ======================= */
.mode-heading {
    text-align: center;
    color: black;
    font-weight: bold;
    margin-bottom: 25px; /* Increased bottom margin */
    margin-top: 0;
    font-size: 1.8em; /* Slightly larger font */
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    padding: 15px 0; /* Added padding for more spacing */
    border-bottom: 2px solid #000000; /* Added subtle border for separation */
    width: 100%;
    max-width: 700px; /* Match MCQ container width */
    margin-left: auto;
    margin-right: auto;
}
.question-bank-heading {
    display: block;
    width: 100%;
    max-width: 700px;
    box-sizing: border-box;
    padding: 15px 12px;
    margin: 0 auto 15px auto;
    border-bottom: 2px solid #000000;
}
@media screen and (max-width: 768px) {
    .question-bank-heading {
        max-width: 90%;
        padding: 12px 10px;
    }
}
@media screen and (max-width: 480px) {
    .question-bank-heading {
        max-width: 95%;
        padding: 10px 8px;
    }
}
/* ======================= PROGRESS BAR ======================= */
.progress-container {
    width: 80%;
    max-width: 700px; /* Same as MCQ container */
    height: 12px;
    background-color: #e0e0e0;
    border-radius: 10px;
    margin: 0 auto 20px auto;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}
.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #007BFF, #0056b3);
    border-radius: 10px;
    transition: width 0.5s ease-in-out;
    position: relative;
}
.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 15px 15px;
    animation: moveStripes 2s linear infinite;
}
@keyframes moveStripes {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 15px 0;
    }
}
.progress-text {
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    color: #007BFF;
    margin-top: 5px;
    margin-bottom: 25px; /* Increased bottom margin */
}
/* Mobile responsiveness */
@media screen and (max-width: 768px) {
    .progress-container {
        width: 90%;
        max-width: 95%; /* Nearly full width on mobile */
    }
   
    .mode-heading {
        margin-top: 0;
        font-size: 1.5em; /* Slightly smaller on mobile */
        padding: 12px 0; /* Adjusted padding for mobile */
    }
}
/* ======================= BACKGROUND MODES ======================= */
/* Ensure normal and exam modes don't use notice board colors */
body:not(.home) #main {
    background-color: transparent !important;
}
/* Normal mode background */
body:not(.home):not(.exam-mode) #main {
    background-color: #f5f5f5 !important;
}
/* Exam mode background */
body.exam-mode #main {
    background-color: #e9fff0 !important;
}
/* ===== Fix pagination cut on mobile ===== */
.pagination {
  width: 95%;
  max-width: 900px;
  box-sizing: border-box;
  padding: 0 10px; /* adds little breathing space from sides */
}
/* ======================= EXAM HELP BUTTON ======================= */
.help-btn {
  position: absolute;
  top: 12px; /* Adjusted for better alignment with smaller size */
  left: 15px;
  width: 24px; /* Reduced from 30px */
  height: 24px; /* Reduced from 30px */
  background-color: #000000;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 14px; /* Reduced from 18px */
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;
  line-height: 1;
  padding: 0;
  margin: 0;
}
.help-btn:hover {
  background-color: #0056b3;
  transform: scale(1.1);
}
/* Mobile responsive adjustments for smaller buttons */
@media screen and (max-width: 768px) {
  .help-btn {
    width: 22px; /* Slightly smaller on mobile */
    height: 22px;
    font-size: 13px;
    top: 11px; /* Adjust top position for mobile */
    left: 12px;
  }
}
@media screen and (max-width: 480px) {
  .help-btn {
    width: 20px; /* Even smaller on very small screens */
    height: 20px;
    font-size: 12px;
    top: 10px;
    left: 10px;
  }
}
/* ======================= EXAM HELP MODAL ======================= */
#examHelpModal.modal {
  z-index: 2100; /* Higher than exam popup (2000) */
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7); /* Darker overlay */
  justify-content: center;
  align-items: center;
  overflow: hidden; /* ✅ Prevent outer scroll */
}
#examHelpModal .modal-content {
  background-color: #fff;
  margin: 0 auto;
  padding: 0;
  border-radius: 10px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  position: relative;
  top: 0;
  transform: none;
  overflow: hidden; /* ✅ Prevent scrollbars on modal box itself */
  display: flex;
  flex-direction: column;
}
/* Ensure exam popup stays below help modal */
.exam-popup {
  z-index: 2000;
}
/* ======================= HELP CONTENT ======================= */
.help-container {
  padding: 20px;
  max-height: calc(80vh - 40px); /* ✅ Keep within modal space */
  overflow-y: auto; /* ✅ Only inner scroll */
  flex: 1; /* ✅ Take up remaining space inside modal */
}
.help-tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid #ddd;
  flex-shrink: 0; /* ✅ Prevent collapsing on small screens */
}
.help-content {
  display: none;
  flex: 1; /* ✅ Let content expand */
  overflow: hidden; /* ✅ Prevent unwanted double scroll */
}
.help-content.active {
  display: flex; /* ✅ Better layout control */
  flex-direction: column;
}
/* ======================= INSTRUCTION CONTENT ======================= */
.instruction-content {
  flex: 1;
  overflow-y: auto; /* ✅ Scroll only inside this area */
  padding-right: 10px;
}
.instruction-content h4 {
  color: #007bff;
  margin-bottom: 15px;
  border-bottom: 2px solid #007bff;
  padding-bottom: 5px;
}
.instruction-content ul {
  list-style-type: none;
  padding-left: 0;
}
.instruction-content li {
  margin-bottom: 12px;
  padding-left: 20px;
  position: relative;
  line-height: 1.5;
}
.instruction-content li:before {
  content: "•";
  color: #007bff;
  font-weight: bold;
  position: absolute;
  left: 0;
}
.instruction-content ul ul {
  margin-top: 8px;
  margin-left: 20px;
}
.instruction-content ul ul li:before {
  content: "◦";
  color: #28a745;
}
/* ======================= HINDI CONTENT ======================= */
#hindiHelp h3,
#hindiHelp h4,
#hindiHelp .instruction-content li {
  font-family: Arial, "Nirmala UI", "Mangal", sans-serif;
}
/* ======================= FOOTER FIX ======================= */
.site-footer {
  background: linear-gradient(90deg, #0d2150 0%, #1a3a80 50%, #1565c0 100%) !important;
  color: #fff;
  text-align: center;
  padding: 20px 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  border-top: 2px solid rgba(79,195,247,0.6) !important;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.35);
  position: relative;
  left: 0;
  right: 0;
  margin-top: auto !important;
  flex-shrink: 0;
}
.footer-content {
  max-width: 100% !important;
  margin: 0 auto !important;
  padding: 0 15px !important;
  box-sizing: border-box !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
}
.footer-link {
  position: relative;
  display: inline-block;
  color: #fff;
  text-decoration: none;
  padding-bottom: 2px;
}
.footer-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background-color: currentColor;
  transition: width 0.3s ease;
}
.footer-link:hover::after,
.footer-link:focus-visible::after {
  width: 100%;
}
.footer-link:focus-visible {
  outline: 2px solid rgba(255,255,255,0.72);
  outline-offset: 4px;
  border-radius: 3px;
}
.footer-copy {
  text-align: center;
  line-height: 1.5;
}
/* Ensure no horizontal overflow on body */
body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}
/* Make sure header matches the width */
.header {
  width: 100% !important;
  max-width: 100% !important;
  left: 0 !important;
  right: 0 !important;
}
/* Ensure main content area doesn't cause overflow */
#main {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
/* Mobile-specific fixes */
@media screen and (max-width: 768px) {
  .site-footer {
    padding: 15px 0 !important;
    width: 100vw !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    left: 0 !important;
  }
 
  .footer-content {
    padding: 0 10px !important;
    word-wrap: break-word;
  }
 
  .footer-links {
    gap: 6px 14px;
  }

  .footer-link {
    font-size: 14px;
  }
}
@media screen and (max-width: 480px) {
  .site-footer {
    padding: 12px 0 !important;
  }
 
  .footer-content {
    padding: 0 8px !important;
  }
 
  .footer-links {
    gap: 6px 10px;
  }

  .footer-link {
    font-size: 13px;
  }
}
/* ======================= LOGIN MODAL CENTERING FIX ======================= */
#loginModal.modal {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  overflow: auto;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#loginModal.modal.login-modal--open {
  display: flex;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
#loginModal .modal-content {
  background-color: #fff;
  padding: 0;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  position: relative;
  /* Center fix: Remove transforms, margins */
  margin: 0;
  top: 0;
  transform: none;
}
/* Coming soon message styling */
.coming-soon-message {
  text-align: center;
  margin-top: 20px;
  padding: 15px;
  background-color: #e7f3ff;
  border-radius: 8px;
  border-left: 4px solid #007bff;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
}
.coming-soon-message strong {
  color: #007bff;
  display: block;
  margin-bottom: 5px;
  font-size: 15px;
}
/* Ensure proper modal backdrop */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  overflow: auto;
}
.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 0;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  position: relative;
}
/* Ensure login modal appears on top */
#loginModal {
  display: none;
  position: fixed;
  z-index: 1001; /* Higher than other modals */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#loginModal.login-modal--open {
  display: flex !important;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
/* Remove any conflicting transforms */
#loginModal .modal-content {
  transform: none !important;
}
/* ======================= BREADCRUMB NAVIGATION ======================= */
nav[aria-label="Breadcrumb"] ol.breadcrumb {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}
nav[aria-label="Breadcrumb"] ol.breadcrumb > li {
  display: inline-flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
nav[aria-label="Breadcrumb"] ol.breadcrumb > li.separator {
  margin: 0 6px;
  color: #6b7280;
}
nav[aria-label="Breadcrumb"] ol.breadcrumb a {
  color: #0a58ca;
  text-decoration: none;
}
nav[aria-label="Breadcrumb"] ol.breadcrumb a:hover,
nav[aria-label="Breadcrumb"] ol.breadcrumb a:focus-visible {
  text-decoration: underline;
}

/* ======================= MCQ BUTTONS - ALIGNED STYLES ======================= */
.mcq-action-bar {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  z-index: 4;
}
.lang-toggle-mcq-btn,
.explain-btn,
.report-btn,
.details-btn {
  position: absolute;
  top: 10px;
  background-color: #6c757d;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  z-index: 4;
  transition: background-color 0.2s;
  width: 60px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
 
  /* Consistent text rendering */
  line-height: 1;
  font-family: Arial, sans-serif;
  padding: 0;
  margin: 0;
  text-transform: none;
  letter-spacing: normal;
 
  /* Perfect vertical alignment for all languages */
  font-weight: 600;
}
.mcq-action-bar .lang-toggle-mcq-btn,
.mcq-action-bar .explain-btn,
.mcq-action-bar .report-btn,
.mcq-action-bar .details-btn {
  position: static;
  top: auto;
  right: auto;
  z-index: auto;
}
/* Specific positioning for each button */
.explain-btn {
  right: 10px;
}
.lang-toggle-mcq-btn {
  right: 80px;
}
.report-btn {
  right: 150px;
}
.details-btn {
  right: 220px;
  background: linear-gradient(135deg, #0f766e, #0ea5e9);
  font-size: 10.5px;
}
/* Hover states for all buttons */
.lang-toggle-mcq-btn:hover,
.explain-btn:hover,
.report-btn:hover {
  background-color: #5a6268;
}
.details-btn:hover {
  background: linear-gradient(135deg, #0b5f58, #0284c7);
}
/* Hindi-specific font and alignment adjustments */
.lang-toggle-mcq-btn[data-current-lang="hi"],
.lang-hindi .lang-toggle-mcq-btn {
  font-family: Arial, "Nirmala UI", "Mangal", sans-serif;
  /* Micro-adjustment for perfect Hindi alignment */
  padding-top: 0.5px;
}
/* Ensure consistent font for other buttons in Hindi mode */
.lang-hindi .explain-btn,
.lang-hindi .report-btn,
.lang-hindi .details-btn {
  font-family: Arial, "Nirmala UI", "Mangal", sans-serif;
}
/* Ensure MCQ boxes have enough padding for the action bar */
.mcq {
  position: relative;
  padding-top: 52px;
}
@media screen and (max-width: 360px) {
  .mcq-action-bar {
    gap: 4px;
    right: 8px;
  }
  .mcq-action-bar .lang-toggle-mcq-btn,
  .mcq-action-bar .explain-btn,
  .mcq-action-bar .report-btn,
  .mcq-action-bar .details-btn {
    width: 56px;
    font-size: 10px;
  }
  .mcq-action-bar .details-btn {
    font-size: 9.5px;
  }
  .mcq {
    padding-top: 58px;
  }
}
/* ======================= LANGUAGE TOGGLE VISIBILITY ======================= */
/* Hide language toggle in non-home modes */
body:not(.home) .lang-toggle-container {
    display: none !important;
}
/* Ensure language toggle is visible on home page */
body.home .lang-toggle-container {
    display: inline-block !important;
}
/* ======================= REPORT POPUP STYLES - UPDATED LANGUAGE TOGGLE ======================= */
.report-popup-header {
    background: #007BFF;
    color: white;
    padding: 20px;
    border-radius: 10px 10px 0 0;
    position: relative;
    text-align: center;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.report-popup-header h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: bold;
    width: 100%;
}
/* ======================= CANCEL BUTTON TOP RIGHT FIX ======================= */
.report-close-btn {
    position: absolute;
    top: 12px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10; /* stays above everything */
    line-height: 1;
}
.report-close-btn:hover {
    color: #e0e0e0;
    transform: scale(1.1);
}
/* ======================= REPORT POPUP LANGUAGE TOGGLE (MATCHING EXAM HELP MODAL STYLE) ======================= */
.report-lang-toggle {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 10px;
    background: none;
    border-radius: 0;
    padding: 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}
.report-lang-toggle .lang-tab {
    flex: 1;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 10px 0;
    position: relative;
    transition: all 0.3s ease;
    text-align: center;
}
.report-lang-toggle .lang-tab.active {
    color: white;
    font-weight: bold;
}
/* Active tab underline - FIXED POSITIONING */
.report-lang-toggle .lang-tab.active::after {
    content: "";
    position: absolute;
    bottom: -2px; /* Position at the bottom of the toggle container */
    left: 10%; /* Start 10% from left to not span full width */
    width: 80%; /* Cover 80% of the tab width for better visual */
    height: 3px;
    background: white;
    border-radius: 3px 3px 0 0;
}
.report-lang-toggle .lang-tab:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}
/* Ensure English tab has active class by default */
.report-lang-toggle .lang-tab:first-child.active::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 10%;
    width: 80%;
    height: 3px;
    background: white;
    border-radius: 3px 3px 0 0;
}
/* Mobile adjustments */
@media screen and (max-width: 768px) {
    .report-lang-toggle .lang-tab {
        font-size: 13px;
        padding: 8px 0;
    }
   
    .report-lang-toggle .lang-tab.active::after,
    .report-lang-toggle .lang-tab:first-child.active::after {
        height: 2px;
        bottom: -2px;
    }
}
@media screen and (max-width: 480px) {
    .report-lang-toggle .lang-tab {
        font-size: 12px;
        padding: 5px 0;
    }
}
/* Rest of the report popup styles remain the same */
.report-popup-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}
.report-section {
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}
.report-section:last-child {
    border-bottom: none;
}
.report-section h4 {
    color: #007BFF;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: bold;
    border-bottom: 2px solid #007BFF;
    padding-bottom: 5px;
}
.report-option {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 5px;
    transition: background 0.2s ease;
}
.report-option:hover {
    background: #f5f5f5;
}
.report-option input[type="checkbox"] {
    display: none;
}
.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #007BFF;
    border-radius: 3px;
    margin-right: 10px;
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.2s ease;
}
.report-option input[type="checkbox"]:checked + .checkmark {
    background: #007BFF;
    border-color: #007BFF;
}
.report-option input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.option-text {
    flex: 1;
    line-height: 1.4;
    font-size: 14px;
}
.other-description-container {
    margin-top: 10px;
    margin-left: 28px;
}
.other-description-container textarea {
    width: 100%;
    height: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
}
.other-description-container textarea:focus {
    outline: none;
    border-color: #007BFF;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}
.word-counter {
    text-align: right;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}
.report-popup-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}
.report-submit-btn {
    background: #007BFF;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}
.report-submit-btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}
/* Hindi font support for report popup */
.lang-hindi .report-popup,
.lang-hindi .report-option,
.lang-hindi .option-text,
.lang-hindi .other-description-container textarea {
    font-family: Arial, "Nirmala UI", "Mangal", sans-serif;
}
/* Mobile responsiveness */
@media screen and (max-width: 768px) {
    .report-popup {
        width: 95%;
        margin: 10px;
    }
   
    .report-popup-header {
        padding: 15px;
    }
   
    .report-popup-header h3 {
        margin-bottom: 12px;
        font-size: 16px;
    }
   
    .report-lang-toggle {
        gap: 20px;
    }
   
    .report-lang-toggle .lang-tab {
        font-size: 13px;
        padding: 6px 0;
    }
   
    .report-close-btn {
        top: 12px;
        right: 15px;
        font-size: 22px;
        width: 26px;
        height: 26px;
    }
   
    .report-popup-body {
        padding: 15px;
    }
}
@media screen and (max-width: 480px) {
    .report-popup-header {
        padding: 12px;
    }
   
    .report-popup-header h3 {
        font-size: 15px;
        margin-bottom: 10px;
    }
   
    .report-lang-toggle {
        gap: 15px;
    }
   
    .report-lang-toggle .lang-tab {
        font-size: 12px;
        padding: 5px 0;
    }
   
    .report-close-btn {
        top: 10px;
        right: 12px;
        font-size: 20px;
        width: 24px;
        height: 24px;
    }
   
    .report-section h4 {
        font-size: 14px;
    }
   
    .option-text {
        font-size: 13px;
    }
   
    .report-submit-btn {
        padding: 10px 20px;
        font-size: 14px;
        min-width: 120px;
    }
}

/*======================OTP--VERIFICATION====================*/

/* OTP Verification Styles */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
}

.otp-info {
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.otp-info p {
    margin: 0;
    color: #495057;
}

.otp-timer {
    text-align: center;
    margin-top: 5px;
    font-size: 14px;
    color: #dc3545;
    font-weight: bold;
}

#otpCode {
    text-align: center;
    font-size: 18px;
    letter-spacing: 5px;
    font-weight: bold;
}

.auth-btn.secondary {
    background-color: #6c757d;
    margin-top: 10px;
}

.auth-btn.secondary:hover {
    background-color: #5a6268;
}

.auth-btn.link {
    background: none;
    color: #007bff;
    margin-top: 10px;
}

.auth-btn.link:hover {
    background: #f8f9fa;
    text-decoration: underline;
}

.auth-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/*================MCQ MATCH THE FOLLOWING FORMATTING=================*/
.match-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 12px 0;
}

.match-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 15px;
    background: #ffffff;
    border: 1px solid #ddd;
    min-width: 280px;
}

.match-table th {
    background: #f2f2f2;
    padding: 10px;
    font-weight: 600;
    text-align: left;
    border: 1px solid #ddd;
    vertical-align: top;
}

.match-table td {
    border: 1px solid #ddd;
    padding: 10px;
    vertical-align: top;
}

.match-table__label {
    font-weight: 700;
    margin-right: 6px;
}

.match-table__text {
    word-break: break-word;
}

.match-table-empty {
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

@media (max-width: 640px) {
    .match-table th,
    .match-table td {
        padding: 8px;
    }
}

/* ======================= SUBTOPIC FILTRATION POPUP ======================= */
.filter-modal {
  position: fixed;
  z-index: 2000;
}

#subtopicFilterPopup .exam-popup-content {
  max-width: 500px;
}

#subtopicFilterPopup h2 {
  text-align: center;
  color: #007BFF;
  margin-bottom: 20px;
}

#startPracticeBtn {
  padding: 12px 30px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

#startPracticeBtn:hover {
  background: #218838;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}
/* ======================= TOAST NOTIFICATION SYSTEM ======================= */
.app-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-16px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 13px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  z-index: 99999;
  box-shadow: 0 8px 28px rgba(0,0,0,0.28);
  box-sizing: border-box;
  width: auto;
  max-width: 90vw;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  line-height: 1.4;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.app-toast__message {
  display: block;
  min-width: 0;
  width: 100%;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.4;
}
.app-toast.app-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
/* ── Toast colour palette ── */
.app-toast--success { background: #166534; }
.app-toast--info    { background: #1d4ed8; }
.app-toast--warning { background: #b45309; color: #fff; }
.app-toast--error   { background: #b91c1c; }
/* Taxi-yellow — "Please log in to use Exam Mode" and eye-catching alerts */
.app-toast--login   { background: #f5c200; color: #1a1a1a; }
/* Session-expired — high-visibility red-orange */
.app-toast--session { background: #dc2626; color: #fff; letter-spacing: 0.01em; }

@media (min-width: 481px) {
  .app-toast {
    max-width: 420px;
  }
}

@media (max-width: 480px) {
  .app-toast {
    top: 16px;
    max-width: 95vw;
    padding: 10px 12px;
    font-size: 14px;
  }
}

/* ======================= RESUME EXAM CUSTOM MODAL ======================= */
#resumeExamModal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10002;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
}
#resumeExamModal.active {
  display: flex;
}
#resumeExamModal .resume-modal-box {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 420px;
  padding: 28px 24px 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  position: relative;
}
#resumeExamModal h3 {
  margin: 0 0 14px;
  font-size: 18px;
  color: #111827;
}
#resumeExamModal .resume-modal-info {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 20px;
  font-size: 14px;
  color: #0c4a6e;
  line-height: 1.6;
}
#resumeExamModal .resume-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
#resumeExamModal .resume-modal-actions button {
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
#resumeExamModal #resumeModalConfirmBtn {
  background: #007bff;
  color: #fff;
}
#resumeExamModal #resumeModalConfirmBtn:hover { background: #0056b3; }
#resumeExamModal #resumeModalCancelBtn {
  background: #e5e7eb;
  color: #374151;
}
#resumeExamModal #resumeModalCancelBtn:hover { background: #d1d5db; }

/* =====================================================================
   ONGOING EXAM BLOCK MODAL
   Shown when user tries to start a new exam while one is already active.
   ===================================================================== */
#ongoingExamModal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10010;                        /* above every other modal     */
  background: rgba(0, 0, 0, 0.65);
  justify-content: center;
  align-items: center;
  padding: 16px;
}
#ongoingExamModal.active {
  display: flex;
}
.ongoing-modal-box {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 440px;
  padding: 32px 28px 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.30);
  position: relative;
  animation: ongoingModalIn .22s ease;
}
@keyframes ongoingModalIn {
  from { opacity: 0; transform: translateY(-18px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)      scale(1);  }
}
.ongoing-modal-icon {
  font-size: 36px;
  text-align: center;
  margin-bottom: 10px;
  line-height: 1;
}
.ongoing-modal-box h3 {
  margin: 0 0 10px;
  font-size: 19px;
  font-weight: 700;
  color: #111827;
  text-align: center;
}
.ongoing-modal-desc {
  margin: 0 0 16px;
  font-size: 14px;
  color: #4b5563;
  text-align: center;
  line-height: 1.55;
}
.ongoing-modal-info {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 22px;
  font-size: 13.5px;
  color: #5a4000;
  line-height: 1.65;
}
.ongoing-modal-info strong { color: #3d2b00; }
.ongoing-modal-info .info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.ongoing-modal-info .info-row + .info-row { margin-top: 6px; }
.ongoing-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ongoing-btn-primary,
.ongoing-btn-danger,
.ongoing-btn-ghost {
  width: 100%;
  padding: 12px 18px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, opacity .18s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.ongoing-btn-primary {
  background: #007bff;
  color: #fff;
}
.ongoing-btn-primary:hover  { background: #0062cc; }
.ongoing-btn-primary:disabled { opacity: .55; cursor: not-allowed; }

.ongoing-btn-danger {
  background: #fff;
  color: #dc3545;
  border: 1.5px solid #dc3545;
}
.ongoing-btn-danger:hover  { background: #fff5f5; }
.ongoing-btn-danger:disabled { opacity: .55; cursor: not-allowed; }

.ongoing-btn-ghost {
  background: #f3f4f6;
  color: #6b7280;
}
.ongoing-btn-ghost:hover { background: #e5e7eb; }

/* Spinner inside buttons during async ops */
.ongoing-btn-primary .btn-spinner,
.ongoing-btn-danger  .btn-spinner {
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

