/* sysTrainer — web stylesheet. Ported from app/styles.py.
   Palette: bg #0f1923, accent #4a90d9, correct #27a060, wrong #c0392b, amber #d4820a */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background-color: #0f1923;
  color: #e8eaf0;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Screen switching ── */
.screen { display: none; flex: 1; min-height: 100vh; flex-direction: column; }
.screen.active { display: flex; }
.hidden { display: none !important; }

.spacer { flex: 1; }

/* ── Buttons (ported from QPushButton) ── */
.btn {
  background-color: #1e3a5f;
  color: #e8eaf0;
  border: 1px solid #2d5a8e;
  border-radius: 6px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color .12s, border-color .12s;
}
.btn:hover { background-color: #2d5a8e; border-color: #4a90d9; }
.btn:active { background-color: #4a90d9; }
.btn:disabled { background-color: #1a2535; color: #4a5568; border-color: #2d3748; cursor: default; }

.btn.primary {
  background-color: #1e6b3c;
  border-color: #27a060;
  font-size: 15px;
  padding: 12px 32px;
}
.btn.primary:hover { background-color: #27a060; }
.btn.primary:disabled { background-color: #1a2535; color: #4a5568; border-color: #2d3748; }

.btn.link {
  background: transparent;
  border: none;
  color: #4a90d9;
  font-size: 13px;
  padding: 4px 8px;
  font-weight: 400;
  text-decoration: underline;
}
.btn.link:hover { color: #74b3f0; background: transparent; }

.btn.diff {
  background-color: #1a2535;
  border: 1px solid #2d3748;
  color: #8ba3c0;
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 4px;
}
.btn.diff:hover { background-color: #1e2d40; border-color: #3a5070; color: #c8d8e8; }
.btn.diff.active { background-color: #1e3a5f; border-color: #4a90d9; color: #4a90d9; }

/* ── Home ── */
.home-wrap {
  max-width: 620px;
  margin: 0 auto;
  padding: 60px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.title { font-size: 32px; font-weight: 700; color: #fff; letter-spacing: 1px; }
.subtitle { font-size: 16px; color: #8ba3c0; margin-top: 4px; }
.mode-buttons {
  display: flex; flex-direction: column; gap: 12px;
  margin: 48px 0 36px; width: 100%; max-width: 400px;
}
.mode-btn { width: 100%; }
.section-label { font-size: 18px; font-weight: 600; color: #c8d8e8; margin-bottom: 10px; }
.about-text { color: #8ba3c0; font-size: 13px; max-width: 500px; line-height: 1.6; }
.disclaimer { color: #4a5568; font-size: 11px; max-width: 560px; line-height: 1.5; margin-top: 32px; }

/* ── Config ── */
.config-wrap {
  max-width: 900px; width: 100%; margin: 0 auto;
  padding: 60px 80px; display: flex; flex-direction: column; flex: 1;
}
.config-title { font-size: 24px; font-weight: 700; color: #fff; margin-bottom: 20px; }
.count-row { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.count-row label { width: 200px; }
#count-input {
  width: 100px; background-color: #162030; border: 1px solid #2d5a8e;
  border-radius: 4px; padding: 6px 10px; font-size: 14px; color: #e8eaf0; font-family: inherit;
}
.filters-row { display: flex; gap: 32px; margin-bottom: 12px; }
.filter-col { flex: 1; }
.filter-col.wide { flex: 2; }
.filter-label { color: #c8d8e8; font-size: 13px; margin-bottom: 6px; }
.filter-label.dim { color: #4a5568; }
.list-box {
  max-height: 220px; overflow-y: auto;
  background-color: #162030; border: 1px solid #2d5a8e; border-radius: 4px;
}
.list-box.disabled { opacity: .45; pointer-events: none; }
.list-item { padding: 8px 12px; border-radius: 3px; cursor: pointer; font-size: 14px; }
.list-item:hover { background-color: #1a2d45; }
.list-item.selected { background-color: #1e3a5f; color: #4a90d9; }
.hint { color: #4a5568; font-size: 12px; margin-bottom: 24px; }
.button-bar { display: flex; align-items: center; margin-top: auto; }

/* ── Question ── */
.question-wrap {
  max-width: 900px; width: 100%; margin: 0 auto;
  padding: 40px 60px; display: flex; flex-direction: column; flex: 1;
}
.q-header { display: flex; justify-content: space-between; font-size: 13px; color: #8ba3c0; margin-bottom: 8px; }
.q-header-right { display: flex; align-items: center; gap: 20px; }
#q-timer { font-size: 14px; font-weight: 600; }
#q-category { color: #4a5568; font-size: 12px; }

.progress-track { height: 8px; background-color: #1a2535; border-radius: 4px; overflow: hidden; }
.progress-track.thin { height: 6px; }
.progress-fill { height: 100%; width: 0; background-color: #4a90d9; border-radius: 4px; transition: width .2s; }

.stem { font-size: 16px; color: #e8eaf0; line-height: 1.6; margin: 32px 0 28px; min-height: 60px; }

.choices { display: flex; flex-direction: column; gap: 4px; }

/* radio-style choices (question screen) */
.choice-radio {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 4px; font-size: 14px; color: #c8d8e8; cursor: pointer; border-radius: 4px;
}
.choice-radio:hover { color: #fff; }
.choice-radio .dot {
  flex-shrink: 0; width: 18px; height: 18px; border-radius: 9px;
  border: 2px solid #4a5568; background-color: #1a2535; margin-top: 2px;
}
.choice-radio.checked .dot { background-color: #4a90d9; border-color: #4a90d9; box-shadow: inset 0 0 0 3px #1a2535; }

.q-bottom { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 20px; }

/* ── Results ── */
.results-topbar {
  background-color: #162030; height: 100px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; padding: 0 60px;
}
.score { font-size: 28px; font-weight: 700; }
.score.green { color: #27a060; }
.score.amber { color: #d4820a; }
.score.red { color: #c0392b; }
.score-time { color: #8ba3c0; font-size: 13px; margin-top: 4px; }
.score-buttons { display: flex; gap: 12px; }
.results-scroll { flex: 1; overflow-y: auto; padding: 24px 60px 40px; display: flex; flex-direction: column; gap: 12px; }

.result-card {
  background-color: #162030; border: 1px solid #2d3748; border-radius: 8px; padding: 16px 20px;
}
.rc-header { display: flex; gap: 12px; align-items: center; font-size: 12px; color: #4a5568; margin-bottom: 8px; }
.rc-header .num { font-weight: 700; }
.rc-header .status { margin-left: auto; font-weight: 700; }
.rc-header .status.correct { color: #27a060; }
.rc-header .status.wrong { color: #c0392b; }
.rc-stem { font-size: 14px; color: #e8eaf0; margin-bottom: 8px; }
.rc-choice { font-size: 13px; padding: 2px 0; }
.rc-choice .marker { color: #4a5568; }
.exp-toggle { color: #4a90d9; font-size: 12px; cursor: pointer; margin-top: 4px; user-select: none; }
.exp-toggle:hover { color: #74b3f0; }
.exp-body {
  color: #c8d8e8; font-size: 13px; background-color: #0f1923; padding: 12px;
  border-left: 3px solid #2d5a8e; margin-top: 4px; line-height: 1.5;
}

/* ── Flashcard config ── */
.fc-config-wrap {
  max-width: 720px; width: 100%; margin: 0 auto;
  padding: 60px 80px; display: flex; flex-direction: column; flex: 1;
}
.fc-title { font-size: 28px; font-weight: 700; color: #fff; }
.fc-subtitle { color: #8ba3c0; font-size: 14px; margin: 6px 0 24px; }
.btn.big { min-height: 56px; width: 100%; }
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; }
.divider span { flex: 1; height: 1px; background-color: #2d3748; }
.divider em { color: #4a5568; font-size: 12px; font-style: normal; white-space: nowrap; }
.fc-toggle { display: flex; gap: 8px; margin-bottom: 10px; }
.fc-list-scroll { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.fc-list-scroll .btn { min-height: 46px; text-align: left; }
.back { align-self: flex-start; margin-top: 20px; }

/* ── Flashcard ── */
.flashcard-wrap {
  max-width: 820px; width: 100%; margin: 0 auto;
  padding: 32px 60px; display: flex; flex-direction: column; flex: 1;
}
.fc-header { display: flex; margin-bottom: 10px; }
.fc-info-row { display: flex; justify-content: space-between; font-size: 12px; color: #4a5568; margin: 6px 0 20px; }
#fc-score-label { font-size: 13px; font-weight: 600; }
#fc-score-label.dim { color: #4a5568; }
.fc-category { color: #4a90d9; font-size: 11px; font-weight: 600; letter-spacing: 1px; margin-bottom: 10px; }

/* flashcard answer buttons */
.fc-answer {
  text-align: left; padding: 12px 16px; font-size: 14px; min-height: 52px;
  background-color: #162030; border: 1px solid #2d3748; border-radius: 6px;
  color: #c8d8e8; cursor: pointer; font-family: inherit; width: 100%; display: block;
}
.fc-answer:hover:not(:disabled) { background-color: #1e3a5f; border-color: #4a90d9; }
.fc-answer:disabled { cursor: default; }
.fc-answer.correct { background-color: #1e6b3c; border: 2px solid #27a060; color: #fff; }
.fc-answer.wrong { background-color: #5a1e1e; border: 2px solid #c0392b; color: #fff; }
.fc-answer.dim { background-color: #0d1520; border: 1px solid #1a2535; color: #3a4a5a; }

.explanation-panel {
  background-color: #162030; border: 1px solid #2d3748; border-radius: 8px;
  padding: 14px 20px; margin-top: 16px;
}
.exp-header { font-weight: 700; color: #4a90d9; font-size: 11px; letter-spacing: 1px; margin-bottom: 6px; }
#fc-explanation-text { color: #c8d8e8; font-size: 13px; line-height: 1.5; }
.fc-next-row { display: flex; justify-content: flex-end; margin-top: 16px; }

#fc-done-view { flex: 1; display: flex; align-items: center; justify-content: center; }
.done-card {
  background-color: #162030; border: 1px solid #2d3748; border-radius: 8px;
  padding: 36px 40px; max-width: 460px; text-align: center;
}
.done-title { font-size: 22px; font-weight: 700; color: #fff; }
.done-score { font-size: 44px; font-weight: 700; color: #27a060; margin: 8px 0; }
.done-detail { color: #8ba3c0; font-size: 14px; margin-bottom: 20px; }
.done-buttons { display: flex; gap: 12px; justify-content: center; }

/* ── Scrollbars ── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background-color: #1a2535; border-radius: 4px; }
::-webkit-scrollbar-thumb { background-color: #2d5a8e; border-radius: 4px; }

#loading-error { padding: 60px; text-align: center; color: #c0392b; font-size: 16px; }
