:root{
  --bg: #0b0d12;
  --panel: rgba(255,255,255,.04);
  --border: rgba(255,255,255,.08);
  --muted: #a7b0c0;
  --text: #eaf0ff;
  --primary: #5d7cff;
  --accent: #23d3ef;
  --green: #16d39a;
  --shadow: 0 10px 32px rgba(0,0,0,.35);
}

*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0; color:var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background:
    radial-gradient(1200px 600px at -10% -10%, rgba(157,99,255,.15), transparent 40%),
    radial-gradient(1200px 600px at 110% -20%, rgba(35,211,239,.15), transparent 40%),
    radial-gradient(900px 500px at 50% 120%, rgba(93,124,255,.12), transparent 40%),
    var(--bg);
}
::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* ---------- Message Action Menu (long-press / right-click) ---------- */
:root{
  --menu-bg: rgba(17, 24, 39, 0.75);     /* glassy dark */
  --menu-border: rgba(255,255,255,0.08);
  --menu-shadow: 0 12px 30px rgba(0,0,0,0.35), 0 2px 10px rgba(0,0,0,0.2);
  --menu-radius: 14px;
  --menu-item-hover: rgba(255,255,255,0.08);
  --menu-divider: rgba(255,255,255,0.08);
}

@media (prefers-color-scheme: light) {
  :root{
    --menu-bg: rgba(255,255,255,0.72);
    --menu-border: rgba(0,0,0,0.08);
    --menu-shadow: 0 16px 40px rgba(0,0,0,0.15), 0 2px 10px rgba(0,0,0,0.06);
    --menu-item-hover: rgba(0,0,0,0.06);
    --menu-divider: rgba(0,0,0,0.06);
  }
}

.msg-menu {
  position: fixed;
  z-index: 99999;
  min-width: 180px;
  max-width: 240px;
  padding: 8px;
  border-radius: var(--menu-radius);
  backdrop-filter: blur(12px);
  background: var(--menu-bg);
  border: 1px solid var(--menu-border);
  box-shadow: var(--menu-shadow);
  transform-origin: top left;
  animation: menuPop 120ms cubic-bezier(.2,.8,.2,1);
}

@keyframes menuPop {
  from { transform: scale(.95); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.msg-menu .item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font: 500 14px/1.2 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto;
}

.msg-menu .item:hover,
.msg-menu .item:focus-visible {
  background: var(--menu-item-hover);
  outline: none;
}

.msg-menu .divider {
  height: 1px;
  background: var(--menu-divider);
  margin: 6px 6px;
  border-radius: 1px;
}

/* Optional: subtle haptics on tap (mobile) */
@media (hover: none) {
  .msg-menu .item:active { transform: scale(0.99); }
}

/* Dim background (click-away catcher) */
.msg-menu-backdrop {
  position: fixed; inset: 0;
  z-index: 99998;
  background: transparent; /* invisible but catches clicks */
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .msg-menu { animation: none; }
}



.container{ max-width: 1180px; margin: 0 auto; padding: 22px; }
.card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.grid{ display:grid; gap:16px; }
.btn{
  padding:10px 14px; border-radius:12px; border:1px solid var(--border);
  background: linear-gradient(90deg, #4ea2ff, #3bd9ff);
  color:#06111a; font-weight:800; cursor:pointer;
}
.badge{ font-size:12px; padding:2px 8px; border-radius:999px; background:#dff5ff; color:#08131d; }

/* Top nav */
.nav{
  position: sticky; top:0; z-index:5;
  backdrop-filter: blur(8px);
  background: rgba(9,12,18,.6);
  border-bottom: 1px solid var(--border);
}
.nav-inner{
  max-width:1180px; margin:0 auto; padding:10px 22px;
  display:flex; align-items:center; gap:16px;
}
.logo{
  width:34px; height:34px; border-radius:10px; display:grid; place-items:center;
  font-weight:800; color:#07121d;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}
.brand{ display:flex; align-items:center; gap:10px; font-weight:800; }
.links{ display:flex; gap:10px; margin-left:10px; flex:1; }
.links a{
  color:#c7d2f5; opacity:.7; padding:8px 12px; border-radius:10px; text-decoration:none;
}
.links a.active{
  opacity:1; color:#fff;
  background: linear-gradient(90deg, rgba(157,99,255,.18), rgba(34,211,238,.18));
  border:1px solid var(--border);
}
.avatar{ width:34px; height:34px; border-radius:50%; display:grid; place-items:center; background:#1a2035; border:1px solid var(--border); }

/* Section headings */
.h1{ font-size:26px; margin:18px 0 6px; }
.sub{ color:var(--muted); margin:0 0 16px; }

/* Dashboard pieces */
.stats{ display:grid; grid-template-columns: repeat(4, minmax(180px,1fr)); gap:16px; }
.stat{ padding:18px; border-radius:16px; color:#06111a; font-weight:800; }
.stat.blue{ background: linear-gradient(135deg,#74f0ff,#5d7cff); }
.stat.purple{ background: linear-gradient(135deg,#b388ff,#6d4cff); }
.stat.green{ background: linear-gradient(135deg,#86efac,#22c55e); }
.stat.orange{ background: linear-gradient(135deg,#ffb86b,#ff6b6b); }
.stat .v{ font-size:22px; }
.stat .t{ font-size:12px; opacity:.9; }

.list{ padding:12px; }
.item{ padding:14px; border-radius:14px; background: rgba(255,255,255,.02); border:1px solid transparent; margin-bottom:10px; }
.item:hover{ border-color: var(--border); }
.meta{ font-size:12px; color:var(--muted); display:flex; gap:14px; }

/* Quick actions */
.qa{ display:flex; flex-direction:column; gap:12px; }
.qa .btn{ width:100%; }

/* Doubts */
.ask{ padding:14px; border-radius:18px; background: linear-gradient(90deg,#5f7cff,#a26bff); }
.ask .fields{ display:grid; gap:10px; grid-template-columns: 1fr; }
.input, .select{
  width:100%; padding:12px 14px; border-radius:12px; border:1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.18); color:#fff; outline:none;
}
.qcard{ padding:14px; }

/* Quizzes */
.timer{ padding:12px 16px; border-radius:14px; color:#111; background: linear-gradient(90deg,#ff6aa6,#7c7bff); }
.options{ display:grid; gap:10px; padding:12px; }
.opt{ background:#fff; color:#0d1321; padding:12px 14px; border-radius:12px; border:none; text-align:left; cursor:pointer; }
.qfooter{ display:flex; justify-content:space-between; padding:12px; }

/* Previous papers */
.share{ padding:16px; border-radius:18px; background: linear-gradient(90deg,#21c08b,#2fb4a9); }
.filters{ display:grid; gap:10px; grid-template-columns: 1fr repeat(3, 1fr); margin-top:12px; }
.pcard{ padding:14px; display:grid; grid-template-columns: 60px 1fr auto; gap:12px; align-items:center; }

/* Leaderboard */
.podium{ display:grid; grid-template-columns: repeat(3, 1fr); gap:16px; }
.pod{ padding:18px; border-radius:18px; text-align:center; color:#fff; }
.pod.silver{ background: linear-gradient(135deg,#9aa0a6,#7b7f85); }
.pod.gold{ background: linear-gradient(135deg,#ffb347,#ff7b47); }
.pod.bronze{ background: linear-gradient(135deg,#d1913c,#ffd194); color:#222; }
.ranklist{ padding:12px; }

/* Profile */
.profile-grid{ display:grid; grid-template-columns: 1.4fr .9fr; gap:16px; }
.info .row{ display:grid; grid-template-columns: repeat(4,1fr); gap:12px; }
.chips{ display:flex; gap:8px; flex-wrap:wrap; }
.chip{ padding:6px 10px; border-radius:999px; font-size:12px; color:#0a0f1b; background:#dff8ff; }
.activity .entry{ padding:12px; border-radius:12px; margin:8px 0; }
.entry:nth-child(1){ background:#e9f7ee; color:#064d28; }
.entry:nth-child(2){ background:#e8f0ff; color:#0b2268; }
.entry:nth-child(3){ background:#f3e8ff; color:#4a0a7c; }

/* Responsive */
@media (max-width: 1000px){
  .stats{ grid-template-columns: repeat(2, 1fr); }
  .profile-grid{ grid-template-columns: 1fr; }
  .podium{ grid-template-columns: 1fr; }
}
/* ===== Consistent header sizing across all pages (lock layout) ===== */
.nav-inner {
  max-width: 1180px;       /* keep same as other pages */
  padding: 10px 22px;      /* same vertical rhythm */
}
.logo {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; font-weight: 800;
}
.brand { display:flex; align-items:center; gap:10px; font-weight:800; letter-spacing:.2px; }

.links { display:flex; gap:10px; margin-left:10px; flex:1; }
.links a {
  font-size: 14px;         /* 🔒 lock link font size */
  line-height: 1;          /* avoid line-height drift */
  padding: 8px 12px;
  border-radius: 10px;
}

.links a.active {
  border: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(157,99,255,.18), rgba(34,211,238,.18));
  color: #fff; opacity: 1;
}

.avatar {
  width: 34px; height: 34px;      /* 🔒 lock avatar size */
  border-radius: 50%;
  display: grid; place-items: center;
  background: #1a2035;
  border: 1px solid var(--border);
  font-size: 12px; line-height: 1; /* avoid vertical shift */
}

/* Prevent header layout shift when fonts load */
.nav { min-height: 54px; } /* matches 34px avatar + paddings */

/* --- Lock header, link, and avatar sizing so all pages match --- */

:root{
  /* keep your existing tokens; these don't override colors */
  --header-max: 1180px;
}

/* same container + padding on every page header */
.nav-inner{ max-width: var(--header-max); padding:10px 22px; display:flex; align-items:center; gap:16px; }

/* brand + logo locked */
.logo{ width:34px; height:34px; border-radius:10px; display:grid; place-items:center; font-weight:800; }
.brand{ display:flex; align-items:center; gap:10px; font-weight:800; letter-spacing:.2px; }

/* make .links and .nav-links behave the same across pages */
.links, .nav-links{ display:flex; gap:10px; margin-left:10px; flex:1; }

/* make .links a and .link behave the same */
.links a, .link{
  font-size:14px; line-height:1; padding:8px 12px; border-radius:10px;
  color:#c7d2f5; text-decoration:none; opacity:.7;
}
.links a.active, .link.active{
  opacity:1; color:#fff;
  background:linear-gradient(90deg, rgba(157,99,255,.18), rgba(34,211,238,.18));
  border:1px solid rgba(255,255,255,.08);
}

/* avatar identical everywhere */
.avatar{
  width:34px; height:34px; border-radius:50%;
  display:grid; place-items:center; font-size:12px; line-height:1;
  background:#1a2035; border:1px solid rgba(255,255,255,.08);
}

/* prevent minor header jumps */
.nav{ min-height:54px; }
/* ===== Responsive header + hamburger ===== */
.nav-toggle{
  display:none; position:relative; width:38px; height:34px; border:none; background:transparent; cursor:pointer;
  margin-left:8px;
}
.nav-toggle span{
  position:absolute; left:8px; right:8px; height:2px; background:#c7d2f5; border-radius:2px; transition:.2s ease;
}
.nav-toggle span:nth-child(1){ top:10px; }
.nav-toggle span:nth-child(2){ top:16px; }
.nav-toggle span:nth-child(3){ top:22px; }

@media (max-width: 860px){
  .links{ display:none; position:absolute; left:0; right:0; top:100%; padding:10px 16px 14px;
    background: rgba(9,12,18,.92); border-bottom:1px solid var(--border); backdrop-filter: blur(8px);
  }
  .nav-toggle{ display:block; }
  .nav.open .links{ display:grid; gap:8px; }
  .nav.open .nav-toggle[aria-expanded="true"] span:nth-child(1){ transform:translateY(6px) rotate(45deg); }
  .nav.open .nav-toggle[aria-expanded="true"] span:nth-child(2){ opacity:0; }
  .nav.open .nav-toggle[aria-expanded="true"] span:nth-child(3){ transform:translateY(-6px) rotate(-45deg); }
}

/* ===== Fancy hover: underline + tooltip bubbling from the link ===== */
.links a{
  position:relative; overflow:visible; /* keep your existing link styles */
}
.links a::before{
  content:""; position:absolute; left:10%; right:10%; bottom:-3px; height:2px;
  background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius:2px;
  transform: scaleX(0); transform-origin: center; transition: transform .18s ease;
}
.links a:hover::before{ transform: scaleX(1); }

/* Custom tooltip using data-tip (we'll auto-fill it from text via JS) */
.links a::after{
  content: attr(data-tip);
  position:absolute; left:50%; top:calc(100% + 10px); transform:translateX(-50%) translateY(4px);
  padding:6px 10px; border-radius:10px; white-space:nowrap; pointer-events:none;
  background: rgba(15, 19, 32, .95); color:#eaf0ff; font-size:12px; opacity:0;
  border:1px solid var(--border); box-shadow: 0 6px 20px rgba(0,0,0,.35);
  transition: opacity .15s ease, transform .15s ease;
}
.links a:hover::after{ opacity:1; transform:translateX(-50%) translateY(0); }





.reply-inline{display:flex;align-items:center;gap:6px;background:rgba(255,255,255,0.04);border:1px solid rgba(255,255,255,0.06);padding:4px 8px;border-radius:8px;margin-bottom:6px}
.reply-mark.sm{width:3px;height:18px;background:linear-gradient(180deg,#60a5fa,#a78bfa);border-radius:2px}
.reply-inline-text{color:#cbd5e1;font-size:.9em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ---------- Reply bar (active reply indicator) ---------- */
.reply-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 6px 10px;
  border-radius: 10px;
  margin: 6px 0;
  color: #e2e8f0;
}

.reply-chip .reply-mark {
  width: 4px;
  height: 32px;
  background: linear-gradient(180deg, #60a5fa, #a78bfa);
  border-radius: 2px;
}

.reply-chip .reply-meta {
  flex: 1;
}

.reply-chip .reply-text {
  font-size: 0.9em;
  color: #94a3b8;
}

.reply-cancel {
  background: none;
  border: none;
  color: #f87171;
  font-size: 1em;
  cursor: pointer;
}

.reply-inline {
  display:flex; align-items:center; gap:6px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.06);
  padding:4px 8px; border-radius:8px; margin-bottom:6px;
}
.reply-mark.sm {width:3px;height:18px;background:linear-gradient(180deg,#60a5fa,#a78bfa);border-radius:2px;}
.reply-inline-text {color:#cbd5e1;font-size:.9em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.reply-chip {display:flex;align-items:center;gap:8px;background:#1f2937;border-radius:8px;padding:4px 8px;color:#e5e7eb;}
.reply-cancel {background:none;border:none;color:#9ca3af;font-size:14px;cursor:pointer;}
.msg.pulse{animation:pulse 0.8s ease;}
@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(99,102,241,.6)}100%{box-shadow:0 0 0 12px rgba(99,102,241,0)}}




/* ---------- Pulse highlight animation when scrolling to a replied message ---------- */
.msg.pulse {
  animation: pulse 0.8s ease;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.6);
  }
  100% {
    box-shadow: 0 0 0 12px rgba(99, 102, 241, 0);
  }
}




/* =======================
   HOLOGRAPHIC HOVER EFFECT FOR HEADER LINKS
   ======================= */
.links a {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  color: #c7d2f5;
  padding: 8px 12px;
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.4s ease;
}

/* Holographic glow animation */
.links a::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    0deg,
    transparent,
    transparent 30%,
    rgba(0,255,255,0.25)
  );
  transform: rotate(-45deg);
  opacity: 0;
  transition: all 0.6s ease;
  z-index: 1;
}

/* Text glow and scale */
.links a:hover {
  color: #0ff;
  text-shadow: 0 0 8px rgba(0,255,255,0.5);
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(0,255,255,0.2);
}

/* Run holographic shine animation on hover */
.links a:hover::before {
  opacity: 1;
  transform: rotate(-45deg) translateY(100%);
}

/* Keep text on top of the animated layer */
.links a span, .links a strong {
  position: relative;
  z-index: 2;
}


/* ===================== NAV START (single source of truth) ===================== */

/* base layout */
.nav-inner{ display:flex; align-items:center; gap:16px; }
.links{ margin-left:auto; }
.avatar{ order:4; }

.nav-toggle{
  order:3; margin-left:10px;
  width:42px; height:40px; border:none; background:transparent; cursor:pointer;
  position:relative; z-index:1001; display:none; /* hidden by default (desktop) */
}
.nav-toggle span{
  position:absolute; left:10px; right:10px; height:2px;
  background:#c7d2f5; border-radius:2px; transition:.22s ease;
}
.nav-toggle span:nth-child(1){ top:12px; }
.nav-toggle span:nth-child(2){ top:19px; }
.nav-toggle span:nth-child(3){ top:26px; }

/* desktop/tablet: inline nav, no drawer, no overlay, burger hidden */
@media (min-width: 861px){
  .links{
    position:static !important;
    display:flex !important;
    gap:10px;
    transform:none !important;
    opacity:1 !important;
    pointer-events:auto !important;
    background:transparent !important;
    border:none !important;
    box-shadow:none !important;
    height:auto !important; width:auto !important;
  }
  .nav::after{ content:none !important; }
}

/* mobile: show burger and slide-in drawer from the right */
@media (max-width: 860px){
  .brand{ order:1; }
  .nav-toggle{ display:block; order:3; margin-left:auto; }
  .avatar{ order:4; margin-left:8px; }

  .links{
    position:fixed; top:0; right:0; bottom:0; height:100vh;
    width:78vw; max-width:360px;
    background:rgba(10,14,22,.98);
    border-left:1px solid var(--border);
    box-shadow:-14px 0 40px rgba(0,0,0,.45);
    padding:18px 16px 24px;
    display:flex; flex-direction:column; gap:8px;
    transform:translateX(100%); transition:transform .22s ease;
    z-index:1000;
    overflow-y:auto;
  }
  .links a{ display:block; padding:14px 12px; border-radius:10px; font-size:16px; opacity:.95; }
  .links a:active{ background:rgba(255,255,255,.06); }

  /* disable any hover pseudo effects inside the drawer */
  .nav.open .links a::before,
  .nav.open .links a::after{ content:none !important; }

  /* overlay */
  .nav::after{
    content:""; position:fixed; inset:0; z-index:990;
    background:rgba(0,0,0,.45); backdrop-filter:blur(2px);
    opacity:0; pointer-events:none; transition:opacity .22s ease;
  }
  .nav.open::after{ opacity:1; pointer-events:auto; }

  /* open state */
  .nav.open .links{ transform:translateX(0); }

  /* burger -> X */
  .nav.open .nav-toggle span:nth-child(1){ transform:translateY(7px) rotate(45deg); }
  .nav.open .nav-toggle span:nth-child(2){ opacity:0; }
  .nav.open .nav-toggle span:nth-child(3){ transform:translateY(-7px) rotate(-45deg); }
}

/* lock background scroll when drawer open */
body.nav-open{ overflow:hidden; }

/* keep desktop hover underline/glow inside link bounds */
.links a{ overflow:hidden; }

/* ====================== NAV END (single source of truth) ====================== */


/* z-index safety so drawer is always above page content */

/* --- NAV stacking fix (make all pages match Chat) --- */
.nav{ position: sticky; top:0; z-index: 4000; }

@media (max-width:860px){
  /* Drawer above page, overlay below burger/avatar so they remain clickable */
  .links{ z-index: 4200; }
  .nav::after{ z-index: 4190; }
  .nav-toggle{ position: relative; z-index: 4201; }
  .avatar{ position: relative; z-index: 4201; }
}


/* MOBILE NAV — force it above any page content (profile chip, etc.) */
@media (max-width: 860px){
  /* header itself */
  .nav{
    position: sticky;
    top: 0;
    z-index: 50000;          /* higher than anything on the page */
  }
  /* dark overlay behind the drawer */
  .nav::after{
    z-index: 50001;          /* below the drawer, above page */
  }
  /* the slide-in drawer with the links */
  .nav .links{
    z-index: 50002;          /* above overlay */
  }
  /* the hamburger / close and the top-right avatar */
  .nav .nav-toggle,
  .nav .avatar{
    position: relative;
    z-index: 50003;          /* above everything so close is clickable */
  }
}



/* =================== CHAT BUBBLE SIZE & WRAP FIX =================== */
.msg-bubble {
  max-width: 520px;                  /* prevent full-width stretch */
  width: fit-content;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  background: linear-gradient(180deg, rgba(93,124,255,0.25), rgba(35,211,239,0.25));
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.msg.me {
  display: flex;
  justify-content: flex-end;
}

/* Narrower on mobile */
@media (max-width: 640px) {
  .msg-bubble { max-width: 86vw; }
}

/* Optional subtle glow on my messages */
.msg.me .msg-bubble {
  background: linear-gradient(135deg, rgba(93,124,255,0.4), rgba(35,211,239,0.4));
}

/* keep text readable */
.msg-text {
  color: var(--text);
  font-size: 0.96em;
  line-height: 1.4;
}


/* =================== PINNED MESSAGES TRAY =================== */
.pinned {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.03);
  display: none; /* hidden until populated */
}

.pin-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  margin: 5px 0;
  cursor: pointer;
  transition: background .2s ease;
}

.pin-item:hover {
  background: rgba(255,255,255,0.07);
}

.pin-right {
  margin-left: auto;
  opacity: 0.8;
  font-size: 12px;
}

.pin-chip {
  font-size: 12px;
  opacity: 0.7;
  margin-left: 6px;
  color: #23d3ef;
}


.btn-logout {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease;
}
.btn-logout:hover {
  background: linear-gradient(135deg, #f87171, #dc2626);
}

.question-item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 15px;
  margin: 10px 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.question-item h3 {
  color: #1d4ed8;
  margin-bottom: 5px;
}
.question-item small {
  color: #64748b;
}


/* ===================================================
   GLOBAL NAVBAR + DRAWER (WORKS ACROSS ALL SECTIONS)
   =================================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #0b0f19;
  color: #fff;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}

/* --- Brand --- */
.nav .brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav .logo {
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Links --- */
.nav .links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav .links a {
  color: #d1d5db;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav .links a:hover {
  color: #fff;
}

/* --- Avatar (profile initials circle) --- */
.nav .avatar {
  background: #2563eb;
  color: #fff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* --- Hamburger Button --- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background: #fff;
  border-radius: 3px;
  transition: 0.3s;
}

/* ---------- FX Burger base ---------- */
.fx-burger { display:none; background:transparent; border:0; padding:0; }
#fx-burger-check { position:absolute; width:100px; height:100px; opacity:0; pointer-events:auto; cursor:pointer; }
#fx-wrap { position:relative; width:60px; height:60px; display:flex; align-items:center; justify-content:center; filter:hue-rotate(70deg); }
#fx-wrap svg { position:absolute; width:52px; transition:transform .2s cubic-bezier(0.175,0.885,0.32,1.575); }
#fx-wrap svg:first-of-type { transform: translateY(5px); }
#fx-wrap svg:nth-of-type(2) { transform: translateY(-6px) scaleY(-1); }
#fx-wrap svg:nth-of-type(3) { transform: translateY(25px); }
#fx-wrap path { stroke:#3b82f6; stroke-width:40px; fill:none; stroke-linecap:round; stroke-dasharray:4400px; stroke-dashoffset:4200px; transition:stroke-dasharray 1.5s, stroke-dashoffset 1.5s, stroke 1.5s; }

/* Checked state: tighten drawing */
#fx-burger-check:checked ~ #fx-wrap { transform: scaleX(0.92); }
#fx-burger-check:checked ~ #fx-wrap svg:nth-of-type(3) path { stroke-dasharray:10000px; stroke-dashoffset:10000px; transition-delay: .6s; }
#fx-burger-check:checked ~ #fx-wrap path { stroke-dasharray:5000px; stroke-dashoffset:-4150px; stroke: #facc15; }

/* ---------- Drawer ---------- */
.fx-drawer {
  position: fixed; inset: 0 auto 0 0; width: 80vw; max-width: 320px;
  background: #0b1220; color: #f1f5f9; transform: translateX(-100%);
  transition: transform .28s ease; z-index: 2000; display:flex; flex-direction:column;
  box-shadow: 4px 0 12px rgba(0,0,0,.5);
}
.fx-drawer.open { transform: translateX(0); }
.fx-drawer-head { display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-bottom:1px solid rgba(255,255,255,.08); }
.fx-drawer-close { background:none; border:0; color:#f87171; font-size:22px; cursor:pointer; }
.fx-drawer-links { display:flex; flex-direction:column; padding:12px; gap:8px; }
.fx-drawer-links a { color:inherit; text-decoration:none; padding:10px 12px; border-radius:8px; }
.fx-drawer-links a:hover { background: rgba(255,255,255,.08); }

/* Backdrop */
.fx-backdrop { position:fixed; inset:0; background:rgba(0,0,0,.45); opacity:0; transition:opacity .28s ease; z-index:1990; }
.fx-backdrop.show { opacity:1; }
.fx-backdrop[hidden] { display:none; }

/* Show the burger only on mobile; hide desktop nav if needed */
@media (max-width: 768px) {
  .fx-burger { display:inline-block; }
  /* If you have a desktop nav links block, hide it on mobile: */
  .header .nav-links, .nav .links { display: none; }
}
/* ====== your existing global styles above ====== */

/* Desktop: burger hidden by default */
.mnav-btn{ display:none; }

/* ============ MOBILE ONLY (≤768px) ============ */
@media (max-width: 768px) {
  /* Show burger, hide desktop links */
  .mnav-btn { 
    display:inline-flex; flex-direction:column; justify-content:center; gap:5px;
    width:40px; height:40px; border:none; background:transparent; padding:0; margin-left:8px; cursor:pointer;
  }
  .mnav-line { width:22px; height:2px; background:#fff; display:block; border-radius:2px; transition:transform .25s ease, opacity .2s; }
  .mnav-btn[aria-expanded="true"] .mnav-line:nth-child(1){ transform:translateY(7px) rotate(45deg); }
  .mnav-btn[aria-expanded="true"] .mnav-line:nth-child(2){ opacity:0; }
  .mnav-btn[aria-expanded="true"] .mnav-line:nth-child(3){ transform:translateY(-7px) rotate(-45deg); }

  /* Hide desktop nav only on phones */
  .nav .links { display:none; }

  /* Drawer panel */
  .mnav-drawer{
    position:fixed; top:0; right:0; bottom:0; width:78vw; max-width:360px;
    background:#0f1729; transform:translateX(100%); transition:transform .28s ease;
    z-index:1000; padding:16px 14px 24px; box-shadow:-24px 0 60px rgba(0,0,0,.45);
  }
  .mnav-drawer.open{ transform:translateX(0); }

  /* Backdrop (left side) */
  .mnav-drawer::before{
    content:""; position:fixed; inset:0; right:auto; width:22vw; background:rgba(0,0,0,.35);
    opacity:0; pointer-events:none; transition:opacity .28s ease;
  }
  .mnav-drawer.open::before{ opacity:1; pointer-events:auto; }

  .mnav-links{ display:flex; flex-direction:column; gap:14px; margin-top:8px; }
  .mnav-links a{
    color:#e6f0ff; text-decoration:none; font-weight:600; font-size:16px;
    padding:10px 8px; border-radius:10px;
  }
  .mnav-links a:hover{ background:rgba(255,255,255,.06); }

  .btn-logout{
    margin-top:8px; padding:12px 14px; width:100%;
    border:0; border-radius:14px; font-weight:700; color:#fff; cursor:pointer;
    background:linear-gradient(90deg,#ff4d4d,#e21f1f);
    box-shadow:0 10px 20px rgba(226,31,31,.35);
  }

  body.mnav-lock{ overflow:hidden; }
}

/* ---- Quiz attempt ko full page section jaisa dikhao ---- */

#quizTakingModal {
  position: static;        /* pehle fixed / absolute hoga, usko hata do */
  inset: auto;
  width: 100%;
  height: auto;
  background: transparent; /* dark overlay hata diya */
  display: none;           /* JS se block/none hoga */
  z-index: 1;
}

/* Content ko center + max-width de do */
#quizTakingContent {
  max-width: 960px;
  margin: 1.5rem auto;
}

/* Card ko page-section ki tarah bana do */
#quizTakingContent .card {
  width: 100%;
  max-width: 100%;
  border-radius: 0.75rem;     /* halka rounded, chahe to 0 bhi kar sakta hai */
  box-shadow: none;           /* overlay waali shadow hata di */
  background: #0b1120;        /* tumhare dark theme ke jaisa */
  color: #e5e7eb;
}

/* Question text & options thoda clear dikhein */
#quizTakingContent .question-text {
  color: #f9fafb;
}

#quizTakingContent .options span {
  color: #e5e7eb;
}

#quizTakingContent .option-row input[type="radio"] {
  margin-top: 2px;
}
/* ==== Academic Profile Guard Modal ==== */

body.ap-modal-open {
  overflow: hidden;
}

.ap-backdrop {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(124, 58, 237, 0.22), rgba(15, 23, 42, 0.96));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.ap-modal {
  position: relative;
  width: 90%;
  max-width: 460px;
  padding: 2.2rem 2.4rem 2rem;
  border-radius: 1.6rem;
  background: radial-gradient(circle at top left, #7c3aed 0%, #0b1120 48%, #020617 100%);
  box-shadow:
    0 0 0 1px rgba(148, 163, 184, 0.15),
    0 24px 80px rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ap-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #9ca3af;
}

.ap-icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 0%, #a855f7, #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  box-shadow:
    0 0 0 6px rgba(79, 70, 229, 0.18),
    0 18px 45px rgba(15, 23, 42, 0.9);
}

.ap-icon-circle span {
  font-size: 1.8rem;
}

.ap-modal-title {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0.4rem 0 0.5rem;
}

.ap-modal-sub {
  font-size: 0.9rem;
  color: #9ca3af;
  margin: 0 0 0.9rem;
}

.ap-modal-highlight {
  font-size: 0.85rem;
  color: #c4b5fd;
}

.ap-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  margin-top: 1.6rem;
}

.ap-btn-ghost {
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: transparent;
  color: #9ca3af;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 150ms ease-out;
}

.ap-btn-ghost:hover {
  border-color: rgba(248, 250, 252, 0.8);
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.7);
}

.ap-btn-primary {
  padding: 0.6rem 1.5rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: #f9fafb;
  background: linear-gradient(135deg, #8b5cf6, #6366f1, #22c55e);
  box-shadow:
    0 0 0 1px rgba(191, 219, 254, 0.2),
    0 20px 40px rgba(37, 99, 235, 0.75);
  transition: transform 120ms ease-out, box-shadow 120ms ease-out, filter 120ms ease-out;
}

.ap-btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow:
    0 0 0 1px rgba(191, 219, 254, 0.4),
    0 24px 55px rgba(37, 99, 235, 0.95);
}

.nav {
  height: 70px;           /* fixed header height */
  display: flex;
  align-items: center;
}

.nav-inner {
  display: flex;
  align-items: center;
}

/* SVG logo control yahin se hoga */
.brand-logo-svg {
  height: 40px;           /* yahan se size badhao / ghattao */
  width: auto;
  display: block;
}
.brand-logo-svg {
  height: 38px;
  width: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* MOBILE HEADER FIX — 3 equal spaced sections */
@media (max-width: 768px) {

  .nav-inner {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr;  /* equal space */
    align-items: center;
    position: relative;
  }

  /* LEFT */
  .fx-burger {
    justify-self: start !important;
    margin-left: 10px;
  }

  /* CENTER */
  .brand {
    justify-self: center !important;
  }
  .brand img {
    height: 28px;   /* mobile optimized */
  }

  /* RIGHT */
  .navbar-avatar {
    justify-self: end !important;
    margin-right: 10px;
  }
}
/* ====== DESKTOP NAV BASE ====== */
.nav {
  background: #020617;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-logo-svg {
  height: 32px;
}

/* desktop links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

/* burger default hidden (desktop) */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.nav-burger span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #ec4899;
}

/* ====== MOBILE LAYOUT ====== */
@media (max-width: 768px) {
  .nav-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* left logo, center empty, right avatar+burger */
    align-items: center;
  }

  .brand {
    justify-self: start;
  }

  .nav-links {
    display: none; /* header links hide in mobile */
  }

  .nav-burger {
    display: flex;
    justify-self: end;
    margin-right: 8px;
  }

  .navbar-avatar {
    justify-self: end;
    margin-right: 48px; /* avatar left of burger */
  }
}

/* ====== DRAWER ====== */
.nav-drawer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease-out;
  z-index: 150;
}

.nav-drawer.open {
  pointer-events: auto;
  opacity: 1;
}

.nav-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.nav-drawer-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 78%;
  max-width: 320px;
  height: 100%;
  background: #020617;
  box-shadow: 8px 0 25px rgba(0, 0, 0, 0.6);
  padding: 1.25rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transform: translateX(-100%);
  transition: transform 0.25s ease-out;
}

.nav-drawer.open .nav-drawer-panel {
  transform: translateX(0);
}

.nav-drawer-close {
  align-self: flex-end;
  font-size: 1.4rem;
  background: transparent;
  border: none;
  color: #e5e7eb;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.nav-drawer-title {
  font-weight: 700;
  color: #f9fafb;
  margin-bottom: 0.5rem;
}

.nav-drawer-link {
  display: block;
  text-align: left;
  padding: 0.65rem 0;
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.nav-drawer-link:last-child {
  border-bottom: none;
}

.nav-drawer-link:hover {
  color: #a5b4fc;
}

.nav-drawer .logout-btn {
  width: 100%;
  justify-content: flex-start;
  margin-top: 0.75rem;
}

/* drawer sirf mobile pe chahiye */
@media (min-width: 769px) {
  .nav-drawer {
    display: none;
  }
}
/* 🔥 GLOBAL NAVBAR STABILIZER — no more movement on page switch */
.nav {
  height: 70px !important;        /* fix navbar height */
  min-height: 70px !important;
  max-height: 70px !important;

  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.04); /* smooth underline */
}

/* inner container also fixed */
.nav-inner {
  height: 70px !important;
  min-height: 70px !important;

  display: flex;
  align-items: center;
}
/* Scrollbar width hamesha stable rakho – nav jump nahi karega */
html {
  scrollbar-gutter: stable;
}

/* Older browsers ke liye fallback */
@supports not (scrollbar-gutter: stable) {
  html {
    overflow-y: scroll;
  }
}

