:root {
  --saffron: #E8781A;
  --gold: #C4932A;
  --gold-light: #F2C96E;
  --lotus: #C9536E;
  --tulasi: #2D6A4F;
  --night: #0A1628;
  --night2: #0F1E35;
  --night3: #162236;
  --parchment: #F5EDD6;
  --cream: #FBF6EC;
  --muted: #8C7A5E;
  --ink: #120A00;
  --border: rgba(196,147,42,0.18);
  --border2: rgba(196,147,42,0.32);
  --glass: rgba(255,255,255,0.03);
  --glass2: rgba(255,255,255,0.055);
  --error: #C9536E;
  --success: #2D6A4F;
  --success-light: #7ECBA5;

}

.top-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  background: #111;
  border-bottom: 1px solid #333;
}

.tab {
  padding: 10px 18px;
  text-decoration: none;
  color: #ccc;
  font-family: 'JetBrains Mono', monospace;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.tab:hover {
  background: #222;
  color: #fff;
}

.tab.active {
  background: #444;
  color: #fff;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--night);
  color: var(--parchment);
  font-family: 'Crimson Pro', Georgia, serif;
  min-height: 100vh;
  line-height: 1.6;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 10%, rgba(196,147,42,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 80% 90%, rgba(232,120,26,0.05) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}

/* ── Layout ── */
.page { max-width: 960px; margin: 0 auto; padding: 0 24px 100px; position: relative; z-index: 1; }

/* ── Global Header/Nav ── */
.main-header {
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  background: rgba(10, 22, 40, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 48px;
  display: flex;
  align-items: center;
}

.nav-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 15px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(196,147,42,0.4));
}
.nav-title { font-family: 'Cinzel Decorative', serif; font-size: 14px; letter-spacing: .08em; color: var(--gold); }

.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-family: 'Cinzel Decorative', serif;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: color 0.3s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--gold);
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  gap: 6px;
}

.hamburger span {
  width: 24px;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(10px, 10px);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.nav-links.mobile-open {
  display: flex !important;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  gap: 0;
  background: rgba(10, 22, 40, 0.95);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  border-radius: 0;
  z-index: 999;
}

.nav-links.mobile-open a {
  padding: 14px 24px;
  display: block;
  width: 100%;
}

.nav-links.mobile-open a:hover {
  background: rgba(196, 147, 42, 0.1);
}

.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-user { font-size: 14px; color: var(--muted); font-style: italic; }

@keyframes glow {
  from { text-shadow: 0 0 12px rgba(196,147,42,0.35); }
  to   { text-shadow: 0 0 36px rgba(196,147,42,0.75), 0 0 72px rgba(232,120,26,0.25); }
}

/* ── Views / Content ── */
.view { display: none; padding-top: 48px; }
.view.active { display: block; }
.content-section { padding-top: 48px; }

/* ── Header Components ── */
.page-header { text-align: center; margin-bottom: 48px; }
.big-om { font-size: 52px; color: var(--gold); display: block; margin-bottom: 16px; animation: glow 3s ease-in-out infinite alternate; }
.big-logo {
  height: 80px;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 20px rgba(196,147,42,0.5));
}
h1 { font-family: 'Cinzel Decorative', serif; font-size: clamp(18px,3.5vw,28px); color: var(--gold); letter-spacing: .04em; line-height: 1.25; margin-bottom: 10px; }
h2 { font-family: 'Cinzel Decorative', serif; font-size: 18px; color: var(--saffron); margin-bottom: 15px; }
h3 { font-family: 'Cinzel Decorative', serif; font-size: 14px; color: var(--gold-light); margin-bottom: 10px; }
.tagline { font-style: italic; color: var(--muted); font-size: 16px; }

/* ── Cards ── */
.card {
  background: var(--glass2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px 36px;
  backdrop-filter: blur(6px);
  margin-bottom: 20px;
}
.card-sm { padding: 22px 28px; }

/* ── Forms ── */
.field { margin-bottom: 22px; }
.field:last-child { margin-bottom: 0; }
label {
  display: block;
  font-family: 'Cinzel Decorative', serif;
  font-size: 9px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--saffron); margin-bottom: 8px;
}
input[type=text], input[type=number], input[type=password], textarea {
  width: 100%;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(196,147,42,.22);
  border-radius: 10px;
  padding: 13px 18px;
  color: var(--parchment);
  font-family: 'Crimson Pro', serif;
  font-size: 18px;
  outline: none;
  transition: border-color .25s, box-shadow .25s;
}

@media (max-width: 600px) {
  input[type=text], input[type=number], input[type=password], textarea {
    font-size: 16px;
    padding: 11px 14px;
  }
}

input:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(196,147,42,.14);
}
input::placeholder { color: rgba(245,237,214,.22); font-style: italic; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; font-style: italic; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media(max-width:560px){ .row2 { grid-template-columns: 1fr; } }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px;
  border-radius: 10px; border: none; cursor: pointer;
  font-family: 'Cinzel Decorative', serif;
  font-size: 10px; letter-spacing: .09em;
  transition: transform .2s, box-shadow .2s, opacity .2s;
  text-decoration: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--saffron), var(--gold));
  color: var(--ink);
  box-shadow: 0 4px 24px rgba(232,120,26,.35);
  width: 100%; padding: 16px;
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 8px 36px rgba(232,120,26,.5); }

.btn-secondary {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--ink);
  box-shadow: 0 4px 24px rgba(196,147,42,.35);
}
.btn-secondary:hover:not(:disabled) { box-shadow: 0 8px 36px rgba(196,147,42,.5); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--gold);
}
.btn-ghost:hover:not(:disabled) { background: rgba(196,147,42,.1); }

.btn-danger {
  background: transparent;
  border: 1px solid rgba(201,83,110,.4);
  color: var(--lotus);
}
.btn-danger:hover:not(:disabled) { background: rgba(201,83,110,.1); }

.btn-success-fill {
  background: linear-gradient(135deg, var(--tulasi), #1a4a35);
  color: var(--success-light);
  border: 1px solid rgba(45,106,79,.5);
  box-shadow: 0 4px 20px rgba(45,106,79,.35);
}

.btn-sm { padding: 7px 14px; font-size: 9px; border-radius: 7px; }
.btn-xs { padding: 5px 10px; font-size: 8px; border-radius: 6px; }

/* ── Tabs ── */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 32px; }
.tab {
  padding: 12px 24px;
  font-family: 'Cinzel Decorative', serif; font-size: 9px; letter-spacing: .1em;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab:hover:not(.active) { color: var(--parchment); }

/* ── Status ── */
.status {
  display: none; border-radius: 10px; padding: 14px 18px; margin-bottom: 18px;
  font-size: 15px; align-items: center; gap: 10px;
}
.status.show { display: flex; }
.status.loading { background: rgba(196,147,42,.1); border: 1px solid rgba(196,147,42,.25); color: var(--gold-light); }
.status.error   { background: rgba(201,83,110,.1); border: 1px solid rgba(201,83,110,.3); color: #F5A3B7; }
.status.success { background: rgba(45,106,79,.1); border: 1px solid rgba(45,106,79,.3); color: var(--success-light); }
.spinner { width: 16px; height: 16px; flex-shrink: 0; border: 2px solid rgba(242,201,110,.25); border-top-color: var(--gold-light); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Quiz ID badge ── */
.quiz-id-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(196,147,42,.12); border: 1px solid var(--border2);
  border-radius: 8px; padding: 6px 14px;
  font-family: 'JetBrains Mono', monospace; font-size: 20px; color: var(--gold-light);
  letter-spacing: .15em;
}

/* ── Ornament ── */
.orn { display:flex; align-items:center; gap:14px; margin:28px 0; color:var(--gold); opacity:.3; font-size:13px; }
.orn::before,.orn::after { content:''; flex:1; height:1px; background:linear-gradient(to right,transparent,var(--gold),transparent); }

/* ── Section title ── */
.section-title {
  font-family: 'Cinzel Decorative', serif; font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--saffron); margin-bottom: 20px;
}

/* ── Question items ── */
.question-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 16px;
  background: var(--glass);
  position: relative;
}
.question-item.selected { border-color: var(--gold); background: rgba(196,147,42,.05); }
.q-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.q-select-cb { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--gold); flex-shrink: 0; cursor: pointer; }
.q-verse-ref { font-size: 11px; color: var(--muted); font-family: 'JetBrains Mono', monospace; margin-bottom: 4px; }
.q-text { font-size: 17px; color: var(--parchment); line-height: 1.5; }
.q-options-list { list-style: none; margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
@media(max-width:580px){ .q-options-list { grid-template-columns: 1fr; } }
.q-opt { display: flex; gap: 8px; font-size: 14px; color: rgba(245,237,214,.6); align-items: flex-start; }
.q-opt.correct-opt { color: var(--success-light); }
.opt-letter { color: var(--gold); font-weight: 600; flex-shrink: 0; font-size: 13px; }
.q-expl { font-size: 13px; font-style: italic; color: var(--muted); margin-top: 8px; border-top: 1px solid var(--border); padding-top: 8px; }
.q-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ── Take quiz: options ── */
.answer-options { list-style: none; margin-top: 14px; }
.answer-option {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 18px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; transition: all .2s;
  font-size: 16px; color: rgba(245,237,214,.8);
}
.answer-option:hover { border-color: var(--gold); background: rgba(196,147,42,.08); }
.answer-option.selected { border-color: var(--saffron); background: rgba(232,120,26,.1); color: var(--parchment); }
.answer-option.correct { border-color: var(--tulasi); background: rgba(45,106,79,.15); color: var(--success-light); }
.answer-option.wrong   { border-color: var(--lotus); background: rgba(201,83,110,.1); color: #F5A3B7; }
.answer-option input[type=radio] { display: none; }
.opt-circle { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border2); flex-shrink: 0; margin-top: 1px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: bold; transition: all .2s; }
.answer-option.selected .opt-circle { border-color: var(--saffron); background: var(--saffron); color: var(--ink); }
.answer-option.correct .opt-circle { border-color: var(--tulasi); background: var(--tulasi); color: white; }
.answer-option.wrong   .opt-circle { border-color: var(--lotus); background: var(--lotus); color: white; }

/* ── Progress ── */
.progress-bar-wrap { background: rgba(255,255,255,.06); border-radius: 99px; height: 5px; margin-bottom: 6px; }
.progress-bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--saffron), var(--gold)); transition: width .4s ease; }

/* ── Stats row ── */
.stats { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.stat { background: rgba(196,147,42,.07); border: 1px solid var(--border); border-radius: 10px; padding: 14px 20px; font-size: 13px; color: var(--muted); flex: 1; min-width: 100px; text-align: center; }
.stat strong { display: block; font-size: 24px; color: var(--gold); font-family: 'Crimson Pro', serif; line-height: 1.2; }

/* ── Table ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.data-table th { font-family: 'Cinzel Decorative', serif; font-size: 8px; letter-spacing: .1em; color: var(--saffron); padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; }
.data-table td { padding: 12px 14px; border-bottom: 1px solid rgba(196,147,42,.08); color: rgba(245,237,214,.75); vertical-align: middle; }
.data-table tr:hover td { background: rgba(196,147,42,.04); }

/* ── Score circle ── */
.score-circle {
  width: 120px; height: 120px; border-radius: 50%;
  border: 4px solid var(--gold);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  background: radial-gradient(circle, rgba(196,147,42,.15), transparent);
}
.score-pct { font-size: 32px; color: var(--gold); font-family: 'Crimson Pro', serif; line-height: 1; }
.score-label { font-size: 11px; color: var(--muted); }

/* ── Quiz list cards ── */
.quiz-list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 24px;
  border: 1px solid var(--border); border-radius: 12px;
  margin-bottom: 12px;
  background: var(--glass);
  transition: border-color .2s, background .2s;
}
.quiz-list-item:hover { border-color: var(--border2); background: var(--glass2); }
.quiz-list-left { flex: 1; }
.quiz-list-id { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--gold); letter-spacing: .12em; }
.quiz-list-title { font-size: 17px; color: var(--parchment); margin: 2px 0; }
.quiz-list-meta { font-size: 12px; color: var(--muted); }
.quiz-list-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Badge ── */
.badge { display: inline-flex; padding: 2px 10px; border-radius: 99px; font-size: 11px; font-family: 'Cinzel Decorative', serif; letter-spacing: .06em; }
.badge-active { background: rgba(45,106,79,.2); color: var(--success-light); border: 1px solid rgba(45,106,79,.4); }
.badge-inactive { background: rgba(201,83,110,.15); color: #F5A3B7; border: 1px solid rgba(201,83,110,.3); }
.badge-draft { background: rgba(255,193,7,.2); color: #FFD700; border: 1px solid rgba(255,193,7,.4); }

/* ── Modal ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(5,10,20,.88); z-index: 1000;
  align-items: center; justify-content: center;
  padding: 20px 16px; overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--night2); border: 1px solid var(--border2);
  border-radius: 20px; padding: 28px;
  width: 100%; max-width: 740px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

@media (max-width: 600px) {
  .modal-overlay { padding: 12px 12px; }
  .modal { padding: 20px; border-radius: 16px; }
}
.modal-title { font-family: 'Cinzel Decorative', serif; font-size: 14px; letter-spacing: .08em; color: var(--gold); margin-bottom: 24px; }

@media (max-width: 600px) {
  .modal-title { font-size: 13px; margin-bottom: 18px; }
}

.modal-close { position: absolute; top: 20px; right: 24px; background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; }
.modal-close:hover { color: var(--parchment); }

/* ── ID entry ── */
.id-entry-grid { display: flex; gap: 10px; justify-content: center; margin: 24px 0; }
.id-digit {
  width: 60px; height: 72px;
  background: rgba(0,0,0,.4);
  border: 2px solid rgba(196,147,42,.25);
  border-radius: 12px;
  font-family: 'JetBrains Mono', monospace; font-size: 32px; color: var(--gold);
  text-align: center; outline: none;
  transition: border-color .25s, box-shadow .25s;
}
.id-digit:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(196,147,42,.18); }

/* ── File Cards (Generic) ── */
.file-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.file-card {
  background: var(--glass2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: transform 0.2s, background 0.2s;
}
.file-card:hover {
  transform: translateY(-4px);
  background: var(--glass);
  border-color: var(--gold);
}
.file-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.file-card a {
  display: block;
  font-family: 'Cinzel Decorative', serif;
  font-size: 10px;
  color: var(--gold);
  text-decoration: none;
  margin-top: 8px;
  word-break: break-all;
}

footer { text-align: center; margin-top: 64px; font-size: 13px; color: rgba(140,122,94,.4); font-style: italic; padding-bottom: 40px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-links { display: none; } /* Hide by default on mobile */
  .nav-container { padding: 10px 16px; }
  .nav-logo { height: 24px; }
  .nav-title { font-size: 12px; }
  .hamburger { display: flex; } /* Show hamburger on mobile */
}

@media (max-width: 600px) {
  .nav-container { padding: 8px 12px; }
  .nav-logo { height: 20px; }
  .nav-title { font-size: 11px; }
  .id-digit { width: 50px; height: 60px; font-size: 24px; }
  .page { padding: 0 12px 80px; }
}
