/* ============================================================
   VidyaPeeth — Main Stylesheet  (vidyapeeth.css)
   Design: Gold · Cream · Saffron · Scholarly Indian Academia
   Fonts: Cormorant Garamond (display) · Outfit (body) · JetBrains Mono (timer/code)
   ============================================================ */

/* ── GOOGLE FONTS (loaded in layout.php head) ── */
/* Cormorant+Garamond, Outfit, JetBrains+Mono */

/* ── CSS VARIABLES ── */
:root {
  --gold:       #d4a017;
  --gold-lt:    #f5d060;
  --gold-dk:    #9a7010;
  --saffron:    #e8650a;
  --saffron-lt: #f5924a;
  --saffron-dk: #b04a05;
  --cream:      #fdf6e3;
  --cream2:     #f9eed0;
  --cream3:     #f2e0b0;
  --ivory:      #fffef8;
  --parchment:  #f7f0dc;
  --ink:        #1a0f00;
  --ink2:       #3d2608;
  --ink3:       #6b4423;
  --ink4:       #9a6a3a;
  --green-ok:   #15803d;
  --red-err:    #b91c1c;
  --blue-info:  #1d4ed8;
  --purple:     #6b21a8;
  --shadow-sm:  0 2px 18px rgba(154,112,16,.07), inset 0 1px 0 rgba(255,255,255,.9);
  --shadow-md:  0 8px 32px rgba(154,112,16,.12);
  --shadow-lg:  0 14px 42px rgba(154,112,16,.14), 0 2px 8px rgba(212,160,23,.12);
}

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Outfit', 'Segoe UI', sans-serif;
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.6;
}
h1, h2, h3, h4, .serif { font-family: 'Cormorant Garamond', Georgia, serif; }
.mono, code, .timer { font-family: 'JetBrains Mono', 'Courier New', monospace; }

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  opacity: .5;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--cream2); }
::-webkit-scrollbar-thumb { background: var(--cream3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ── LAYOUT ── */
.page-wrap { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
main { position: relative; z-index: 1; }

/* ── NAV ── */
.glass-nav {
  background: rgba(253,246,227,.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(212,160,23,.25);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
}
.nav-logo {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--saffron), var(--gold-dk));
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700; color: #fff; font-size: 14px;
  letter-spacing: .5px;
}
.nav-brand-text { line-height: 1.2; }
.nav-brand-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem; font-weight: 700; color: var(--ink);
}
.nav-brand-sub { font-size: 0.7rem; color: var(--ink3); }
.nav-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nav-user {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--ink2);
}
.nav-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--saffron), var(--gold));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
}

/* Gold strip */
.gold-strip {
  height: 3px;
  background: linear-gradient(90deg, var(--saffron), var(--gold), var(--saffron));
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: 'Outfit', sans-serif; font-weight: 600;
  border-radius: 10px; cursor: pointer; border: none; outline: none;
  transition: all .18s; white-space: nowrap; text-decoration: none;
  padding: 10px 22px; font-size: 14px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--saffron), var(--gold-dk));
  color: #fff;
  box-shadow: 0 4px 14px rgba(232,101,10,.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--saffron-dk), #7a5808);
  box-shadow: 0 6px 20px rgba(232,101,10,.4);
  transform: translateY(-1px); color: #fff;
}
.btn-secondary {
  background: rgba(212,160,23,.12);
  border: 1.5px solid rgba(212,160,23,.4);
  color: var(--ink2);
}
.btn-secondary:hover {
  background: rgba(212,160,23,.2);
  border-color: var(--gold); color: var(--ink);
}
.btn-ghost {
  background: transparent;
  color: var(--ink3); padding: 8px 16px; font-size: 13px; font-weight: 500;
}
.btn-ghost:hover { background: rgba(212,160,23,.1); color: var(--ink); }
.btn-danger {
  background: rgba(185,28,28,.1);
  border: 1.5px solid rgba(185,28,28,.3);
  color: #b91c1c; padding: 7px 14px; font-size: 13px;
}
.btn-danger:hover { background: rgba(185,28,28,.18); }
.btn-success {
  background: rgba(21,128,61,.1);
  border: 1.5px solid rgba(21,128,61,.3);
  color: #15803d; padding: 7px 14px; font-size: 13px;
}
.btn-success:hover { background: rgba(21,128,61,.18); }
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: 12px; }
.btn-full { width: 100%; }
.btn-icon { padding: 8px; border-radius: 8px; }

/* ── CARDS ── */
.card {
  background: linear-gradient(145deg, var(--ivory) 0%, var(--parchment) 100%);
  border: 1px solid rgba(212,160,23,.22);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
.card-sm {
  background: var(--ivory);
  border: 1px solid rgba(212,160,23,.18);
  border-radius: 12px;
}
.card-lift { transition: transform .22s, box-shadow .22s; }
.card-lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

/* ── FORMS ── */
.form-group { margin-bottom: 1rem; }
.lbl {
  display: block; font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink3); margin-bottom: 5px;
}
.inp {
  width: 100%; background: rgba(255,255,255,.85);
  border: 1.5px solid rgba(212,160,23,.3); border-radius: 10px;
  padding: 10px 14px; color: var(--ink);
  font-size: 14px; font-family: 'Outfit', sans-serif;
  transition: border .18s, box-shadow .18s; outline: none;
}
.inp:focus {
  border-color: var(--saffron);
  box-shadow: 0 0 0 3px rgba(232,101,10,.13);
  background: #fff;
}
.inp::placeholder { color: #b8976a; }
.inp-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
select.inp option { background: #fffef8; color: var(--ink); }
textarea.inp { resize: vertical; min-height: 80px; }
.inp-error { border-color: #ef4444 !important; }
.field-error { font-size: 12px; color: #ef4444; margin-top: 3px; }

/* ── BADGES / TAGS ── */
.tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 9px; border-radius: 99px;
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; white-space: nowrap;
}
.tag-gold    { background: linear-gradient(90deg,#fef3c7,#fde68a); color:#92400e; border:1px solid #fcd34d; }
.tag-saffron { background: rgba(232,101,10,.12); color: var(--saffron-dk); border:1px solid rgba(232,101,10,.3); }
.tag-green   { background: #dcfce7; color: #15803d; border:1px solid #86efac; }
.tag-red     { background: #fee2e2; color: #b91c1c; border:1px solid #fca5a5; }
.tag-blue    { background: #dbeafe; color: #1e40af; border:1px solid #93c5fd; }
.tag-purple  { background: #f3e8ff; color: #6b21a8; border:1px solid #c4b5fd; }
.tag-gray    { background: #f3f4f6; color: #6b7280; border:1px solid #d1d5db; }
.tag-amber   { background: #fef3c7; color: #92400e; border:1px solid #fde68a; }
.tag-teal    { background: #cffafe; color: #164e63; border:1px solid #67e8f9; }

/* Role & Level tags */
.role-student  { background:#dbeafe; color:#1e40af; border:1px solid #93c5fd; }
.role-teacher  { background:rgba(232,101,10,.12); color:var(--saffron-dk); border:1px solid rgba(232,101,10,.35); }
.role-admin    { background:linear-gradient(90deg,#fef3c7,#fde68a); color:#92400e; border:1px solid #fcd34d; }
.role-superadmin { background: #f3e8ff; color: #6b21a8; border:1px solid #c4b5fd; }

.lv-school { background:#dcfce7;color:#14532d;border:1px solid #86efac; }
.lv-college { background:#dbeafe;color:#1e3a8a;border:1px solid #93c5fd; }
.lv-jee     { background:#fee2e2;color:#7f1d1d;border:1px solid #fca5a5; }
.lv-gate    { background:#f3e8ff;color:#4c1d95;border:1px solid #c4b5fd; }
.lv-net     { background:#cffafe;color:#164e63;border:1px solid #67e8f9; }
.lv-upsc    { background:#fef3c7;color:#78350f;border:1px solid #fcd34d; }
.lv-neet    { background:#ede9fe;color:#4c1d95;border:1px solid #c4b5fd; }

/* ── TABLE ── */
.vp-table { border-collapse: collapse; width: 100%; }
.vp-table th {
  background: linear-gradient(90deg, var(--cream2), var(--cream3));
  color: var(--ink2); font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 10px 14px; text-align: left;
  border-bottom: 2px solid rgba(212,160,23,.3);
}
.vp-table td {
  padding: 10px 14px; font-size: 13px;
  border-bottom: 1px solid rgba(212,160,23,.1); color: var(--ink2);
}
.vp-table tr:last-child td { border-bottom: none; }
.vp-table tr:hover td { background: rgba(212,160,23,.04); }

/* ── PROGRESS BAR ── */
.pbar { height: 5px; background: var(--cream3); border-radius: 99px; overflow: hidden; }
.pfill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--saffron), var(--gold));
  transition: width .4s;
}

/* ── ORNAMENT DIVIDER ── */
.ornament {
  display: flex; align-items: center; gap: 10px;
  margin: 10px 0; color: var(--gold);
  font-size: 12px;
}
.ornament::before, .ornament::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,160,23,.5), transparent);
}

/* ── QUESTION PALETTE ── */
.qb {
  width: 36px; height: 36px; border-radius: 7px;
  font-size: 11px; font-weight: 700; cursor: pointer;
  border: 2px solid transparent;
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  transition: all .12s;
}
.qb-nv  { background: var(--cream2);  border-color: var(--cream3); color: var(--ink4); }
.qb-na  { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.qb-ans { background: #dcfce7; border-color: #86efac; color: #15803d; }
.qb-mrk { background: #f3e8ff; border-color: #c4b5fd; color: #6b21a8; }
.qb-am  { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.qb-cur { box-shadow: 0 0 0 3px rgba(232,101,10,.45) !important; transform: scale(1.1); }

/* ── EXAM OPTIONS ── */
.opt {
  width: 100%; text-align: left;
  padding: 13px 18px; border-radius: 10px;
  border: 2px solid rgba(212,160,23,.22);
  background: rgba(255,255,255,.75);
  color: var(--ink); cursor: pointer;
  transition: all .18s; display: flex;
  align-items: flex-start; gap: 12px;
  font-size: 14px; line-height: 1.55;
  font-family: 'Outfit', sans-serif;
  margin-bottom: 8px;
}
.opt:hover:not(:disabled) { border-color: var(--saffron); background: rgba(232,101,10,.05); }
.opt.sel     { border-color: #3b82f6; background: rgba(59,130,246,.06); color: #1e3a8a; }
.opt.correct { border-color: #16a34a !important; background: rgba(22,163,74,.07) !important; color: #14532d !important; }
.opt.wrong   { border-color: #dc2626 !important; background: rgba(220,38,38,.07) !important; color: #7f1d1d !important; }
.opt-key {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid currentColor;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; flex-shrink: 0; margin-top: 1px;
}

/* ── TIMER ── */
.t-ok     { color: #15803d; font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.t-warn   { color: #d97706; font-family: 'JetBrains Mono', monospace; font-weight: 700; animation: tblink 1s infinite; }
.t-danger { color: #dc2626; font-family: 'JetBrains Mono', monospace; font-weight: 700; animation: tblink .5s infinite; }
@keyframes tblink { 0%,100%{opacity:1}50%{opacity:.3} }

/* ── SECTION TABS ── */
.stab {
  padding: 7px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: 1.5px solid rgba(212,160,23,.28);
  color: var(--ink3); transition: all .18s; white-space: nowrap;
  font-family: 'Outfit', sans-serif;
}
.stab:hover:not(.stab-on) { border-color: var(--saffron); color: var(--ink); }
.stab-on {
  background: linear-gradient(135deg, var(--saffron), var(--gold-dk));
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 12px rgba(232,101,10,.28);
}

/* ── SIDEBAR ── */
.sidebar { width: 220px; min-width: 220px; }
.slink {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all .18s; color: var(--ink3); text-decoration: none;
}
.slink:hover { background: rgba(212,160,23,.1); color: var(--ink); }
.slink.son {
  background: linear-gradient(90deg, rgba(232,101,10,.15), rgba(212,160,23,.1));
  color: var(--saffron-dk); font-weight: 600;
  border-right: 3px solid var(--saffron);
}
.slink-icon { font-size: 16px; width: 20px; text-align: center; }

/* ── MODAL ── */
.modal-bg {
  display: none; position: fixed; inset: 0;
  background: rgba(26,15,0,.7); backdrop-filter: blur(14px);
  z-index: 9000; align-items: center; justify-content: center;
}
.modal-bg.open { display: flex; }
@keyframes mPop { from{opacity:0;transform:scale(.92) translateY(16px)} to{opacity:1;transform:scale(1) translateY(0)} }
.modal-inner { animation: mPop .26s cubic-bezier(.34,1.56,.64,1); }

/* ── SCORE RING ── */
.ring-path {
  stroke-dasharray: 340; stroke-dashoffset: 340;
  transition: stroke-dashoffset 1.3s cubic-bezier(.4,0,.2,1);
}

/* ── SCHEDULED BADGE ── */
.sched-live     { background: #dcfce7; border:1px solid #86efac; color: #15803d; }
.sched-upcoming { background: #dbeafe; border:1px solid #93c5fd; color: #1e40af; }
.sched-ended    { background: #f3f4f6; border:1px solid #d1d5db; color: #6b7280; }
.sched-draft    { background: #fef3c7; border:1px solid #fde68a; color: #92400e; }

/* ── ANIMATIONS ── */
@keyframes fadeUp { from{opacity:0;transform:translateY(18px)} to{opacity:1;transform:translateY(0)} }
.fu { opacity:0; animation:fadeUp .5s ease forwards; }
.d1{animation-delay:.1s} .d2{animation-delay:.2s} .d3{animation-delay:.3s}
.d4{animation-delay:.4s} .d5{animation-delay:.5s} .d6{animation-delay:.6s}

/* ── NUMBER PICKER ── */
.num-pick { display:flex; align-items:center; gap:8px; }
.num-pick button {
  width:28px; height:28px; border-radius:7px;
  border:1.5px solid rgba(212,160,23,.4); background:var(--ivory);
  color:var(--ink2); font-size:16px; font-weight:700;
  cursor:pointer; transition:all .15s;
  display:flex; align-items:center; justify-content:center;
}
.num-pick button:hover { background:rgba(232,101,10,.1); border-color:var(--saffron); }
.num-pick span {
  font-family:'JetBrains Mono',monospace; font-weight:700; font-size:15px;
  color:var(--saffron-dk); min-width:28px; text-align:center;
}

/* ── FLASH ALERTS ── */
.alert {
  padding: 12px 18px; border-radius: 10px;
  font-size: 14px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.alert-success { background:#dcfce7; border:1px solid #86efac; color:#15803d; }
.alert-error   { background:#fee2e2; border:1px solid #fca5a5; color:#b91c1c; }
.alert-info    { background:#dbeafe; border:1px solid #93c5fd; color:#1e40af; }
.alert-warning { background:#fef3c7; border:1px solid #fde68a; color:#92400e; }

/* ── HERO ── */
.hero-bg {
  background: linear-gradient(160deg,#fff9e6 0%,#fef0c7 35%,#fde0a8 65%,#fff5e0 100%);
  position:relative; overflow:hidden;
}
.hero-orb {
  position:absolute; border-radius:50%; filter:blur(60px); pointer-events:none;
}

/* ── STAT CARD ── */
.stat-card {
  background: linear-gradient(145deg, var(--ivory), var(--parchment));
  border: 1px solid rgba(212,160,23,.2); border-radius: 14px;
  padding: 20px 24px;
}
.stat-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.5rem; font-weight: 700; color: var(--saffron-dk);
  line-height: 1;
}
.stat-label { font-size: 12px; color: var(--ink3); font-weight: 600; text-transform: uppercase; letter-spacing:.05em; }

/* ── DASH LAYOUT ── */
.dash-wrap {
  display: flex; min-height: calc(100vh - 70px); position: relative; z-index: 1;
}
.dash-sidebar {
  width: 220px; min-width: 220px; padding: 1.5rem 1rem;
  background: linear-gradient(180deg, var(--ivory), var(--parchment));
  border-right: 1px solid rgba(212,160,23,.18);
  position: sticky; top: 67px; height: calc(100vh - 67px); overflow-y: auto;
}
.dash-main { flex: 1; padding: 2rem 1.5rem; overflow: auto; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .dash-sidebar { display: none; }
  .dash-main { padding: 1rem; }
  .nav-inner { padding: 0 1rem; }
  .page-wrap { padding: 0 1rem; }
  .hero-section { padding: 3rem 1rem; }
}

/* ── EXAM FULL-SCREEN ── */
.exam-wrap {
  display: flex; flex-direction: column; height: 100vh; position:relative; z-index:1;
}
.exam-header {
  background: rgba(253,246,227,.95); backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(212,160,23,.25);
  padding: 10px 20px; display:flex; align-items:center; justify-content:space-between;
  flex-shrink: 0;
}
.exam-body { flex:1; display:flex; overflow:hidden; }
.exam-panel { flex:1; padding: 1.5rem; overflow-y:auto; }
.exam-sidebar {
  width: 260px; min-width:260px;
  background: linear-gradient(180deg,var(--ivory),var(--parchment));
  border-left: 1px solid rgba(212,160,23,.2);
  padding: 1rem; overflow-y:auto;
}

/* ── COUNTDOWN BOX ── */
.countdown-box {
  background: linear-gradient(135deg, var(--ink), var(--ink2));
  border: 1px solid rgba(212,160,23,.35);
  border-radius: 14px; padding: 16px 20px;
  color: #fff;
}

/* ── LOADING SPINNER ── */
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(212,160,23,.3);
  border-top-color: var(--saffron);
  animation: spin .6s linear infinite; display:inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── PAGINATION ── */
.pag { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.pag-btn {
  padding: 6px 12px; border-radius:8px; font-size:13px; font-weight:600;
  border:1.5px solid rgba(212,160,23,.3); background:var(--ivory);
  color:var(--ink2); cursor:pointer; text-decoration:none;
  transition: all .15s;
}
.pag-btn:hover { border-color:var(--saffron); color:var(--ink); }
.pag-btn.active {
  background: linear-gradient(135deg,var(--saffron),var(--gold-dk));
  border-color:transparent; color:#fff;
}
.pag-btn:disabled, .pag-btn.disabled { opacity:.4; pointer-events:none; }
