/* Tema cyber gelap, senada dengan game (config/theme.py) */
:root {
  --bg-deep: #080c1c;
  --bg-panel: #10162c;
  --bg-panel-2: #171e3a;
  --primary: #00c8ff;
  --accent: #2878ff;
  --success: #3ce6a0;
  --danger: #ff506e;
  --text: #e6f0ff;
  --muted: #8ca0c8;
  --radius: 12px;
}

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

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.85rem; }
.error { color: var(--danger); font-size: 0.85rem; margin-top: 8px; }

/* ===== tombol ===== */
.btn {
  border: 1px solid var(--accent);
  background: var(--bg-panel-2);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { background: var(--accent); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--accent); border-color: var(--primary); }
.btn.primary:hover { background: var(--primary); color: #04121f; }
.btn.danger { border-color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: #2a3558; }
.btn.ghost:hover { border-color: var(--primary); }
.btn.small { padding: 5px 12px; font-size: 0.8rem; }

/* ===== login ===== */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  background: var(--bg-panel);
  border: 1px solid #223058;
  border-radius: 16px;
  padding: 40px;
  width: min(420px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 0 60px rgba(0, 200, 255, 0.08);
}
.login-card h1 { font-size: 1.6rem; letter-spacing: 2px; }
.login-card h1 span, .brand span { color: var(--primary); }

label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--muted); }
input, textarea {
  background: var(--bg-deep);
  border: 1px solid #2a3558;
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
}
input:focus, textarea:focus { outline: none; border-color: var(--primary); }

/* ===== layout app ===== */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 280px;
  background: var(--bg-panel);
  border-right: 1px solid #1c2646;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.brand { font-size: 1.2rem; font-weight: 700; letter-spacing: 2px; margin-bottom: 8px; }
.side-head { display: flex; align-items: center; justify-content: space-between; }
.side-head h2 { font-size: 0.95rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.side-foot { margin-top: auto; }

.category-list { list-style: none; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.category-list li {
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid transparent;
  transition: background 0.15s;
}
.category-list li:hover { background: var(--bg-panel-2); }
.category-list li.active { background: var(--bg-panel-2); border-color: var(--primary); }
.category-list li.inactive { opacity: 0.45; }
.category-list .count {
  background: var(--bg-deep);
  border-radius: 20px;
  font-size: 0.75rem;
  padding: 2px 10px;
  color: var(--muted);
}

.main { flex: 1; padding: 32px 40px; overflow-y: auto; }
.empty { display: flex; align-items: center; justify-content: center; height: 60vh; color: var(--muted); }
.main-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.main-head h2 { font-size: 1.4rem; }
.main-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== kartu soal ===== */
.question-list { display: flex; flex-direction: column; gap: 14px; }
.question-card {
  background: var(--bg-panel);
  border: 1px solid #1c2646;
  border-radius: var(--radius);
  padding: 18px 20px;
}
.question-card.inactive { opacity: 0.5; }
.question-card .q-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.question-card .q-text { font-weight: 600; font-size: 1.02rem; line-height: 1.45; }
.question-card .q-meta { color: var(--muted); font-size: 0.78rem; margin-top: 4px; }
.question-card .q-actions { display: flex; gap: 6px; flex-shrink: 0; }
.option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-top: 12px; }
.option-pill {
  border: 1px solid #2a3558;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.88rem;
  color: var(--muted);
}
.option-pill.correct { border-color: var(--success); color: var(--success); }

/* ===== modal ===== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(2, 6, 18, 0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
}
.modal {
  background: var(--bg-panel);
  border: 1px solid #223058;
  border-radius: 16px;
  padding: 28px;
  width: min(640px, 94vw);
  max-height: 92vh;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
}
.modal h3 { font-size: 1.15rem; }
.row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.row label { flex: 1; min-width: 120px; }
.check-inline { flex-direction: row !important; align-items: center; gap: 8px; min-width: auto !important; }
.check-inline input { width: 18px; height: 18px; }

.options-head { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.options-head h4 { font-size: 0.9rem; }
.option-row { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.option-row input[type="radio"] { width: 18px; height: 18px; accent-color: var(--success); }
.option-row input[type="text"] { flex: 1; }
.option-row .btn { padding: 8px 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* ===== toast ===== */
.toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  background: var(--bg-panel-2);
  border: 1px solid var(--primary);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 22px;
  font-size: 0.9rem;
  z-index: 99;
  box-shadow: 0 4px 30px rgba(0, 200, 255, 0.2);
}
.toast.err { border-color: var(--danger); }
