/* StudySpark — plain CSS, no build step, no external assets. */

:root {
  --bg: #0f1226;
  --panel: #1a1e3a;
  --panel-2: #232850;
  --ink: #eef0ff;
  --muted: #a7abd0;
  --accent: #ffb020;      /* Firebase-ish amber */
  --accent-2: #ff8a3d;
  --good: #2fbf71;
  --bad: #e5484d;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(180deg, #0f1226 0%, #141736 100%);
  color: var(--ink);
  min-height: 100vh;
}

.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { padding: 36px 0 8px; }
.header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
h1 { margin: 0; font-size: 2.2rem; letter-spacing: -0.02em; }
.tagline { color: var(--muted); margin: 6px 0 0; font-size: 1.05rem; }

.badge {
  font-size: 0.8rem; font-weight: 700; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--muted); color: var(--muted); white-space: nowrap;
}
.badge-demo { border-color: var(--accent); color: var(--accent); }
.badge-live { border-color: var(--good); color: var(--good); }
.badge-error { border-color: var(--bad); color: var(--bad); }

/* Demo banner */
.demo-banner {
  background: #3a2c07; border-top: 1px solid var(--accent); border-bottom: 1px solid var(--accent);
  color: #ffe1a1; padding: 14px 0; font-size: 0.95rem; line-height: 1.5; margin-top: 16px;
}
.demo-banner code { background: rgba(0,0,0,.35); padding: 1px 6px; border-radius: 6px; }

/* Panels */
.panel {
  background: var(--panel); border: 1px solid #2c3160; border-radius: var(--radius);
  padding: 22px; margin: 22px 0;
}
.panel h2 { margin: 0 0 14px; font-size: 1.3rem; }
.panel h2 .sub { color: var(--muted); font-size: 0.9rem; font-weight: 400; }
.panel-label { display: block; font-weight: 700; margin-bottom: 10px; }

textarea {
  width: 100%; resize: vertical; border-radius: 10px; border: 1px solid #3a3f74;
  background: var(--panel-2); color: var(--ink); padding: 14px; font: inherit; line-height: 1.55;
}
textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.controls { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-top: 14px; }
.mode-select { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--muted); flex: 1 1 260px; }
.mode-select select {
  padding: 10px; border-radius: 10px; border: 1px solid #3a3f74;
  background: var(--panel-2); color: var(--ink); font: inherit; font-size: 0.95rem;
}

.btn {
  font: inherit; font-weight: 700; border-radius: 10px; padding: 11px 18px; cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary { background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #231600; }
.btn-primary:hover { filter: brightness(1.07); }
.btn-primary:disabled { opacity: 0.55; cursor: wait; }
.btn-ghost { background: transparent; color: var(--ink); border-color: #3a3f74; }
.btn-ghost:hover { border-color: var(--muted); }

.status { min-height: 1.4em; color: var(--muted); margin: 12px 0 0; }
.status.error { color: var(--bad); }
.hint { color: var(--muted); font-size: 0.9rem; line-height: 1.55; margin: 10px 0 0; }

.sample-tag {
  display: inline-block; background: #3a2c07; color: var(--accent); border: 1px solid var(--accent);
  font-size: 0.78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; margin: 0 0 12px;
}
/* The class-level `display` above would otherwise override the `hidden`
   attribute, leaving the demo-mode chips visible on live output. */
.sample-tag[hidden] { display: none; }

.summary-text { font-size: 1.08rem; line-height: 1.7; margin: 0; }

/* Flashcards */
.flashcard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.flashcard { perspective: 900px; height: 170px; cursor: pointer; }
.flashcard-inner {
  position: relative; width: 100%; height: 100%; transition: transform .45s;
  transform-style: preserve-3d;
}
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 12px; padding: 16px; display: flex; align-items: center; justify-content: center;
  text-align: center; line-height: 1.5; overflow: auto;
}
.flashcard-front { background: var(--panel-2); border: 1px solid #3a3f74; font-weight: 600; }
.flashcard-back { background: #2c2150; border: 1px solid var(--accent-2); transform: rotateY(180deg); }

/* Quiz */
.quiz-q { border: 1px solid #2c3160; border-radius: 12px; padding: 16px; margin-bottom: 14px; background: rgba(255,255,255,0.02); }
.quiz-q p { margin: 0 0 12px; font-weight: 600; line-height: 1.5; }
.quiz-options { display: grid; gap: 8px; }
.quiz-option {
  text-align: left; font: inherit; padding: 10px 14px; border-radius: 10px; cursor: pointer;
  background: var(--panel-2); color: var(--ink); border: 1px solid #3a3f74;
}
.quiz-option:hover { border-color: var(--muted); }
.quiz-option.selected { border-color: var(--accent); background: #35301a; }
.quiz-option.correct { border-color: var(--good); background: rgba(47,191,113,.15); }
.quiz-option.wrong { border-color: var(--bad); background: rgba(229,72,77,.15); }
.quiz-explanation { color: var(--muted); font-size: 0.92rem; line-height: 1.5; margin: 10px 0 0; }
.quiz-footer { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.quiz-score { font-weight: 700; }

/* Footer */
.site-footer { padding: 26px 0 40px; color: var(--muted); font-size: 0.92rem; }
.site-footer p { margin: 4px 0; }
.foot-note { font-size: 0.82rem; }
