/* Exam Room UX layer: keeps questions separate from the AI dialog. */
.jf-exam-board {
  position: fixed;
  left: clamp(16px, 4vw, 76px);
  right: clamp(16px, 4vw, 76px);
  top: 122px;
  bottom: 178px;
  z-index: 36;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(12, 20, 32, 0.82), rgba(8, 14, 26, 0.70)),
    rgba(10, 16, 28, 0.72);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
  color: #f3f8ff;
}

.jf-exam-board.is-hidden {
  display: none;
}

.jf-exam-board-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.045);
}

.jf-exam-board-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(151, 221, 255, 0.88);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.jf-exam-board-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(151, 221, 255, 0.95);
  box-shadow: 0 0 18px rgba(151, 221, 255, 0.62);
}

.jf-exam-board h2 {
  margin: 6px 0 0;
  color: #fff;
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1.08;
}

.jf-exam-board-subtitle {
  margin-top: 8px;
  max-width: 760px;
  color: rgba(226, 240, 255, 0.70);
  font-size: 14px;
  line-height: 1.45;
}

.jf-exam-board-close {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 9px 13px;
}

.jf-exam-board-body {
  overflow: auto;
  padding: 22px;
}

.jf-exam-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 18px;
  min-height: 100%;
}

.jf-exam-main,
.jf-exam-side,
.jf-exam-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.055);
}

.jf-exam-main,
.jf-exam-side {
  padding: 18px;
}

.jf-exam-progress {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.jf-exam-progress-line {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
}

.jf-exam-progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(127, 218, 255, 0.96), rgba(161, 255, 215, 0.92));
  width: 0%;
  transition: width 180ms ease;
}

.jf-exam-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(226, 240, 255, 0.72);
  font-size: 12px;
}

.jf-exam-question {
  margin: 0 0 18px;
  color: #fff;
  font-size: clamp(21px, 2.2vw, 30px);
  line-height: 1.24;
}

.jf-exam-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.jf-exam-pill {
  display: inline-flex;
  border: 1px solid rgba(127, 218, 255, 0.22);
  border-radius: 999px;
  background: rgba(127, 218, 255, 0.08);
  color: rgba(226, 240, 255, 0.78);
  font-size: 12px;
  padding: 6px 9px;
}

.jf-exam-options {
  display: grid;
  gap: 10px;
}

.jf-exam-option {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: start;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.065);
  color: #f5f9ff;
  cursor: pointer;
  font: inherit;
  padding: 14px;
  text-align: left;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.jf-exam-option:hover {
  border-color: rgba(127, 218, 255, 0.62);
  background: rgba(127, 218, 255, 0.10);
  transform: translateY(-1px);
}

.jf-exam-option strong {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(127, 218, 255, 0.15);
  color: #dff7ff;
}

.jf-exam-text-answer {
  display: grid;
  gap: 12px;
}

.jf-exam-text-answer textarea {
  min-height: 150px;
  resize: vertical;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(2, 6, 16, 0.38);
  color: #fff;
  font: inherit;
  padding: 14px;
  outline: none;
}

.jf-exam-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
}

.jf-exam-action,
.jf-exam-primary {
  border: 1px solid rgba(127, 218, 255, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 10px 13px;
}

.jf-exam-primary {
  border-color: rgba(161, 255, 215, 0.45);
  background: rgba(161, 255, 215, 0.13);
}

.jf-exam-side {
  display: grid;
  align-content: start;
  gap: 14px;
}

.jf-exam-side h3 {
  margin: 0;
  color: #fff;
  font-size: 16px;
}

.jf-exam-side p,
.jf-exam-card p {
  margin: 7px 0 0;
  color: rgba(226, 240, 255, 0.70);
  font-size: 13px;
  line-height: 1.45;
}

.jf-exam-card {
  padding: 14px;
}

.jf-exam-track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.jf-exam-track-card {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
  padding: 16px;
}

.jf-exam-track-card h3 {
  margin: 0;
  color: #fff;
  font-size: 17px;
}

.jf-exam-track-card p {
  color: rgba(226, 240, 255, 0.70);
  font-size: 13px;
  line-height: 1.45;
  margin: 8px 0 0;
}

.jf-exam-track-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0;
}

.jf-exam-empty {
  max-width: 680px;
  border: 1px solid rgba(255, 214, 102, 0.22);
  border-radius: 24px;
  background: rgba(255, 214, 102, 0.08);
  padding: 18px;
}

@media (max-width: 980px) {
  .jf-exam-board {
    top: 140px;
    bottom: 205px;
    left: 12px;
    right: 12px;
    border-radius: 22px;
  }
  .jf-exam-layout {
    grid-template-columns: 1fr;
  }
}

/* Stronger Exam Room separation: the question board must be unmistakable. */
.jf-exam-mode .jf-world-panel {
  display: none !important;
}

.jf-exam-board {
  z-index: 72;
  left: clamp(22px, 5vw, 92px);
  right: clamp(22px, 5vw, 92px);
  top: 112px;
  bottom: 190px;
  border-color: rgba(160, 230, 255, 0.32);
  background:
    radial-gradient(circle at 20% 0%, rgba(75, 178, 255, 0.18), transparent 38%),
    linear-gradient(135deg, rgba(8, 18, 34, 0.94), rgba(7, 13, 24, 0.88)),
    rgba(10, 16, 28, 0.9);
}

.jf-exam-board:not(.is-hidden)::before {
  content: "QUESTION BOARD";
  position: absolute;
  right: 22px;
  bottom: 14px;
  color: rgba(255, 255, 255, 0.08);
  font-size: clamp(36px, 7vw, 96px);
  font-weight: 900;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.jf-exam-question-label,
.jf-exam-answer-label {
  margin: 6px 0 8px;
  color: rgba(161, 255, 215, 0.78);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.jf-exam-question {
  padding: 16px;
  border: 1px solid rgba(161, 255, 215, 0.22);
  border-radius: 20px;
  background: rgba(161, 255, 215, 0.055);
}

.jf-exam-loading h3::after {
  content: "";
  display: inline-block;
  width: 1.2em;
  animation: jfExamDots 1.1s steps(4, end) infinite;
}

@keyframes jfExamDots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

/* Exam Defense Flow */
.jf-exam-result-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-bottom: 16px;
}

.jf-defense-layout .jf-exam-main {
  display: grid;
  align-content: start;
  gap: 16px;
}

.jf-defense-list {
  display: grid;
  gap: 14px;
}

.jf-defense-question {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.055);
  padding: 16px;
}

.jf-defense-question.is-answered {
  border-color: rgba(161, 255, 215, 0.36);
  background: rgba(161, 255, 215, 0.07);
}

.jf-defense-question-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.jf-defense-question-head span,
.jf-defense-question-head em {
  border: 1px solid rgba(127, 218, 255, 0.20);
  border-radius: 999px;
  color: rgba(226, 240, 255, 0.78);
  font-size: 12px;
  font-style: normal;
  padding: 6px 9px;
  white-space: nowrap;
}

.jf-defense-question.is-answered .jf-defense-question-head em {
  border-color: rgba(161, 255, 215, 0.32);
  color: rgba(210, 255, 235, 0.92);
}

.jf-defense-question-head strong {
  color: #fff;
  font-size: 15px;
}

.jf-defense-question p {
  margin: 0 0 12px;
  color: rgba(245, 250, 255, 0.9);
  font-size: 15px;
  line-height: 1.45;
}

.jf-defense-question textarea {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(2, 6, 16, 0.38);
  color: #fff;
  font: inherit;
  line-height: 1.45;
  padding: 14px;
  outline: none;
}

.jf-defense-question textarea:focus,
.jf-exam-text-answer textarea:focus {
  border-color: rgba(127, 218, 255, 0.58);
  box-shadow: 0 0 0 3px rgba(127, 218, 255, 0.10);
}

.jf-defense-finish-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin-top: 4px;
  padding: 12px 0 0;
  background: linear-gradient(180deg, transparent, rgba(8, 18, 34, 0.92) 32%);
}

@media (max-width: 760px) {
  .jf-exam-board {
    top: 82px;
    bottom: 122px;
    left: 8px;
    right: 8px;
    border-radius: 18px;
  }

  .jf-exam-board-head {
    padding: 14px;
  }

  .jf-exam-board h2 {
    font-size: 21px;
  }

  .jf-exam-board-subtitle {
    font-size: 12px;
  }

  .jf-exam-board-body {
    padding: 12px;
  }

  .jf-exam-question {
    font-size: 18px;
    padding: 13px;
  }

  .jf-exam-option {
    grid-template-columns: 32px 1fr;
    padding: 12px;
  }

  .jf-defense-question-head {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .jf-defense-question textarea {
    min-height: 112px;
  }
}

/* Defense voice recording clarity */
.jf-defense-question.is-recording {
  border-color: rgba(255, 214, 102, 0.58);
  background:
    linear-gradient(135deg, rgba(255, 214, 102, 0.09), rgba(255, 255, 255, 0.045)),
    rgba(255, 255, 255, 0.055);
  box-shadow: 0 0 0 3px rgba(255, 214, 102, 0.08);
}

.jf-defense-dictation-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  min-height: 28px;
  color: rgba(226, 240, 255, 0.68);
  font-size: 12px;
}

.jf-defense-dictation-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(127, 218, 255, 0.55);
}

.jf-defense-dictation-status.is-recording {
  color: rgba(255, 239, 190, 0.96);
  font-weight: 700;
}

.jf-defense-dictation-status.is-recording::before {
  background: rgba(255, 92, 92, 0.98);
  box-shadow: 0 0 0 0 rgba(255, 92, 92, 0.55);
  animation: jfRecordingPulse 1.2s ease-out infinite;
}

.jf-defense-dictation-status.is-transcribing {
  color: rgba(151, 221, 255, 0.92);
}

.jf-defense-dictation-status.is-transcribing::before {
  background: rgba(151, 221, 255, 0.95);
  box-shadow: 0 0 16px rgba(151, 221, 255, 0.32);
}

.jf-defense-dictation-status.is-done {
  color: rgba(161, 255, 215, 0.92);
}

.jf-defense-dictation-status.is-done::before {
  background: rgba(161, 255, 215, 0.95);
}

.jf-defense-dictate-button.is-recording {
  border-color: rgba(255, 92, 92, 0.62);
  background: rgba(255, 92, 92, 0.16);
  color: #fff;
}

@keyframes jfRecordingPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 92, 92, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(255, 92, 92, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 92, 92, 0); }
}
