/* ═══════════════════════════════════════════════════════════════
   EduVerse — Enhancements v2.1
   New themes + Legal pages + Activities redesign + Admin CMS styles
   ═══════════════════════════════════════════════════════════════ */

/* ━━━━━━━━━━━━━━━━ NEW THEMES ━━━━━━━━━━━━━━━━ */

/* 1. MIDNIGHT — deep-blue premium dark */
[data-theme="midnight"] {
  --brand-500: #6366f1; --brand-600: #4f46e5; --brand-700: #4338ca;
  --accent-500: #8b5cf6; --accent-600: #7c3aed; --cyan-500: #22d3ee;
  --g-aurora: linear-gradient(135deg,#4f46e5 0%,#7c3aed 50%,#22d3ee 100%);
  --g-cosmic: linear-gradient(135deg,#312e81 0%,#4c1d95 50%,#1e3a8a 100%);
  --g-mesh: radial-gradient(at 40% 20%,rgba(79,70,229,0.35) 0,transparent 50%),
            radial-gradient(at 80% 0%,rgba(124,58,237,0.30) 0,transparent 50%),
            radial-gradient(at 0% 50%,rgba(34,211,238,0.25) 0,transparent 50%);
  --bg: #020617; --bg-elev: #0b1426; --bg-sunken: #01030a;
  --surface: rgba(15,23,42,0.60); --surface-strong: rgba(15,23,42,0.92);
  --text: #f1f5f9; --text-2: #cbd5e1; --text-3: #94a3b8; --text-4: #64748b;
  --border: rgba(99,102,241,0.25); --border-strong: rgba(99,102,241,0.45);
  --ring: rgba(99,102,241,0.5);
  --sh-md: 0 8px 24px rgba(0,0,0,0.55);
  --sh-lg: 0 20px 50px rgba(0,0,0,0.7);
}

/* 2. CANDY — playful pastel (great for kids/teens) */
[data-theme="candy"] {
  --brand-500: #ec4899; --brand-600: #db2777; --brand-700: #be185d;
  --accent-500: #f472b6; --accent-600: #ec4899; --cyan-500: #a78bfa;
  --g-aurora: linear-gradient(135deg,#ec4899 0%,#a78bfa 50%,#60a5fa 100%);
  --g-cosmic: linear-gradient(135deg,#f0abfc 0%,#c084fc 50%,#818cf8 100%);
  --g-mesh: radial-gradient(at 40% 20%,rgba(236,72,153,0.30) 0,transparent 50%),
            radial-gradient(at 80% 0%,rgba(167,139,250,0.28) 0,transparent 50%),
            radial-gradient(at 0% 50%,rgba(96,165,250,0.22) 0,transparent 50%);
  --bg: #fdf2f8; --bg-elev: #ffffff; --bg-sunken: #fce7f3;
  --text: #831843; --text-2: #9f1239; --text-3: #be185d;
  --border: rgba(236,72,153,0.18);
}

/* 3. NORDIC — clean, minimalist light */
[data-theme="nordic"] {
  --brand-500: #64748b; --brand-600: #475569; --brand-700: #334155;
  --accent-500: #0ea5e9; --accent-600: #0284c7; --cyan-500: #06b6d4;
  --g-aurora: linear-gradient(135deg,#475569 0%,#0ea5e9 50%,#06b6d4 100%);
  --g-mesh: radial-gradient(at 40% 20%,rgba(100,116,139,0.20) 0,transparent 50%),
            radial-gradient(at 80% 0%,rgba(14,165,233,0.15) 0,transparent 50%);
  --bg: #f8fafc; --bg-elev: #ffffff; --bg-sunken: #f1f5f9;
  --text: #0f172a; --text-2: #1e293b; --text-3: #475569;
  --border: rgba(71,85,105,0.15);
}

/* 4. GOLD — luxury premium gold/black */
[data-theme="gold"] {
  --brand-500: #eab308; --brand-600: #ca8a04; --brand-700: #a16207;
  --accent-500: #f59e0b; --accent-600: #d97706; --cyan-500: #fde047;
  --g-aurora: linear-gradient(135deg,#ca8a04 0%,#eab308 50%,#fde047 100%);
  --g-cosmic: linear-gradient(135deg,#78350f 0%,#a16207 50%,#eab308 100%);
  --g-mesh: radial-gradient(at 40% 20%,rgba(234,179,8,0.30) 0,transparent 50%),
            radial-gradient(at 80% 0%,rgba(245,158,11,0.25) 0,transparent 50%);
  --bg: #0c0a09; --bg-elev: #1c1917; --bg-sunken: #000000;
  --surface: rgba(28,25,23,0.65); --surface-strong: rgba(28,25,23,0.92);
  --text: #fef3c7; --text-2: #fde68a; --text-3: #d6d3d1; --text-4: #78716c;
  --border: rgba(234,179,8,0.30); --border-strong: rgba(234,179,8,0.50);
  --sh-lg: 0 20px 50px rgba(234,179,8,0.25);
  --sh-glow: 0 0 40px rgba(234,179,8,0.4);
}

/* 5. MONO — minimal black & white */
[data-theme="mono"] {
  --brand-500: #171717; --brand-600: #0a0a0a; --brand-700: #000000;
  --accent-500: #404040; --accent-600: #262626; --cyan-500: #737373;
  --g-aurora: linear-gradient(135deg,#000000 0%,#404040 50%,#737373 100%);
  --g-cosmic: linear-gradient(135deg,#262626 0%,#525252 50%,#737373 100%);
  --g-mesh: radial-gradient(at 40% 20%,rgba(0,0,0,0.12) 0,transparent 50%),
            radial-gradient(at 80% 0%,rgba(0,0,0,0.08) 0,transparent 50%);
  --bg: #fafafa; --bg-elev: #ffffff; --bg-sunken: #f5f5f5;
  --text: #0a0a0a; --text-2: #262626; --text-3: #525252;
  --border: rgba(0,0,0,0.12);
}

/* 6. EMERALD — fresh & calming */
[data-theme="emerald"] {
  --brand-500: #059669; --brand-600: #047857; --brand-700: #065f46;
  --accent-500: #10b981; --accent-600: #059669; --cyan-500: #14b8a6;
  --g-aurora: linear-gradient(135deg,#047857 0%,#10b981 50%,#14b8a6 100%);
  --g-mesh: radial-gradient(at 40% 20%,rgba(5,150,105,0.30) 0,transparent 50%),
            radial-gradient(at 80% 0%,rgba(16,185,129,0.25) 0,transparent 50%),
            radial-gradient(at 0% 50%,rgba(20,184,166,0.20) 0,transparent 50%);
  --bg: #ecfdf5; --bg-elev: #ffffff; --bg-sunken: #d1fae5;
  --text: #064e3b; --text-2: #065f46; --text-3: #047857;
  --border: rgba(5,150,105,0.18);
}

/* 7. CYBERPUNK — neon future */
[data-theme="cyberpunk"] {
  --brand-500: #f0abfc; --brand-600: #e879f9; --brand-700: #d946ef;
  --accent-500: #22d3ee; --accent-600: #06b6d4; --cyan-500: #a3e635;
  --g-aurora: linear-gradient(135deg,#e879f9 0%,#22d3ee 50%,#a3e635 100%);
  --g-cosmic: linear-gradient(135deg,#701a75 0%,#0891b2 50%,#365314 100%);
  --g-mesh: radial-gradient(at 40% 20%,rgba(232,121,249,0.40) 0,transparent 50%),
            radial-gradient(at 80% 0%,rgba(34,211,238,0.35) 0,transparent 50%),
            radial-gradient(at 0% 50%,rgba(163,230,53,0.30) 0,transparent 50%);
  --bg: #0a0014; --bg-elev: #1a0030; --bg-sunken: #000000;
  --surface: rgba(40,10,70,0.60); --surface-strong: rgba(40,10,70,0.92);
  --text: #f0abfc; --text-2: #e879f9; --text-3: #c4b5fd; --text-4: #8b5cf6;
  --border: rgba(232,121,249,0.35); --border-strong: rgba(232,121,249,0.55);
  --sh-glow: 0 0 40px rgba(232,121,249,0.45);
}


/* ━━━━━━━━━━━━━━━━ THEME PICKER — GRID UPGRADE ━━━━━━━━━━━━━━━━ */
.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.theme-option {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 10px;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-elev);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
  position: relative;
  overflow: hidden;
}
.theme-option:hover { transform: translateY(-2px); border-color: var(--brand-500); box-shadow: var(--sh-md); }
.theme-option.active {
  border-color: var(--brand-500);
  background: linear-gradient(135deg, rgba(168,85,247,0.08), rgba(6,182,212,0.06));
}
.theme-option.active::after {
  content: '✓'; position: absolute; top: 6px; left: 6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand-600); color: white; font-weight: 900;
  display: grid; place-items: center; font-size: 13px;
}
.theme-swatch {
  width: 56px; height: 56px; border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.18), 0 4px 12px rgba(0,0,0,0.15);
}
.theme-name { font-weight: 700; font-size: 14px; color: var(--text); }
.theme-emoji { font-size: 22px; line-height: 1; }


/* ━━━━━━━━━━━━━━━━ LEGAL / CMS PAGES ━━━━━━━━━━━━━━━━ */
.cms-page { max-width: 860px; margin: 0 auto; }

.cms-hero {
  text-align: center;
  padding: 32px 20px 24px;
  margin-bottom: 24px;
  background: var(--bg-elev);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.cms-hero::before {
  content: ''; position: absolute; inset: 0;
  background: var(--g-mesh); opacity: 0.35; pointer-events: none;
}
.cms-hero > * { position: relative; z-index: 1; }
.cms-hero-icon {
  font-size: 64px; margin-bottom: 12px; line-height: 1;
  filter: drop-shadow(0 8px 24px rgba(168,85,247,0.35));
}
.cms-hero h1 { font-size: clamp(26px, 5vw, 42px); margin-bottom: 8px; }
.cms-updated { color: var(--text-3); font-size: 14px; margin: 0; }

.cms-content-wrap {
  background: var(--bg-elev);
  border-radius: var(--r-lg);
  padding: 32px;
  border: 1px solid var(--border);
  box-shadow: var(--sh-sm);
}

/* Markdown-rendered content */
.prose { color: var(--text-2); line-height: 1.9; font-size: 16px; }
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--text); font-weight: 900; line-height: 1.3; margin: 1.5em 0 0.6em; }
.prose h1 { font-size: 28px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
.prose h2 { font-size: 22px; color: var(--brand-600); }
.prose h3 { font-size: 18px; }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { margin: 0 0 1em; padding-right: 1.6em; }
.prose li { margin-bottom: 0.4em; }
.prose a { color: var(--brand-600); font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose a:hover { color: var(--accent-600); }
.prose strong { color: var(--text); font-weight: 800; }
.prose hr { border: 0; height: 1px; background: var(--border); margin: 2em 0; }
.prose blockquote {
  border-right: 4px solid var(--brand-500); margin: 1em 0;
  padding: 8px 16px; background: var(--bg-sunken);
  border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--text-2);
}
.prose code {
  background: var(--bg-sunken);
  padding: 2px 8px; border-radius: 6px;
  font-family: var(--font-mono); font-size: 0.9em;
  color: var(--brand-700);
}


/* ━━━━━━━━━━━━━━━━ CONTACT PAGE ━━━━━━━━━━━━━━━━ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.contact-card {
  display: flex; align-items: center; gap: 16px;
  padding: 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: inherit;
  transition: all var(--t-base) var(--ease-out);
  box-shadow: var(--sh-xs);
}
.contact-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-lg);
  border-color: var(--brand-500);
}
.contact-ico {
  width: 56px; height: 56px; border-radius: var(--r-md);
  display: grid; place-items: center;
  font-size: 24px; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(168,85,247,0.25);
}
.contact-body { flex: 1; min-width: 0; }
.contact-label { font-size: 12px; color: var(--text-3); font-weight: 700; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.contact-value { font-size: 17px; font-weight: 800; color: var(--text); margin-bottom: 4px; word-break: break-all; }
.contact-hint { font-size: 12px; color: var(--text-3); }

.grid-2-contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}
@media (max-width: 768px) {
  .grid-2-contact { grid-template-columns: 1fr; }
}

.contact-form-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--sh-sm);
}


/* ━━━━━━━━━━━━━━━━ PRICING "HOW IT WORKS" BANNER ━━━━━━━━━━━━━━━━ */
.howit-banner {
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap;
  padding: 20px 24px;
  margin: 20px 0 40px;
  background: linear-gradient(135deg, rgba(168,85,247,0.08), rgba(236,72,153,0.06), rgba(6,182,212,0.08));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.howit-step { display: flex; align-items: flex-start; gap: 12px; flex: 1 1 200px; }
.howit-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--g-aurora); color: #fff;
  display: grid; place-items: center;
  font-weight: 900; font-size: 15px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(168,85,247,0.4);
}
.howit-step strong { display: block; margin-bottom: 4px; font-size: 15px; color: var(--text); }
.howit-step p { margin: 0; color: var(--text-3); font-size: 13px; }
.howit-arrow { color: var(--brand-500); font-size: 20px; opacity: 0.6; }
@media (max-width: 768px) {
  .howit-arrow { display: none; }
}

.pricing-badge {
  position: absolute; top: 16px; right: 16px;
  background: rgba(168,85,247,0.12);
  color: var(--brand-700);
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: 12px; font-weight: 800;
}

.contact-callout {
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap;
  padding: 24px;
  margin-top: 48px;
  background: var(--bg-elev);
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-lg);
}
.contact-callout-ico { font-size: 44px; line-height: 1; }
.contact-callout-actions { display: flex; gap: 10px; flex-wrap: wrap; }


/* ━━━━━━━━━━━━━━━━ LOGIN: Request-account card ━━━━━━━━━━━━━━━━ */
.request-account-card {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  margin: 20px 0;
}
.rac-step {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  color: var(--text-2);
  font-weight: 600;
  font-size: 14px;
}
.rac-step + .rac-step { border-top: 1px dashed var(--border); }
.rac-step > span:first-child {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--g-aurora); color: #fff;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 900;
  flex-shrink: 0;
}

.auth-contact-btns { margin-top: 20px; }


/* ━━━━━━━━━━━━━━━━ ACTIVITIES HUB — NEW DESIGN ━━━━━━━━━━━━━━━━ */
.activities-hero {
  position: relative;
  padding: 48px 32px;
  margin-bottom: 32px;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--border);
}
.activities-hero-bg {
  position: absolute; inset: 0;
  background: var(--g-mesh);
  opacity: 0.6;
  pointer-events: none;
}
.activities-hero-content { position: relative; z-index: 1; text-align: center; }
.activities-hero h2 { font-size: clamp(32px, 5vw, 48px); margin: 12px 0; }
.activities-hero p { color: var(--text-2); font-size: 17px; max-width: 620px; margin: 0 auto; }

.activities-stats {
  display: flex; justify-content: center; gap: 28px; flex-wrap: wrap;
  margin-top: 28px;
}
.act-stat { text-align: center; }
.act-stat-num {
  font-size: 34px; font-weight: 900;
  background: var(--g-aurora);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; line-height: 1;
}
.act-stat-label { font-size: 13px; color: var(--text-3); font-weight: 700; margin-top: 4px; }

/* Type tabs as cards */
.activity-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.act-type-card {
  --type-color: var(--brand-500);
  display: flex; flex-direction: column; align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--bg-elev);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
  font-family: inherit;
}
.act-type-card:hover { transform: translateY(-2px); border-color: var(--type-color); }
.act-type-card.active {
  border-color: var(--type-color);
  background: linear-gradient(135deg, rgba(168,85,247,0.12), rgba(6,182,212,0.08));
  box-shadow: 0 10px 26px rgba(168,85,247,0.18);
}
.act-type-emoji { font-size: 26px; line-height: 1; }
.act-type-name { font-size: 13px; font-weight: 700; color: var(--text); text-align: center; }
.act-type-count {
  background: var(--bg-sunken);
  color: var(--text-2);
  font-size: 11px; font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--r-full);
}
.act-type-card.active .act-type-count {
  background: var(--type-color);
  color: #fff;
}

/* Filter bar */
.activities-filter-bar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.activities-filter-bar .input { flex: 1 1 200px; max-width: 400px; }
.activities-filter-bar select.input { flex: 0 0 auto; max-width: 200px; }
.filter-input-wrap {
  position: relative;
  flex: 1 1 260px;
  max-width: 420px;
}
.filter-input-wrap i {
  position: absolute; top: 50%; right: 14px;
  transform: translateY(-50%);
  color: var(--text-3); pointer-events: none;
}
.filter-input-wrap .input { padding-right: 40px; width: 100%; max-width: none; }

.view-toggle {
  display: flex; gap: 2px;
  background: var(--bg-sunken);
  border-radius: var(--r-sm);
  padding: 3px;
}
.view-btn {
  padding: 8px 12px;
  background: transparent;
  border: 0;
  border-radius: calc(var(--r-sm) - 2px);
  cursor: pointer;
  color: var(--text-3);
  transition: all var(--t-fast);
}
.view-btn.active { background: var(--bg-elev); color: var(--brand-600); box-shadow: var(--sh-xs); }

/* Activities grid */
.activities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.activities-grid.list-view { grid-template-columns: 1fr; }
.activities-grid.list-view .activity-lesson-card { flex-direction: row; }
.activities-grid.list-view .alc-top { width: 120px; flex: 0 0 auto; }
.activities-grid.list-view .alc-body { flex: 1; }

.activity-lesson-card {
  display: flex; flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all var(--t-base) var(--ease-out);
  box-shadow: var(--sh-xs);
}
.activity-lesson-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-lg);
  border-color: var(--brand-500);
}
.alc-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px;
  color: #fff;
  min-height: 80px;
  position: relative;
  overflow: hidden;
}
.alc-top::after {
  content: ''; position: absolute; top: -40px; left: -40px;
  width: 120px; height: 120px;
  background: rgba(255,255,255,0.14);
  border-radius: 50%;
  pointer-events: none;
}
.alc-emoji { font-size: 36px; line-height: 1; position: relative; z-index: 1; }
.alc-count {
  display: flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(6px);
  padding: 6px 12px;
  border-radius: var(--r-full);
  font-weight: 800; font-size: 14px;
  position: relative; z-index: 1;
}
.alc-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.alc-subj { font-size: 12px; color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.alc-title {
  font-size: 16px; font-weight: 800; line-height: 1.4;
  margin: 0 0 12px; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.alc-types { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.alc-type-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg-sunken);
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px; font-weight: 700;
  color: var(--text-2);
}
.alc-type-chip-name { display: none; }
@media (min-width: 640px) { .alc-type-chip-name { display: inline; } }

.alc-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-600);
  background: var(--bg-sunken);
}
.activity-lesson-card:hover .alc-footer i { transform: translateX(-4px); }
.alc-footer i { transition: transform var(--t-fast); }


/* ━━━━━━━━━━━━━━━━ SINGLE ACTIVITY PAGE ━━━━━━━━━━━━━━━━ */
.activity-header-card {
  display: flex; align-items: center; gap: 16px;
  padding: 20px;
  margin-bottom: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}
.ahc-icon {
  width: 64px; height: 64px; border-radius: var(--r-md);
  display: grid; place-items: center;
  font-size: 32px; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.ahc-body { flex: 1; min-width: 0; }
.ahc-subj { font-size: 12px; color: var(--text-3); font-weight: 700; text-transform: uppercase; margin-bottom: 4px; }
.ahc-body h2 { font-size: 22px; margin: 0 0 6px; }
.ahc-meta { display: flex; gap: 16px; color: var(--text-3); font-size: 13px; font-weight: 700; }
.ahc-meta i { color: var(--brand-500); }

.activity-tabs {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 18px;
  scrollbar-width: thin;
}
.activity-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: var(--bg-sunken);
  border: 2px solid transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-2);
  white-space: nowrap;
  transition: all var(--t-fast) var(--ease-out);
  position: relative;
}
.activity-tab:hover { color: var(--brand-600); }
.activity-tab.active {
  background: var(--g-aurora);
  color: #fff;
  box-shadow: 0 8px 20px rgba(168,85,247,0.35);
}
.activity-tab.done:not(.active) {
  background: rgba(16,185,129,0.12);
  color: #059669;
  border-color: rgba(16,185,129,0.3);
}
.at-done-ico { margin-right: 4px; font-size: 12px; }

.activity-progress { margin-bottom: 20px; }
.ap-track {
  height: 8px;
  background: var(--bg-sunken);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-bottom: 6px;
}
.ap-fill {
  height: 100%;
  background: var(--g-aurora);
  border-radius: var(--r-full);
  transition: width var(--t-slow) var(--ease-out);
  box-shadow: 0 0 12px rgba(168,85,247,0.5);
}
.ap-label { font-size: 13px; color: var(--text-3); font-weight: 700; text-align: center; }

.activity-subhead {
  text-align: center;
  color: var(--text-2);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 0;
  margin-bottom: 16px;
  border-bottom: 1px dashed var(--border);
}


/* ━━━━━━━━━━━━━━━━ ADMIN: MESSAGES / REQUESTS ROW ━━━━━━━━━━━━━━━━ */
.msg-row {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  margin-bottom: 10px;
  transition: all var(--t-fast);
}
.msg-row:hover { box-shadow: var(--sh-sm); border-color: var(--brand-500); }
.msg-row.new { border-right: 4px solid var(--brand-500); }
.msg-row.pending { border-right: 4px solid #f59e0b; }
.msg-row.approved { border-right: 4px solid #10b981; }
.msg-row.rejected { border-right: 4px solid #ef4444; opacity: 0.7; }

.msg-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}
.msg-header > div:first-child { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msg-body {
  padding: 10px 0;
  color: var(--text-2);
  line-height: 1.6;
  font-size: 14px;
}
.msg-footer {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.msg-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--brand-600);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
}
.msg-link:hover { color: var(--accent-600); text-decoration: underline; }


/* ━━━━━━━━━━━━━━━━ ADMIN: PAGE EDITOR / GRID-3 ━━━━━━━━━━━━━━━━ */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}


/* ━━━━━━━━━━━━━━━━ HELPER — GUEST/AUTH VISIBILITY ━━━━━━━━━━━━━━━━ */
/* When user is logged in, hide [data-guest-only] */
body.is-auth [data-guest-only] { display: none !important; }
/* When user is NOT logged in, keep [data-auth-only] hidden (handled inline) */


/* ━━━━━━━━━━━━━━━━ SMALL TWEAKS ━━━━━━━━━━━━━━━━ */
.sm-hidden { display: none; }
@media (min-width: 640px) { .sm-hidden { display: inline-flex; } }

/* Smooth transition on theme change */
html { transition: background-color var(--t-base) var(--ease-out), color var(--t-base) var(--ease-out); }


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SRS — Spaced Repetition System (v2)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.srs-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 20px 0 12px;
}
@media (max-width: 640px){
  .srs-stats { grid-template-columns: repeat(2, 1fr); }
}
.srs-stat {
  background: var(--surface-strong);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.srs-stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
}
.srs-stat-icon {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.srs-stat-value {
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
  font-family: var(--font-display);
  line-height: 1;
}
.srs-stat-label {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
  font-weight: 600;
}

/* Daily-goal progress bar */
.srs-goal-bar {
  margin: 0 0 20px;
  padding: 0 4px;
}
.srs-goal-track {
  height: 8px;
  background: var(--bg-sunken);
  border-radius: var(--r-full);
  overflow: hidden;
  position: relative;
}
.srs-goal-fill {
  display: block;
  height: 100%;
  background: var(--g-aurora);
  border-radius: var(--r-full);
  transition: width var(--t-slow) var(--ease-out);
  position: relative;
  box-shadow: 0 0 12px rgba(168,85,247,0.4);
}
.srs-goal-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: srs-shimmer 2.2s infinite;
}
@keyframes srs-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Card flip */
.srs-card-wrap { overflow: visible; }
.srs-flip-card {
  background: linear-gradient(135deg, var(--brand-500), var(--accent-500));
  border-radius: var(--r-lg);
  padding: 32px 24px;
  min-height: 140px;
  text-align: center;
  color: #fff;
  box-shadow: var(--sh-lg);
  position: relative;
  overflow: hidden;
  margin: 14px 0;
  transition: transform var(--t-slow) var(--ease-spring);
}
.srs-flip-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255,255,255,0.25), transparent 60%);
  pointer-events: none;
}
.srs-flip-card.flipped {
  transform: rotateX(4deg) scale(0.98);
}
.srs-flip-face { position: relative; z-index: 1; }
.srs-card-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 10px;
}
.srs-card-body {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.5;
  font-family: var(--font-display);
}

/* Rating grid */
.srs-rate-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}
@media (max-width: 520px){
  .srs-rate-grid { grid-template-columns: repeat(2, 1fr); }
}
.srs-rate-btn {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px !important;
  font-size: 13px !important;
  position: relative;
  min-height: 72px;
  transition: transform var(--t-fast) var(--ease-out) !important;
}
.srs-rate-btn:hover { transform: translateY(-2px); }
.srs-rate-btn:active { transform: translateY(0); }
.srs-rate-emoji { font-size: 22px; }

/* Keyboard hint chip */
.kbd, .kbd-hint {
  display: inline-block;
  padding: 2px 7px;
  background: rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-2);
  line-height: 1;
  vertical-align: middle;
}
[data-theme="dark"] .kbd, [data-theme="dark"] .kbd-hint,
[data-theme="midnight"] .kbd, [data-theme="midnight"] .kbd-hint,
[data-theme="galaxy"] .kbd, [data-theme="galaxy"] .kbd-hint,
[data-theme="cyber"] .kbd, [data-theme="cyber"] .kbd-hint,
[data-theme="emerald"] .kbd, [data-theme="emerald"] .kbd-hint,
[data-theme="aurora"] .kbd, [data-theme="aurora"] .kbd-hint {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.15);
  color: var(--text-2);
}
.kbd-hint {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  font-size: 10px;
  opacity: 0.75;
}
.srs-rate-btn .kbd-hint {
  position: static;
  margin-top: 2px;
  opacity: 0.55;
}

/* Cyber theme glow boost */
[data-theme="cyber"] .srs-flip-card {
  box-shadow: 0 0 32px rgba(168,85,247,0.4), 0 20px 50px rgba(0,0,0,0.5);
}
