/* ============================================================================
   reading.css — FULL (PDF.js canvas render = NO black PDF viewer background)
============================================================================ */

/* ----------------------------------------
   Reading – Question text (JSON)
---------------------------------------- */
.quiz--question-prompt {
  margin: 10px 0 8px;
  font-family: "Montserrat", sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: #1a1818;
  padding: 15px;
  border-radius: 15px;
  text-align: center;
  background-color: #a7d6fd;
}

.quiz--question {
  margin: 14px 0 16px;
  padding: 14px 18px;

  font-family: "Cardo", serif;
  font-size: 22px;
  line-height: 1.45;
  color: #0b0f17;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  font-weight: 500;
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.14);
}

/* Section Headers */
.quiz--section-header {
  font-size: 14px;
  font-weight: 700;
  color: #475569;
  margin: 16px 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Horizontal Divider */
.quiz--divider {
  border: none;
  border-top: 2px solid #e2e8f0;
  margin: 16px 0;
}

/* Toolbar */
.quiz--toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
}

.quiz--toolbar-weights {
  margin-bottom: 0;
}

.quiz--toolbar-filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.quiz--toolbar-realtest {
  margin-bottom: 0;
}

/* Deserves Attention Wrapper with Tooltip */
.quiz--deserves-wrapper {
  position: relative;
  display: inline-block;
}

.quiz--deserves-tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%) translateY(-5px);
  background: #1e293b;
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 1000;
  pointer-events: none;
}

.quiz--deserves-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1e293b;
}

.quiz--deserves-wrapper:hover .quiz--deserves-tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Toggle pill */
.quiz--toggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 600;
  cursor: pointer;
  margin: 0;
  transition: all 0.15s ease;
}

.quiz--toggle:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.quiz--toggle input {
  accent-color: #6366f1;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.quiz--toggle input:disabled {
  cursor: not-allowed;
}

.quiz--toggle:has(input:disabled) {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

@media (max-width: 640px) {
  .quiz--question {
    font-size: 20px;
    padding: 12px 14px;
  }
}

#kpiBox {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
}

#questionStats {
  font-size: 0.95rem;
  opacity: 0.9;
}

/* ✅ Empty state message */
.quiz--empty-state {
  margin-top: 22px;
  padding: 22px 18px;
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  opacity: 0.85;
  border: 1px dashed rgba(148, 163, 184, 0.6);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
}

/* ✅ Selected weight pill */
.quiz--weight-btn {
  transition: transform 0.08s ease, box-shadow 0.18s ease, background 0.18s ease,
    border-color 0.18s ease, color 0.18s ease;
}

.quiz--weight-btn.quiz--selected-weight {
  background: #0b1220;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.22);
  transform: translateY(-1px);
}

.quiz--weight-btn.quiz--selected-weight:hover {
  transform: translateY(-1px);
}

.quiz--weight-btn.quiz--selected-weight:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.75);
  outline-offset: 2px;
}

/* ============================
   Real Test dots layout
============================ */
#questionNav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}

#questionNav .quiz--qdot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid #cbd5e1;
  user-select: none;
  background: #fff;
}

#questionNav .quiz--qdot.quiz--active {
  border-color: rgba(37, 99, 235, 0.9);
}

/* ============================
   ✅ PDF container (PDF.js canvas render) — NO black viewer background
============================ */

/* IMPORTANT: some global styles paint .quiz--media dark.
   This forces the PDF area to stay clean/white. */
.quiz--media.quiz--pdf-wrap,
.quiz--pdf-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: 16px;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
}

/* The inner box becomes exactly the PDF page height */
.quiz--pdf-inner {
  position: relative;
  width: 100%;
  max-width: 100%;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  overflow: hidden;
}

/* Canvas fills width; height scales automatically */
.quiz--pdf-canvas {
  width: 100%;
  height: auto;
  display: block;
  background: #ffffff;
}

/* Optional selectable text layer (if you want it later) */
.pdf-text-layer {
  position: absolute;
  inset: 0;
  color: transparent;
  user-select: text;
  pointer-events: auto;
}

/* ============================
   ✅ Copy button overlay
============================ */
.quiz--copybtn-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;

  padding: 10px 12px;
  font-weight: 800;

  background: rgba(255, 255, 255, 1);
  border: 2px solid rgba(0, 0, 0, 0.9);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.12);
  border-radius: 999px;
  cursor: pointer;
}

.quiz--copybtn-overlay.is-copied {
  background: rgba(16, 185, 129, 1);
  border-color: rgba(0, 0, 0, 1);
  color: #ffffff;
}

/* ============================
   Collapsible reading text
============================ */
.quiz--question-wrap {
  position: relative;
}

.quiz--question.quiz--collapsed {
  max-height: 50px;
  overflow: hidden;
  position: relative;
  transition: max-height 0.4s ease;
}

.quiz--question.quiz--collapsed::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 1)
  );
}

.quiz--question.quiz--expanded {
  max-height: 2000px;
}

.quiz--question.quiz--expanded::after {
  display: none;
}

.quiz--expand-btn {
  margin-top: 10px;
  background: none;
  border: none;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  color: #2563eb;
  padding: 6px 4px;
}

.quiz--expand-btn:hover {
  text-decoration: underline;
}

/* Finish Test button ready state */
#finishRealTestBtn.quiz--finish-ready {
  border-color: rgba(16, 185, 129, 1) !important;
  animation: quizFinishPulse 1.15s ease-in-out infinite;
}

@keyframes quizFinishPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
}
