/* ==========================================================================
   05-question-card.css — Clinical Stem, Options, Source & AI Explanations
   ========================================================================== */

.q-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 7px 8px;
  margin-bottom: 12px;
  max-width: 100%;
}

.q-strip-pills {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px;
  flex: 1 1 0%;
  min-width: 0;
}
.q-strip-pills::-webkit-scrollbar {
  display: none;
}

.q-pill {
  min-width: 38px;
  height: 34px;
  padding: 0 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 650;
  flex-shrink: 0;
  direction: ltr;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.q-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}
.q-pill.is-ok {
  background: var(--ok-bg);
  border-color: var(--ok-border);
  color: var(--ok-text);
}
.q-pill.is-err {
  background: var(--err-bg);
  border-color: var(--err-border);
  color: var(--err-text);
}
.q-pill.active.is-ok,
.q-pill.active.is-err {
  box-shadow: 0 0 0 2px var(--accent);
}

/* Question Header */
.q-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}
.q-meta-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

/* Clinical Stem (English LTR) */
.clinical-ltr {
  direction: ltr;
  text-align: left;
  font-family: var(--font-en);
}

.q-heading-num {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 750;
  color: var(--text-primary);
}
.q-heading-num small {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 13px;
}

.q-vignette {
  font-size: 15px;
  line-height: 1.78;
  color: var(--text-primary);
  white-space: pre-line;
  margin-bottom: 16px;
}

/* Embedded Medical Figure (X-ray / ECG) */
.figure-frame {
  margin: 14px 0 18px;
  background: #0d131d;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-align: center;
}
.figure-frame img {
  display: block;
  max-width: 100%;
  max-height: 410px;
  width: auto;
  height: auto;
  margin: 0 auto;
  cursor: zoom-in;
}
.figure-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-light);
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-secondary);
  direction: rtl;
}

.q-prompt-bold {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 14px 0 3px;
}
.q-prompt-sub {
  font-size: 12.5px;
  color: var(--accent);
  margin: 0 0 14px;
}

/* Calm eMedici-Style Options */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.opt-row {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  background: var(--bg-surface);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  direction: ltr;
  transition: border-color 0.15s, background 0.15s;
}
.opt-row:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--bg-subtle);
}
.opt-row.is-picked:not(.is-revealed) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.opt-row:disabled {
  opacity: 1;
  cursor: default;
}

.opt-pct-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0%;
  background: rgba(148, 163, 184, 0.13);
  z-index: 0;
  transition: width 0.35s ease;
}
.opt-row.opt-right {
  border-color: var(--ok-border);
}
.opt-row.opt-right .opt-pct-bar {
  background: var(--ok-bg);
}
.opt-row.opt-wrong {
  border-color: var(--err-border);
}
.opt-row.opt-wrong .opt-pct-bar {
  background: var(--err-bg);
}

.opt-circle {
  position: relative;
  z-index: 1;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 1.5px solid var(--border-medium);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.opt-row.is-picked:not(.is-revealed) .opt-circle {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}
.opt-row.opt-right .opt-circle {
  border-color: var(--ok-badge);
  background: var(--ok-badge);
  color: #ffffff;
}
.opt-row.opt-wrong .opt-circle {
  border-color: var(--err-badge);
  background: var(--err-badge);
  color: #ffffff;
}

.opt-text {
  position: relative;
  z-index: 1;
  flex: 1;
  font-size: 14.2px;
  font-weight: 500;
  line-height: 1.45;
}
.opt-row.opt-right .opt-text {
  color: var(--ok-text);
  font-weight: 700;
}
.opt-row.opt-wrong .opt-text {
  color: var(--err-text);
  font-weight: 650;
}

.opt-pct-label {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-muted);
  margin-left: 8px;
}

.q-controls-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* Verbatim Original Source Explanation */
.orig-explain-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border-light);
  direction: ltr;
  text-align: left;
  font-family: var(--font-en);
}

.orig-body p {
  margin: 0 0 12px;
  font-size: 14.3px;
  line-height: 1.76;
  color: var(--text-primary);
}

.takeaways-panel {
  margin: 15px 0;
  padding: 12px 15px;
  border-radius: var(--radius-md);
  background: var(--pearl-bg);
  border: 1px solid var(--pearl-border);
}
.takeaway-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--pearl-text);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.65;
  margin: 5px 0;
}
.takeaway-row svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 3px;
}

.references-panel {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-light);
  font-size: 12px;
  color: var(--text-muted);
}
.references-panel strong {
  display: block;
  font-size: 11px;
  letter-spacing: 0.6px;
  margin-bottom: 5px;
  color: var(--text-secondary);
}
.references-panel ol {
  margin: 0;
  padding-left: 18px;
}
.references-panel li {
  margin-bottom: 4px;
  word-break: break-word;
}

/* Calm AI Educational Study Guide */
.edu-guide-card {
  margin-top: 18px;
  border-radius: var(--radius-lg);
  background: var(--edu-bg);
  border: 1px solid var(--edu-border);
  padding: 16px;
}
@media (min-width: 640px) {
  .edu-guide-card {
    padding: 20px;
  }
}

.edu-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--edu-border);
}
.edu-guide-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14.5px;
  font-weight: 750;
  color: var(--edu-accent);
}
.edu-guide-heading svg {
  width: 17px;
  height: 17px;
}

.seg-toggle {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 2px;
}
.seg-toggle button {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.seg-toggle button.active {
  background: var(--edu-accent);
  color: #ffffff;
}

.edu-section {
  margin-bottom: 13px;
}
.edu-section:last-child {
  margin-bottom: 0;
}
.edu-section h4 {
  margin: 0 0 5px;
  font-size: 13px;
  font-weight: 700;
  color: var(--edu-accent);
}
.edu-section p, .edu-section li {
  margin: 0;
  font-size: 13.8px;
  line-height: 1.75;
  color: var(--text-primary);
}
.edu-section ul {
  margin: 0;
  padding-inline-start: 18px;
}
.edu-section li {
  margin-bottom: 4px;
}

.edu-distractors {
  display: grid;
  gap: 7px;
}
.edu-distractor {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13.3px;
}
.edu-distractor strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text-primary);
}

.edu-pearl-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-inline-start: 3px solid var(--edu-accent);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}
