/* ── Google Noto Fonts — covers all 6 scripts ──────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;600;700&family=Noto+Sans+Devanagari:wght@400;600;700&family=Noto+Sans+Gujarati:wght@400;600;700&family=Noto+Sans+Kannada:wght@400;600;700&family=Noto+Sans+Tamil:wght@400;600;700&family=Noto+Sans+Telugu:wght@400;600;700&display=swap');

/* ── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --saffron:   #FF6B00;
  --gold:      #FFD700;
  --cream:     #FFF8EE;
  --white:     #FFFFFF;
  --text:      #2C1A00;
  --muted:     #7A5C35;
  --correct:   #1A8C3A;
  --wrong:     #C0392B;
  --hint-bg:   #FFF3DC;
  --shadow:    0 4px 16px rgba(255,107,0,0.12);
  --radius:    14px;
}

body {
  font-family: 'Noto Sans Devanagari', 'Noto Sans Gujarati', 'Noto Sans Kannada',
               'Noto Sans Tamil', 'Noto Sans Telugu', 'Noto Sans', sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
}

/* ── Header ────────────────────────────────────────────────────────────── */
.site-header {
  width: 100%;
  display: block;
  text-align: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  line-height: 0;
}

.site-header img.logo {
  width: 100%;
  display: block;
}

.site-title { display: none; }

/* ── Sub-nav (below logo banner) ───────────────────────────────────────── */
.sub-nav {
  background: linear-gradient(135deg, var(--saffron) 0%, #FF9500 60%, var(--gold) 100%);
  padding: 7px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.sub-nav-left {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.nav-icon-btn {
  background: rgba(255,255,255,0.25);
  color: var(--white);
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 1rem;
  border: 1px solid rgba(255,255,255,0.4);
  transition: background 0.2s;
}

.nav-icon-btn:hover { background: rgba(255,255,255,0.45); }

/* ── Language Selector (inside sub-nav) ─────────────────────────────────── */
.lang-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.lang-bar label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
}

.lang-select {
  background: rgba(255,255,255,0.92);
  border: none;
  color: var(--text);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

.lang-select:focus { box-shadow: 0 0 0 2px rgba(255,255,255,0.6); }

/* ── Main Container ─────────────────────────────────────────────────────── */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* ── Score Dashboard ────────────────────────────────────────────────────── */
.score-board {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.score-pills {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.pill {
  background: var(--cream);
  border: 1.5px solid #DDCBB0;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.pill-progress { border-color: var(--saffron); color: var(--saffron); }
.pill-correct  { border-color: var(--correct);  color: var(--correct);  }
.pill-wrong    { border-color: var(--wrong);    color: var(--wrong);    }
.pill-pct      { border-color: #B8860B;         color: #B8860B;         }

.progress-bar-wrap {
  height: 10px;
  background: #EEE;
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--saffron), var(--gold));
  border-radius: 10px;
  transition: width 0.4s;
}

/* ── Navigation ─────────────────────────────────────────────────────────── */
.nav-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.btn {
  padding: 8px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.18s;
}

.btn-primary {
  background: var(--saffron);
  color: var(--white);
}

.btn-primary:hover { background: #E05A00; }

.btn-outline {
  background: var(--white);
  border: 1.5px solid var(--saffron);
  color: var(--saffron);
}

.btn-outline:hover { background: #FFF0E6; }

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.jump-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.jump-wrap input {
  width: 56px;
  padding: 7px 8px;
  border: 1.5px solid #DDCBB0;
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: center;
  font-family: inherit;
}

/* ── Quiz Card ───────────────────────────────────────────────────────────── */
.quiz-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 6px solid transparent;
  border-image: linear-gradient(180deg, var(--saffron), var(--gold)) 1;
  padding: 24px;
  margin-bottom: 20px;
}

.question-meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.q-position {
  font-size: 0.72rem;
  color: var(--saffron);
  font-weight: 600;
}

.question-text {
  font-size: 1.18rem;
  font-weight: 600;
  line-height: 1.55;
  margin-bottom: 20px;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

@media (max-width: 520px) { .options-grid { grid-template-columns: 1fr; } }

.option-btn {
  background: var(--cream);
  border: 1.5px solid #DDCBB0;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 1.05rem;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.option-btn:hover:not(:disabled) { border-color: var(--saffron); background: #FFF0E6; }

.option-btn.selected-opt {
  background: #FFF0E6;
  border-color: var(--saffron);
  border-width: 2.5px;
}

.option-btn.selected-opt .opt-label { background: var(--saffron); }

.option-btn .opt-label {
  background: var(--saffron);
  color: var(--white);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.option-btn.correct {
  background: #E6F9ED;
  border-color: var(--correct);
}

.option-btn.correct .opt-label { background: var(--correct); }

.option-btn.wrong {
  background: #FDECEA;
  border-color: var(--wrong);
}

.option-btn.wrong .opt-label { background: var(--wrong); }

.option-btn:disabled { cursor: default; }

.card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Hint Panel ──────────────────────────────────────────────────────────── */
.hint-panel {
  background: var(--hint-bg);
  border: 1.5px solid #F0C060;
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 16px;
  display: none;
}

.hint-panel.open { display: block; }

.hint-ref {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.hint-ref-item {
  background: var(--saffron);
  color: var(--white);
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.hint-q-repeat {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px dashed #DDB870;
}

.hint-q-repeat p {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.hint-q-repeat ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

@media (max-width: 520px) { .hint-q-repeat ul { grid-template-columns: 1fr; } }

.hint-q-repeat li {
  font-size: 0.95rem;
  padding: 4px 8px;
  background: rgba(255,255,255,0.6);
  border-radius: 6px;
}

.hint-text-box {
  background: var(--white);
  border-radius: 8px;
  padding: 14px;
  font-size: 0.98rem;
  line-height: 1.7;
  white-space: pre-wrap;
  color: var(--text);
  border: 1px solid #E8D090;
  border-left: 3px solid #C8A020;
}

.hint-text-box.empty {
  color: var(--muted);
  font-style: italic;
  border-left-color: #DDD;
}

.hint-translation {
  background: rgba(255,255,255,0.55);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.93rem;
  line-height: 1.65;
  color: var(--muted);
  font-style: italic;
  margin-top: 8px;
  border: 1px solid #E8D090;
}

.hint-adhikar {
  display: inline-block;
  background: #FFF0D8;
  border: 1px solid #E8C060;
  color: #7A5010;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}

/* ── Quiz Style 3: Summary page ────────────────────────────────────────── */

.summary-header {
  text-align: center;
  margin-bottom: 16px;
}
.summary-header h2 {
  color: var(--saffron);
  font-size: 1.25rem;
  margin-bottom: 4px;
}
.summary-header p {
  color: var(--muted);
  font-weight: 600;
}
.summary-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.summary-item {
  background: var(--white);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  border-left: 4px solid var(--saffron);
}
.summary-item.is-correct { border-left-color: var(--correct); background: rgba(26,140,58,0.06); }
.summary-item.is-wrong   { border-left-color: var(--wrong);   background: rgba(192,57,43,0.06); }
.summary-q {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
  margin-bottom: 6px;
}
.summary-q .summary-qnum {
  color: var(--saffron);
  margin-right: 4px;
}
.summary-a {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.82rem;
  color: var(--muted);
  align-items: center;
}
.summary-a .summary-sel  { }
.summary-a .summary-cor  { }
.summary-a .summary-mark { font-size: 0.95rem; margin-left: auto; }

/* ── Quiz Style 5 / 6: Lead capture form (shown before Q1) ─────────────────── */

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 380px;
  margin: 0 auto;
}
.lead-form h2 {
  color: var(--saffron);
  font-size: 1.1rem;
  text-align: center;
  margin-bottom: 4px;
}
.lead-form p.lead-sub {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  margin-bottom: 4px;
}
.lead-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.lead-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border, #F0D8A0);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}
.lead-field input:focus {
  outline: none;
  border-color: var(--saffron);
}
.lead-error {
  color: var(--wrong);
  font-size: 0.8rem;
  text-align: center;
  min-height: 1em;
}

/* Style card selector on index/preview pages */
.quiz-style-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.quiz-style-btn {
  display: block;
  text-align: center;
  padding: 7px 0;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid var(--saffron);
  color: var(--saffron);
  transition: all 0.15s;
}
.quiz-style-btn:hover { background: var(--saffron); color: var(--white); }

/* ── Fallback notice ─────────────────────────────────────────────────────── */
.fallback-notice {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--wrong);
  margin-top: 6px;
}

/* ── Flashcard ───────────────────────────────────────────────────────────── */
.flashcard-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
}

.mode-toggle {
  background: var(--white);
  border: 1.5px solid var(--saffron);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
}

.mode-toggle button {
  border: none;
  background: none;
  padding: 7px 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--saffron);
  transition: all 0.15s;
}

.mode-toggle button.active {
  background: var(--saffron);
  color: var(--white);
}

.fc-score-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.fc-pill {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--cream);
  border: 1.5px solid #DDCBB0;
}

.fc-pill.known   { border-color: var(--correct); color: var(--correct); }
.fc-pill.unknown { border-color: var(--wrong);   color: var(--wrong);   }

/* Card flip container */
.fc-scene {
  perspective: 1000px;
  margin-bottom: 20px;
  min-height: 300px;
  cursor: pointer;
}

.fc-card {
  position: relative;
  width: 100%;
  min-height: 300px;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(.4,0,.2,1);
}

.fc-card.flipped { transform: rotateY(180deg); }

.fc-face {
  position: absolute;
  top: 0; left: 0; right: 0;
  min-height: 300px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 6px solid transparent;
  border-image: linear-gradient(180deg, var(--saffron), var(--gold)) 1;
  padding: 24px;
}

.fc-face.back { transform: rotateY(180deg); }

.fc-tap-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 10px;
  opacity: 0.7;
}

.fc-question {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.55;
  margin-bottom: 18px;
}

.fc-options {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 520px) { .fc-options { grid-template-columns: 1fr; } }

.fc-options li {
  background: var(--cream);
  border: 1.5px solid #DDCBB0;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 1rem;
}

.fc-options li.correct-opt {
  background: #E6F9ED;
  border-color: var(--correct);
  font-weight: 700;
  color: var(--correct);
}

.fc-hint-box {
  margin-top: 16px;
  background: var(--hint-bg);
  border: 1px solid #E8D090;
  border-radius: 10px;
  padding: 14px;
  font-size: 0.9rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.fc-hint-ref {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--saffron);
  margin-bottom: 6px;
}

.fc-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
}

.btn-know {
  background: var(--correct);
  color: var(--white);
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-know:hover { opacity: 0.85; }

.btn-dontknow {
  background: var(--wrong);
  color: var(--white);
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-dontknow:hover { opacity: 0.85; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .site-header { flex-wrap: wrap; }
  .nav-links { margin-left: 0; }
  .quiz-card { padding: 16px; }
  .fc-face   { padding: 16px; }
}
