/* ============ TEST ENGINE — MatematikLab test/ödev çözme arayüzü ============ */
/* Sitenin kendi renk/tipografi değişkenlerini (style.css :root) kullanır. */

.test-shell { background: var(--bg-alt); min-height: 100vh; }

.test-topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.test-topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.test-topbar .eyebrow { font-family: var(--font-mono); font-size: 0.72rem; color: var(--violet); text-transform: uppercase; letter-spacing: .06em; }
.test-topbar h1 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; }
.test-meta { display: flex; align-items: center; gap: 14px; font-size: 0.8rem; color: var(--ink-soft); }
.test-progress { width: 150px; }
.test-progress-bar { height: 5px; border-radius: 999px; background: var(--lilac-50); overflow: hidden; }
.test-progress-fill { height: 100%; background: var(--violet); transition: width .25s ease; }

.test-container { max-width: 1180px; margin: 0 auto; padding: 28px 24px 100px; }
.test-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 1024px) { .test-grid { grid-template-columns: 2fr 1fr; align-items: start; } }
.test-grid.optic-only { grid-template-columns: 1fr; }

.tcard { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: 0 1px 2px rgba(28,26,34,0.03); }
.tcard + .tcard { margin-top: 14px; }

/* intro / student info */
.intro-wrap { min-height: 65vh; display: flex; align-items: center; justify-content: center; }
.intro-card { width: 100%; max-width: 420px; }
.intro-card label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.intro-card .req { color: #e11d48; }
.intro-card input {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line);
  font-family: var(--font-body); font-size: 0.9rem; outline: none; margin-bottom: 14px;
}
.intro-card input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px var(--lilac-50); }
.intro-card input.err { border-color: #e11d48; }
.field-err { color: #e11d48; font-size: 0.75rem; margin: -10px 0 12px; }
.btn-primary {
  width: 100%; padding: 13px; border: none; border-radius: 12px; cursor: pointer;
  background: linear-gradient(90deg, var(--violet), var(--violet-deep));
  color: #fff; font-weight: 600; font-size: 0.9rem; font-family: var(--font-body);
}
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 7px 12px; font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); cursor: pointer;
}
.btn-ghost:hover { border-color: var(--lilac-400); color: var(--violet); }

@keyframes shake {
  10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); } 40%, 60% { transform: translateX(4px); }
}
.shake { animation: shake .5s cubic-bezier(.36,.07,.19,.97) both; }

/* question card */
.qcard-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.qnum {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 999px;
  background: var(--violet); color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
}
.qtext { font-size: 0.92rem; line-height: 1.55; }
.q-image { display: block; max-width: 100%; max-height: 320px; object-fit: contain; border-radius: 12px; border: 1px solid var(--line); margin: 10px 0 14px 42px; }
@media (max-width: 640px) { .q-image { margin-left: 0; } }
.qoptions { display: grid; grid-template-columns: 1fr; gap: 8px; padding-left: 42px; }
@media (min-width: 640px) { .qoptions { grid-template-columns: 1fr 1fr; } }
.qoptions.qoptions-compact { display: flex; flex-wrap: wrap; gap: 10px; grid-template-columns: none; }
.qoption-letter-only { flex: 0 0 auto; padding: 10px 18px; }
.qoption-letter-only .letter { width: 26px; height: 26px; font-size: 0.8rem; }
.qoption {
  display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 12px; font-size: 0.85rem; cursor: pointer; background: #fff; text-align: left;
  font-family: var(--font-body); color: var(--ink);
}
.qoption:hover { border-color: var(--lilac-400); background: var(--lilac-50); }
.qoption .letter {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 999px; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 0.68rem; font-weight: 700; color: var(--ink-soft);
}
.qoption.selected { border-color: var(--violet); background: var(--lilac-50); }
.qoption.selected .letter { background: var(--violet); border-color: var(--violet); color: #fff; }
.qoption.correct { border-color: #10b981; background: #ecfdf5; color: #047857; }
.qoption.correct .letter { background: #10b981; border-color: #10b981; color: #fff; }
.qoption.wrong { border-color: #f43f5e; background: #fff1f2; color: #be123c; }
.qoption.wrong .letter { background: #f43f5e; border-color: #f43f5e; color: #fff; }
.qoption[disabled] { cursor: default; }
.qcard-icon svg { display: block; }

/* optic form */
.optic-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.optic-head h3 { font-family: var(--font-display); font-size: 0.92rem; font-weight: 700; }
.optic-badge { font-size: 0.7rem; font-weight: 700; color: var(--violet); background: var(--lilac-50); border-radius: 999px; padding: 2px 9px; }
.optic-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 7px 0; border-bottom: 1px solid var(--lilac-50); }
.optic-row:last-child { border-bottom: none; }
.optic-num { width: 22px; height: 22px; border-radius: 999px; background: var(--lilac-50); color: var(--violet-deep); font-size: 0.68rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.optic-bubbles { display: flex; gap: 6px; }
.bubble {
  width: 30px; height: 30px; border-radius: 999px; border: 2px solid var(--line);
  background: #fff; color: var(--ink-soft); font-size: 0.78rem; font-weight: 700; cursor: pointer;
}
.bubble.selected { background: var(--violet); border-color: var(--violet); color: #fff; }
.bubble.correct-selected { background: #10b981; border-color: #10b981; color: #fff; }
.bubble.wrong-selected { background: #f43f5e; border-color: #f43f5e; color: #fff; }
.bubble.correct-missed { border-color: #10b981; color: #047857; background: #ecfdf5; }
.bubble[disabled] { cursor: default; }
.optic-status { width: 42px; text-align: right; font-size: 0.72rem; color: var(--ink-soft); }

/* result card */
.result-card { position: relative; overflow: hidden; border: 1px solid var(--lilac-200); background: linear-gradient(135deg, var(--lilac-50), #fff); }
.result-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.result-icon { width: 44px; height: 44px; border-radius: 999px; background: var(--violet); color: #fff; display: flex; align-items: center; justify-content: center; }
.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 480px) { .result-grid { grid-template-columns: repeat(4, 1fr); } }
.result-stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.result-stat .num { font-size: 1.5rem; font-weight: 700; font-family: var(--font-display); }
.result-stat .lbl { font-size: 0.72rem; color: var(--ink-soft); margin-top: 2px; }
.result-bar-track { height: 10px; border-radius: 999px; background: var(--lilac-50); overflow: hidden; margin: 6px 0 18px; }
.result-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--violet), var(--violet-deep)); transition: width .7s ease; }

/* mobile drawer */
.optic-fab {
  position: fixed; bottom: 20px; right: 20px; z-index: 60;
  background: var(--violet); color: #fff; border: none; border-radius: 999px;
  padding: 12px 16px; font-size: 0.78rem; font-weight: 700; display: flex; align-items: center; gap: 8px;
  box-shadow: 0 8px 20px rgba(124,58,237,.35); cursor: pointer;
}
.optic-drawer-overlay { position: fixed; inset: 0; background: rgba(28,26,34,.4); z-index: 70; opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.optic-drawer-overlay.open { opacity: 1; pointer-events: auto; }
.optic-drawer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; background: #fff;
  border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; max-height: 75vh; overflow-y: auto;
  transform: translateY(100%); transition: transform .3s ease;
}
.optic-drawer.open { transform: translateY(0); }
.drawer-handle { display: flex; justify-content: center; padding: 10px 0; }
.drawer-handle span { width: 36px; height: 4px; border-radius: 999px; background: var(--line); }

@media (min-width: 1024px) { .optic-fab, .optic-drawer-overlay, .optic-drawer { display: none; } }
@media (max-width: 1023px) { .optic-sticky-desktop { display: none; } }
