/* RGCC Practice — student UI styling.
   Self-contained, no external fonts/CDNs (works fully offline). */

:root {
  --bg: #0f1729;
  --bg-soft: #16213a;
  --panel: #ffffff;
  --panel-2: #f6f8fc;
  --ink: #1c2536;
  --ink-soft: #5a6577;
  --line: #e3e8f0;
  --brand: #4f7cff;
  --brand-dark: #3a63e0;
  --green: #1faa6c;
  --green-bg: #e7f7ef;
  --red: #d8443c;
  --red-bg: #fdeceb;
  --amber: #c98a16;
  --amber-bg: #fdf4e2;
  --shadow: 0 10px 30px rgba(16, 28, 56, 0.10);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(160deg, #0f1729 0%, #1a2540 100%);
}

.app {
  display: grid;
  grid-template-columns: 290px 1fr;
  height: 100vh;
  gap: 0;
}

/* ---------------- Sidebar ---------------- */
.sidebar {
  background: var(--bg-soft);
  color: #cdd6e6;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}
.brand-mark {
  width: 42px; height: 42px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), #7aa0ff);
  color: #fff;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: .5px;
  box-shadow: 0 6px 16px rgba(79, 124, 255, 0.45);
}
.brand-title { font-weight: 700; color: #fff; font-size: 16px; }
.brand-sub { font-size: 12px; color: #8da0bf; margin-top: 2px; }

.sidebar-label {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1.4px;
  color: #6f82a3;
  margin: 6px 6px 10px;
}

.skill-list { list-style: none; padding: 0; margin: 0; flex: 1; }
.skill-empty { color: #6f82a3; font-size: 13px; padding: 8px; }

.skill-item {
  padding: 11px 13px;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 6px;
  transition: background .15s, transform .05s;
  border: 1px solid transparent;
}
.skill-item:hover { background: rgba(255, 255, 255, 0.06); }
.skill-item.active {
  background: rgba(79, 124, 255, 0.16);
  border-color: rgba(79, 124, 255, 0.5);
}
.skill-item-title {
  color: #eaf0fb;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}
.skill-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  font-size: 11.5px;
  color: #8da0bf;
}
.diff-dots { letter-spacing: 1px; color: #7aa0ff; }

.sidebar-foot {
  margin-top: 18px;
  font-size: 11px;
  line-height: 1.5;
  color: #67789a;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 14px;
}

/* ---------------- Main ---------------- */
.main {
  background: var(--panel-2);
  border-radius: 0;
  overflow-y: auto;
  padding: 26px 32px 40px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.topbar-title h1 {
  font-size: 22px;
  margin: 0 0 6px;
  color: var(--ink);
}
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tags .tag {
  font-size: 11px;
  background: #e9eef9;
  color: #4a5a7a;
  padding: 3px 9px;
  border-radius: 20px;
}

.topbar-stats {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.stat { min-width: 96px; }
.stat-num { font-size: 26px; font-weight: 800; color: var(--ink); line-height: 1; }
.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-soft);
  margin: 4px 0 6px;
}
.bar {
  height: 6px;
  background: #e3e8f0;
  border-radius: 6px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 0%;
  background: var(--brand);
  border-radius: 6px;
  transition: width .4s ease;
}
.bar-fill.accuracy { background: var(--green); }

/* Mode toggle */
.mode-toggle {
  display: inline-flex;
  background: #e7ecf5;
  border-radius: 10px;
  padding: 3px;
}
.mode-btn {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.mode-btn.active {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: 0 2px 6px rgba(16, 28, 56, 0.10);
}

/* ---------------- Card ---------------- */
.card {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 30px;
  max-width: 820px;
}
.card-head { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.chip {
  font-size: 12px;
  font-weight: 600;
  background: var(--brand);
  color: #fff;
  padding: 4px 11px;
  border-radius: 20px;
}
.chip-soft { background: #eef2fb; color: #4a5a7a; }
.chip-ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); }

.stem {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 22px;
}

/* Answer rows */
.answers { display: flex; flex-direction: column; gap: 16px; }
.answer-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
  transition: border-color .15s, background .15s;
}
.answer-row.correct { border-color: var(--green); background: var(--green-bg); }
.answer-row.incorrect { border-color: var(--red); background: var(--red-bg); }
.answer-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}
.answer-input-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.answer-input, .answer-select {
  font: inherit;
  font-size: 16px;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  min-width: 160px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.answer-input:focus, .answer-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.15);
}
.answer-input:disabled, .answer-select:disabled {
  background: #f0f2f7;
  color: #7c879b;
  cursor: not-allowed;
}
.unit-suffix { color: var(--ink-soft); font-size: 15px; font-weight: 600; }

/* Conceptual MC as radio-style buttons */
.mc-options { display: flex; flex-direction: column; gap: 8px; }
.mc-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  transition: border-color .12s, background .12s;
}
.mc-option:hover { border-color: #bcc8e0; }
.mc-option input { accent-color: var(--brand); width: 17px; height: 17px; }
.mc-option.locked { cursor: not-allowed; opacity: .92; }

.answer-msg { font-size: 13px; font-weight: 600; }
.answer-row.correct .answer-msg { color: var(--green); }
.answer-row.incorrect .answer-msg { color: var(--red); }

/* Feedback banner */
.feedback {
  margin-top: 20px;
  padding: 13px 16px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
}
.feedback.ok { background: var(--green-bg); color: var(--green); }
.feedback.bad { background: var(--red-bg); color: var(--red); }
.feedback.partial { background: var(--amber-bg); color: var(--amber); }

/* Actions */
.actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.btn {
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 11px 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: transform .05s, background .15s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-secondary { background: var(--ink); color: #fff; }
.btn-secondary:hover:not(:disabled) { background: #2b384f; }
.btn-ghost {
  background: #fff;
  color: var(--brand-dark);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--brand); }

/* Hint box */
.hint-box {
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--amber-bg);
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  font-size: 14px;
  color: #7a5a12;
}
.hint-box .hint-line { margin: 4px 0; }
.hint-box .hint-line::before { content: "💡 "; }

/* Welcome */
.welcome { display: flex; }
.welcome-card {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 34px;
  max-width: 640px;
}
.welcome-card h2 { margin-top: 0; }
.welcome-card p { color: var(--ink-soft); line-height: 1.6; }
.welcome-list { color: var(--ink-soft); line-height: 1.7; padding-left: 20px; }

.hidden { display: none !important; }

/* Responsive */
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,.06);
  }
  .main { padding: 18px; }
}
