/* Sınav motoru temel stili. Temalar yalnızca değişkenleri ve süslemeleri değiştirir. */
.quiz-page {
  --q-bg: #f5f3ff;
  --q-surface: #ffffff;
  --q-ink: #1e1b4b;
  --q-muted: #6b7280;
  --q-line: #e5e7eb;
  --q-accent: #6d28d9;
  --q-accent-2: #2563eb;
  --q-accent-ink: #ffffff;
  --q-sel: #ede9fe;
  --q-passage: #fffbeb;
  --q-passage-line: #fde68a;
  --q-radius: 18px;
  --q-font: var(--font);
  --q-head-font: var(--q-font);
  --q-shadow: 0 10px 30px rgba(30, 27, 75, .08);
  --q-tf-true: #16a34a;
  --q-tf-false: #dc2626;
  background: var(--q-bg);
  color: var(--q-ink);
}
.quiz-stage { font-family: var(--q-font); padding-bottom: 30px; min-height: 70vh; }
.quiz-page .breadcrumbs a, .quiz-page .breadcrumbs ol { color: var(--q-muted); }

.quiz-intro { padding-top: 22px; padding-bottom: 8px; }
.quiz-intro h1 { font-family: var(--q-head-font); font-size: clamp(1.4rem, 3vw, 2.1rem); margin-bottom: 8px; }
.quiz-intro p { color: var(--q-muted); max-width: 820px; }
.quiz-facts { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.quiz-facts li { background: var(--q-surface); border: 1px solid var(--q-line); padding: 6px 12px; border-radius: 999px; font-size: .85rem; color: var(--q-muted); }
.quiz-facts b { color: var(--q-ink); }

/* Üst ilerleme çubuğu */
.quiz-bar { position: sticky; top: 68px; z-index: 20; padding: 10px 0; margin: 14px 0 6px; }
.quiz-bar-inner { background: var(--q-surface); border: 1px solid var(--q-line); border-radius: 14px; padding: 10px 16px; display: flex; align-items: center; gap: 16px; box-shadow: var(--q-shadow); }
.qb-progress { flex: 1; height: 10px; background: color-mix(in srgb, var(--q-line) 70%, transparent); border-radius: 999px; overflow: hidden; }
.qb-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--q-accent), var(--q-accent-2)); border-radius: 999px; transition: width .35s; }
.qb-stats { display: flex; gap: 14px; align-items: center; font-weight: 700; font-size: .88rem; white-space: nowrap; }
.qb-timer { font-variant-numeric: tabular-nums; padding: 4px 10px; border-radius: 8px; background: var(--q-sel); color: var(--q-accent); }
.qb-timer.warn { background: #fee2e2; color: #b91c1c; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .55; } }

.quiz-body { display: block; }

/* Soru haritası */
.quiz-map { background: var(--q-surface); border: 1px solid var(--q-line); border-radius: var(--q-radius); padding: 12px 14px; margin-bottom: 14px; }
.map-title { font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--q-muted); margin-bottom: 8px; }
.map-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.map-dot { width: 34px; height: 34px; border-radius: 10px; border: 1.5px solid var(--q-line); background: var(--q-surface); color: var(--q-ink); font: 700 .82rem var(--q-font); cursor: pointer; position: relative; }
.map-dot::after { content: ''; position: absolute; bottom: 3px; left: 50%; width: 10px; height: 3px; margin-left: -5px; border-radius: 2px; background: var(--dotc, transparent); }
.map-dot.t-tf { --dotc: #22c55e; } .map-dot.t-mc { --dotc: #6366f1; } .map-dot.t-fill { --dotc: #f59e0b; } .map-dot.t-open { --dotc: #ec4899; }
.map-dot.done { background: var(--q-accent); border-color: var(--q-accent); color: var(--q-accent-ink); }
.map-dot.current { box-shadow: 0 0 0 3px color-mix(in srgb, var(--q-accent) 35%, transparent); }
.map-legend { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; padding: 0; margin: 10px 0 0; font-size: .75rem; color: var(--q-muted); }
.map-legend li::before { content: ''; display: inline-block; width: 10px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.map-legend .t-tf::before { background: #22c55e; } .map-legend .t-mc::before { background: #6366f1; } .map-legend .t-fill::before { background: #f59e0b; } .map-legend .t-open::before { background: #ec4899; }

/* Bölüm başlıkları */
.q-section { display: flex; flex-direction: column; gap: 2px; margin: 26px 0 12px; font-family: var(--q-head-font); font-size: 1.25rem; }
.q-section small { font-family: var(--q-font); font-size: .88rem; font-weight: 500; color: var(--q-muted); }

/* Soru kartı */
.q { background: var(--q-surface); border: 1px solid var(--q-line); border-radius: var(--q-radius); padding: 22px 24px; margin-bottom: 16px; box-shadow: var(--q-shadow); }
.q-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.q-num { font-family: var(--q-head-font); font-weight: 800; font-size: 1.05rem; color: var(--q-accent); }
.q-type, .q-skill { font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--q-sel); color: var(--q-accent); }
.q-skill { background: color-mix(in srgb, var(--q-accent-2) 14%, transparent); color: var(--q-accent-2); }
.q-body { font-size: 1.06rem; font-weight: 600; line-height: 1.65; margin-bottom: 14px; }
.q-body p:last-child { margin-bottom: 0; }
.q-body table, .passage-body table { border-collapse: collapse; margin: 10px 0; font-weight: 500; font-size: .95rem; background: var(--q-surface); }
.q-body th, .q-body td, .passage-body th, .passage-body td { border: 1px solid var(--q-line); padding: 6px 12px; text-align: center; }
.q-body th, .passage-body th { background: var(--q-sel); }
.q-figure { margin: 0 0 16px; text-align: center; }
.q-figure img { max-height: 340px; border-radius: 12px; border: 1px solid var(--q-line); background: #fff; }

.q-passage { background: var(--q-passage); border: 1px solid var(--q-passage-line); border-radius: 14px; padding: 16px 18px; margin-bottom: 16px; font-size: .97rem; line-height: 1.75; max-height: 420px; overflow: auto; }
.passage-title { font-family: var(--q-head-font); font-size: 1.02rem; margin-bottom: 8px; }
.passage-img { display: block; max-height: 220px; margin: 0 auto 10px; border-radius: 10px; }

/* Cevap alanları */
.tf-group { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 520px; }
.tf-opt, .mc-opt { position: relative; cursor: pointer; }
.tf-opt input, .mc-opt input { position: absolute; opacity: 0; pointer-events: none; }
.tf-opt span { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border: 2px solid var(--q-line); border-radius: 14px; font-weight: 800; transition: .15s; background: var(--q-surface); }
.tf-opt i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--q-sel); }
.tf-true input:checked + span { border-color: var(--q-tf-true); background: color-mix(in srgb, var(--q-tf-true) 12%, var(--q-surface)); color: var(--q-tf-true); }
.tf-false input:checked + span { border-color: var(--q-tf-false); background: color-mix(in srgb, var(--q-tf-false) 12%, var(--q-surface)); color: var(--q-tf-false); }
.tf-opt:hover span, .mc-opt:hover { border-color: color-mix(in srgb, var(--q-accent) 50%, var(--q-line)); }
.tf-opt input:focus-visible + span, .mc-opt:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--q-accent) 45%, transparent); outline-offset: 2px; }

.mc-group { display: grid; gap: 10px; }
.mc-opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 2px solid var(--q-line); border-radius: 14px; transition: .15s; background: var(--q-surface); }
.mc-letter { flex: none; width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; background: var(--q-sel); color: var(--q-accent); transition: .15s; }
.mc-text { font-weight: 500; }
.mc-opt:has(input:checked) { border-color: var(--q-accent); background: var(--q-sel); }
.mc-opt:has(input:checked) .mc-letter { background: var(--q-accent); color: var(--q-accent-ink); }

.fill-input, .open-input, .fill-inline { font: 600 1rem var(--q-font); color: var(--q-ink); background: var(--q-surface); border: 2px solid var(--q-line); border-radius: 12px; padding: 12px 14px; transition: .15s; }
.fill-input { width: 100%; max-width: 420px; }
.fill-inline { display: inline-block; width: 11em; max-width: 100%; padding: 4px 10px; margin: 2px 4px; border-width: 0 0 3px; border-radius: 6px 6px 0 0; background: var(--q-sel); text-align: center; }
.open-input { width: 100%; resize: vertical; min-height: 110px; font-weight: 500; line-height: 1.6; }
.fill-input:focus, .open-input:focus, .fill-inline:focus { outline: none; border-color: var(--q-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--q-accent) 18%, transparent); }

/* Gezinme */
.quiz-nav { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.qnav-pos { flex: 1; text-align: center; color: var(--q-muted); font-weight: 700; font-size: .9rem; }
.qbtn { font: 800 .95rem var(--q-font); padding: 12px 20px; border-radius: 12px; border: 2px solid var(--q-line); background: var(--q-surface); color: var(--q-ink); cursor: pointer; transition: .15s; }
.qbtn:hover { border-color: var(--q-accent); }
.qbtn:disabled { opacity: .4; cursor: not-allowed; }
.qbtn-next { background: var(--q-accent); border-color: var(--q-accent); color: var(--q-accent-ink); }
.qbtn-finish { background: linear-gradient(135deg, var(--q-accent), var(--q-accent-2)); border-color: transparent; color: var(--q-accent-ink); }
.quiz-back { margin-top: 18px; }
.quiz-back a { color: var(--q-muted); }

.quiz-dialog { border: 0; border-radius: 20px; padding: 26px; max-width: 420px; width: calc(100% - 32px); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); font-family: var(--q-font); }
.quiz-dialog::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.quiz-toast { position: fixed; left: 50%; top: 92px; transform: translateX(-50%); background: var(--q-ink); color: var(--q-bg); padding: 10px 18px; border-radius: 999px; font-weight: 700; z-index: 60; box-shadow: var(--q-shadow); animation: toast 2.4s ease forwards; pointer-events: none; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -10px); } 12%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
.quiz-sending { opacity: .6; pointer-events: none; }

.gate { margin: 20px auto; }
.gate-card { background: var(--q-surface); border: 1px solid var(--q-line); border-radius: 22px; padding: 30px; text-align: center; box-shadow: var(--q-shadow); }
.quiz-preview { margin-top: 20px; color: var(--q-muted); }

/* ---- Tek soru modları (step, split, cards, sidebar) ---- */
.js-one .q { display: none; }
.js-one .q.active { display: block; animation: qin .3s ease; }
.js-one .q-section { display: none; }
@keyframes qin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.js-all .qbtn-prev, .js-all .qbtn-next, .js-all .qnav-pos { display: none; }
.js-all .quiz-nav { justify-content: flex-end; }
.js-all .quiz-map { display: none; }
.js-one .qbtn-finish { display: none; }
.js-one.at-end .qbtn-finish { display: inline-flex; }
.js-one.at-end .qbtn-next { display: none; }

/* split: okuma metni solda sabit, soru sağda */
.layout-split .q.has-passage.active { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.layout-split .q.has-passage .q-passage { margin: 0; max-height: 70vh; position: sticky; top: 150px; }

/* cards: büyük soru kutucukları */
.layout-cards .map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 10px; }
.layout-cards .map-dot { width: auto; height: 56px; border-radius: 16px; font-size: 1.05rem; }

/* sidebar: solda soru haritası */
.layout-sidebar .quiz-body { display: grid; grid-template-columns: 230px 1fr; gap: 20px; align-items: start; }
.layout-sidebar .quiz-map { position: sticky; top: 150px; margin: 0; }
.layout-sidebar .map-grid { display: grid; grid-template-columns: repeat(5, 1fr); }
.layout-sidebar .map-dot { width: auto; }

@media (max-width: 860px) {
  .layout-split .q.has-passage.active { display: block; }
  .layout-split .q.has-passage .q-passage { position: static; max-height: 320px; margin-bottom: 16px; }
  .layout-sidebar .quiz-body { grid-template-columns: 1fr; }
  .layout-sidebar .quiz-map { position: static; }
  .layout-sidebar .map-grid { display: flex; }
}
@media (max-width: 560px) {
  .q { padding: 18px 16px; }
  .tf-group { grid-template-columns: 1fr 1fr; }
  .quiz-bar { top: 68px; }
  .quiz-bar-inner { flex-direction: column; align-items: stretch; gap: 8px; }
  .qb-stats { justify-content: space-between; }
  .quiz-nav .qbtn { flex: 1; }
  .qnav-pos { order: -1; flex-basis: 100%; }
}
