/* ============================================================
   DESIGN TOKENS — Light & Dark
   ============================================================ */
:root {
  --navy:          #061737;
  --indigo:        #4f46e5;
  --indigo-hover:  #4338ca;
  --indigo-dim:    #eef2ff;
  --teal:          #0d9488;
  --teal-dim:      #f0fdfa;
  --amber:         #f59e0b;
  --green:         #10b981;
  --red:           #ef4444;

  /* Surface */
  --bg:            #f8fafc;
  --surface:       #ffffff;
  --surface-2:     #f1f5f9;
  --border:        #e2e8f0;

  /* Text */
  --text-primary:  #1e293b;
  --text-secondary:#64748b;
  --text-muted:    #94a3b8;

  /* Sidebar */
  --sidebar-bg:    #061737;
  --sidebar-text:  rgba(255,255,255,0.75);
  --sidebar-active:#4f46e5;
}

[data-theme="dark"] {
  --bg:            #0f172a;
  --surface:       #1e293b;
  --surface-2:     #334155;
  --border:        #334155;
  --text-primary:  #f1f5f9;
  --text-secondary:#94a3b8;
  --text-muted:    #64748b;
  --indigo-dim:    #1e1b4b;
  --teal-dim:      #042f2e;
  --sidebar-bg:    #020617;
  --sidebar-text:  rgba(255,255,255,0.65);
}

/* Ensure modal text is readable in dark mode */
[data-theme="dark"] .modal-sheet {
  background: var(--surface);
  color: var(--text-primary);
}
[data-theme="dark"] .modal-label,
[data-theme="dark"] .settings-item-secondary,
[data-theme="dark"] #modal-lib p,
[data-theme="dark"] #modal-feedback p {
  color: var(--text-secondary);
}
[data-theme="dark"] .wrong-answer-card {
  background: rgba(239, 68, 68, 0.15);
}
[data-theme="dark"] #modal-about p {
  color: var(--text-primary);
}
[data-theme="dark"] .explanation-box {
  background: rgba(16,185,129,0.1);
}

/* Option letter styling */
.opt-letter {
  width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: var(--indigo); flex-shrink: 0;
  transition: all 0.15s;
}
.option-item:hover .opt-letter { background: var(--indigo); color: white; border-color: var(--indigo); }
.option-item.correct .opt-letter { background: var(--green); color: white; border-color: var(--green); }
.option-item.incorrect .opt-letter { background: var(--red); color: white; border-color: var(--red); }
[data-theme="dark"] .opt-letter { background: #334155; color: #a5b4fc; }

/* ============================================================
   BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  font-size: 15px;
  transition: background 0.25s, color 0.25s;
}

/* Desktop gets bigger base font */
@media (min-width: 1024px) { body { font-size: 16px; } }
@media (min-width: 1280px) { body { font-size: 17px; } }

h1,h2,h3,h4,h5 { font-family: 'Be Vietnam Pro', sans-serif; }

/* TOAST */
.toast {
  position: fixed; bottom: 24px; right: 24px; padding: 12px 20px;
  background: #1e293b; color: white; border-radius: 12px; font-size: 13px;
  opacity: 0; transform: translateY(16px); transition: all 0.3s; pointer-events: none; z-index: 11000;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; border-radius: 14px; font-family: 'Inter', sans-serif; font-weight: 700; cursor: pointer; transition: all 0.15s; text-decoration: none; }
.btn-primary { background: var(--indigo); color: white; padding: 14px 28px; font-size: 15px; }
.btn-secondary { background: var(--surface); color: var(--text-primary); border: 1.5px solid var(--border); padding: 11px 22px; }
.btn-outline-indigo { background: transparent; color: var(--indigo); border: 1.5px solid var(--indigo); padding: 11px 22px; }
.btn-outline-indigo:hover { background: rgba(79,70,229,0.05); }
.btn-block { width: 100%; }
.w-full { width: 100%; }
.hidden { display: none !important; }
