/* ============================================================
   myrscit.com — online-test.css
   Stylesheet for RSCIT-online-test-N.html (timed mock test pages).
   Self-contained: reuses the CSS custom properties defined in
   style.css (loaded before this file) but duplicates the small
   set of quiz-card rules it needs, so this file works even if
   assessment.css isn't also linked on the page.
   ============================================================ */

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 18px 0 6px;
}
.breadcrumb a { color: var(--primary); font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span.sep { color: var(--border); }
.breadcrumb span[aria-current] { color: var(--text-muted); }

/* ── Article header ── */
.article-header { padding: 10px 0 28px; }

.article-header h1 {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
  margin: 8px 0 14px;
}

.article-intro p,
.article-body > p {
  font-size: 0.98rem;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 14px;
}

.article-body h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin: 34px 0 12px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
.article-body h2:first-of-type { border-top: none; padding-top: 0; }

p.instruction {
  background: var(--bg-alt);
  border-left: 3px solid var(--primary);
  border-radius: 0 12px 12px 0;
  padding: 14px 16px;
  font-size: 0.9rem;
  line-height: 1.85;
  color: var(--text);
}

/* ── Test info grid (reused pattern) ── */
.exam-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 20px 0;
  padding: 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.exam-info-grid div { text-align: center; padding: 6px 4px; }
.exam-info-grid strong { display: block; font-size: 0.95rem; color: var(--primary); font-weight: 800; }
.exam-info-grid small { font-size: 0.72rem; color: var(--text-muted); }

/* ── Start / Submit test buttons ── */
.test-action-row {
  display: flex;
  justify-content: center;
  margin: 24px 0 8px;
}

.btn-start-test,
.btn-submit-test {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 12px;
  padding: 16px 40px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(26, 86, 219, 0.25);
  transition: var(--transition);
}
.btn-start-test:hover,
.btn-submit-test:hover { background: var(--primary-dark, #1342b5); transform: translateY(-2px); }
.btn-submit-test { background: #15803d; box-shadow: 0 10px 24px rgba(21, 128, 61, 0.25); }
.btn-submit-test:hover { background: #12692f; }

.pretest-note {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Hide interactive elements until the test is started; content itself
   stays in the DOM (unaffected) for crawlers/SEO. */
.test-options li { transition: var(--transition); }
body:not(.test-active):not(.test-submitted) .test-options li { pointer-events: none; opacity: 0.55; }
body:not(.test-active):not(.test-submitted) .btn-show-answer { display: none; }
body.test-active .btn-start-test,
body.test-submitted .btn-start-test { display: none; }
body:not(.test-active) .btn-submit-test { display: none; }
body.test-submitted .btn-submit-test { display: none; }
body.test-submitted .test-options li { pointer-events: none; }

/* ── Quick jump grid ── */
.quiz-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 26px 0 8px;
}
.quiz-jump a {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
}
.quiz-jump a:hover { background: var(--primary); color: #fff; }
.quiz-jump a.q-answered { background: #dcfce7; color: #15803d; }

/* ── Question cards ── */
.test-question {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 18px 16px;
  margin-bottom: 16px;
  background: #fff;
  scroll-margin-top: calc(var(--nav-h) + 90px);
}
.test-question h3 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 12px;
}
.test-question .test-marks {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 6px;
  padding: 2px 8px;
  margin-inline-start: 8px;
  vertical-align: middle;
}

.test-options {
  list-style: none;
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.test-options li {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
}
.test-options li:hover { border-color: var(--primary); background: var(--primary-light); }

.test-options li.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  font-weight: 700;
}

.test-question.revealed .test-options li { cursor: default; pointer-events: none; }
.test-question.revealed .test-options li:hover { background: none; }
.test-question.revealed .test-options li.correct-option {
  color: #15803d;
  font-weight: 700;
  background: #f0fdf4;
  border-color: #86efac;
}
.test-question.revealed .test-options li.selected:not(.correct-option) {
  color: #b91c1c;
  font-weight: 700;
  background: #fef2f2;
  border-color: #fca5a5;
}

.btn-show-answer {
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-show-answer:hover { background: var(--primary); color: #fff; }
.btn-show-answer:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-show-answer.answered { background: #dcfce7; color: #15803d; }

.test-solution {
  display: none;
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--bg-alt);
  border-left: 3px solid var(--primary);
  border-radius: 0 10px 10px 0;
  font-size: 0.85rem;
  line-height: 1.75;
  color: var(--text);
}
.test-solution.show { display: block; }
.test-solution .sol-answer { color: #15803d; font-weight: 700; }

/* ── Floating info bar (visible only while test is active) ── */
.floating-test-bar {
  display: block;
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 950;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.14);
  padding: 14px 16px;
  width: 220px;
  font-size: 0.78rem;
  animation: floatIn 0.3s ease;
}
body.test-submitted .floating-test-bar { display: none; }

@keyframes floatIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.floating-test-bar .ftb-timer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--primary);
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.floating-test-bar .ftb-timer.warn { color: #b91c1c; }

.floating-test-bar table { width: 100%; border-collapse: collapse; }
.floating-test-bar td {
  padding: 3px 0;
  color: var(--text-muted);
}
.floating-test-bar td:last-child {
  text-align: right;
  font-weight: 700;
  color: var(--text);
}

.floating-test-bar .ftb-submit {
  display: block;
  width: 100%;
  margin-top: 10px;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  background: #15803d;
  border: none;
  border-radius: 8px;
  padding: 9px 0;
  cursor: pointer;
}
.floating-test-bar .ftb-submit:hover { background: #12692f; }

.floating-test-bar .ftb-start {
  display: block;
  width: 100%;
  margin-top: 10px;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 800;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  padding: 10px 0;
  cursor: pointer;
}
.floating-test-bar .ftb-start:hover { background: var(--primary-dark, #1342b5); }

/* Only one of Start / Submit shows at a time, based on test state */
body.test-active .floating-test-bar .ftb-start { display: none; }
body:not(.test-active) .floating-test-bar .ftb-submit { display: none; }

/* ── Results ── */
.test-results {
  display: none;
  margin: 20px 0 30px;
}
body.test-submitted .test-results { display: block; }

.results-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  font-size: 0.9rem;
}
.results-table th {
  background: var(--bg-alt);
  text-align: left;
  padding: 12px 14px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.results-table td {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  font-weight: 700;
  color: var(--text);
}
.results-table tr td:first-child { font-weight: 500; color: var(--text-muted); width: 60%; }
.results-table tr.highlight td { color: var(--primary); font-size: 1rem; }

/* ── Pagination / CTA (reused pattern) ── */
.quiz-pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 30px 0 14px;
}
.quiz-pagination a,
.quiz-pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
}
.quiz-pagination a { color: var(--primary); border-color: var(--primary-light); background: var(--primary-light); }
.quiz-pagination a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.quiz-pagination span.disabled { opacity: 0.5; cursor: not-allowed; }

.quiz-cta-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 8px 0 30px;
}
.quiz-cta-row a {
  text-align: center;
  padding: 13px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--text);
  transition: var(--transition);
}
.quiz-cta-row a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.author-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin: 10px 0 30px;
}
.author-avatar {
  width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%;
  background: var(--primary); color: #fff; display: flex;
  align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem;
}
.author-box strong { display: block; font-size: 0.9rem; color: var(--text); }
.author-box span { font-size: 0.78rem; color: var(--text-muted); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .exam-info-grid { grid-template-columns: repeat(2, 1fr); }
  .quiz-pagination { grid-template-columns: 1fr; }
  .quiz-cta-row { grid-template-columns: 1fr; }
  .results-table { font-size: 0.82rem; }
  .floating-test-bar { left: 12px; right: 12px; bottom: 12px; width: auto; }
}
