/* ============================================================
   DESIGN SYSTEM — JóvenesSTEM Web Platform (Vanilla Style)
   EJE RECTOR: #277eff (Azul Eléctrico)
   ============================================================ */

:root {
  --bg-color: #ffffff;
  --text-color: #0a0a0a;
  --text-muted: #949494;
  --primary: #277eff;
  --primary-hover: #1a6be8;
  --teal: #00a896;
  --warning: #f59e0b;
  --surface: #fbfaf9;
  --border: #e8e8e8;
  --surface-hover: #ffffff;
  --bg-note: rgba(0, 242, 255, 0.05);
  --border-cyan: rgba(0, 242, 255, 0.2);
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-head: 'Outfit', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ── Typography ── */
.font-head { font-family: var(--font-head); }
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.tracking-tight { letter-spacing: -0.025em; }

/* ── Layout ── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── 4-Column Module Grid ── */
.grid-centered {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 640px) {
  .grid-centered {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    padding: 0 0.5rem;
  }
  .card {
    min-height: auto !important;
    padding: 14px 16px !important;
  }
  .module-excerpt {
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 6px;
  }
  .module-footer {
    display: flex !important;
    margin-top: 10px !important;
  }
  .module-header {
    margin-bottom: 4px !important;
  }
  .module-title {
    font-size: 0.92rem !important;
    line-height: 1.3;
  }
}

/* Section dividers span full grid width */
.section-divider {
  grid-column: 1 / -1;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-top: 1.5rem;
  margin-bottom: 0.25rem;
}
.section-divider h3 {
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.82rem;
  font-weight: 900;
  opacity: 0.7;
  margin-bottom: 0 !important;
  margin-top: 0 !important;
}

/* ── Flex Utilities ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mt-10 { margin-top: 2.5rem; }
.p-6 { padding: 1.5rem; }
.pb-4 { padding-bottom: 1rem; }
.pt-3 { padding-top: 0.75rem; }
.opacity-80 { opacity: 0.8; }
.opacity-60 { opacity: 0.6; }
.border-b { border-bottom: 1px solid var(--border); }
.border-border { border-color: var(--border); }
.border-t { border-top: 1px solid var(--border); }

/* ── Navbar ── */
.dash-header {
  height: 60px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 50;
}

/* ── Module Cards ── */
.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 160px;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 10px 32px rgba(39, 126, 255, 0.08);
}

.module-header { margin-bottom: 12px; }
.module-title { font-size: 1.02rem !important; margin-bottom: 6px !important; }
.module-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.badge-dev  { background: #f3f4f6; color: #6b7280; }
.badge-active { background: #eff6ff; color: var(--primary); }
.badge-locked { background: #fee2e2; color: #ef4444; }

/* ── Locked Cards ── */
.card-locked {
  position: relative;
  overflow: hidden;
  filter: none;
  opacity: 1;
  cursor: not-allowed !important;
}
.lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.lock-cta {
  background: var(--primary);
  color: white;
  padding: 7px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(39, 126, 255, 0.3);
}
.card-locked:hover .lock-overlay { background: rgba(255,255,255,0.25); }

/* ── Completed Cards ── */
.completed-card {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.02) !important;
}
.completed-jump { animation: jump-anim 0.5s ease; }
@keyframes jump-anim {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px) scale(1.02); }
}

/* ── Book Ref Tag ── */
.book-ref-tag {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 9px;
  background: rgba(39, 126, 255, 0.05);
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--primary);
  border: 1px solid rgba(39, 126, 255, 0.1);
}

/* ── Reader Button (on cards) ── */
.reader-btn {
  background: rgba(39, 126, 255, 0.08);
  border: 1px solid rgba(39, 126, 255, 0.15);
  color: var(--primary);
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.reader-btn:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(39, 126, 255, 0.3);
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background-color: var(--primary);
  color: #fff;
  border-radius: 99px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}
.btn-primary:hover { background-color: var(--primary-hover); transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background-color: transparent;
  color: var(--text-color);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  cursor: pointer;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* ── Forms ── */
.input-text {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-color);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}
.input-text:focus { border-color: var(--primary); }

/* ── Avatar ── */
.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: all 0.3s ease;
  font-size: 48px;
}
.avatar.speaking {
  border-color: var(--primary);
  box-shadow: 0 0 0 8px rgba(39, 126, 255, 0.1);
  animation: pulse-ring 1s infinite alternate;
}
.avatar.thinking { border-color: var(--teal); animation: spin-pulse 2s infinite linear; }

@keyframes pulse-ring {
  0%   { transform: scale(1);    box-shadow: 0 0 0 8px  rgba(39,126,255,0.1); }
  100% { transform: scale(1.05); box-shadow: 0 0 0 16px rgba(39,126,255,0.2); }
}
@keyframes spin-pulse {
  0%   { transform: rotate(0deg);   }
  100% { transform: rotate(360deg); }
}

/* ── XP Anim ── */
.xp-glow { animation: xp-glow-anim 0.8s ease; }
@keyframes xp-glow-anim {
  0%   { transform: scale(1);   filter: brightness(1); }
  50%  { transform: scale(1.3); filter: brightness(1.5); color: var(--warning); }
  100% { transform: scale(1);   filter: brightness(1); }
}

/* ── Fade In ── */
.fade-in { animation: fadeIn 0.5s ease-out forwards; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* ── Academic Note ── */
.academic-note {
  animation: slideDown 0.5s ease-out;
  box-shadow: 0 4px 15px rgba(0, 242, 255, 0.05);
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0);     }
}

/* ── Dashboard Alert ── */
.dashboard-alert {
  background: var(--bg-note);
  border: 1px solid rgba(39, 126, 255, 0.2);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  gap: 16px;
  margin-bottom: 2rem;
  transition: all 0.3s ease;
}
.dashboard-alert:hover { background: rgba(39,126,255,0.12); transform: translateY(-2px); }

/* ── Profile ── */
.profile-wrap {
  max-width: 600px;
  margin: 60px auto;
  padding: 40px;
  background: #fff;
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 40px rgba(0,0,0,0.03);
}
.profile-avatar-sec { position: relative; width: 140px; height: 140px; margin: 0 auto 30px; }
.profile-avatar-preview {
  width: 100%; height: 100%; border-radius: 50%;
  object-fit: cover; border: 4px solid #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.edit-p-btn {
  position: absolute; bottom: 0; right: 0;
  background: var(--primary); color: #fff;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: 3px solid #fff; transition: transform 0.2s;
}
.edit-p-btn:hover { transform: scale(1.1); }

/* ── Tutor Layout ── */
@media (max-width: 900px) {
  .tutor-layout {
    grid-template-columns: 1fr;
    height: auto;
    padding: 16px;
    gap: 24px;
    margin-top: 64px !important;
  }
  .reader-pane { 
    max-height: none !important; 
    padding: 24px 20px 100px !important; /* Large bottom padding for TTS bar */
    border-radius: 16px;
  }
  .chat-container { 
    height: 650px !important; 
    padding: 16px !important; 
    border-radius: 16px;
  }
  .font-head { font-size: 1.5rem !important; }
  .dash-header { padding: 0 12px; }
  .btn-primary, .btn-secondary, .mic-btn { min-height: 44px; }
}

/* ── Text blur (pedagogical lock) ── */
.text-blurred {
  filter: blur(8px);
  user-select: none;
  pointer-events: none;
  transition: filter 0.8s ease;
  opacity: 0.5;
}

/* ── Standards Card (Reader Footer) ── */
.standards-model-card {
  margin-top: 2rem;
  padding: 1.25rem;
  background: rgba(39, 126, 255, 0.03);
  border: 1px solid rgba(39, 126, 255, 0.1);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.standard-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.85rem;
  line-height: 1.5;
  color: inherit;
}
.standard-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); flex-shrink: 0; margin-top: 2px;
}
.standard-label { font-weight: 800; color: var(--primary); margin-right: 4px; }
.standard-world-box {
  background: rgba(0, 168, 150, 0.06);
  border-left: 3px solid var(--teal);
  padding: 10px 12px;
  border-radius: 4px 12px 12px 4px;
  margin-top: 0.25rem;
}
.standard-world-label {
  font-weight: 900; font-size: 0.72rem; color: var(--teal);
  text-transform: uppercase; letter-spacing: 0.05em;
  display: block; margin-bottom: 4px;
}

/* Accessibility Theme overrides for standards cards inside reader pane */
.reader-pane.theme-sepia .standards-model-card {
  background: rgba(91, 70, 54, 0.05) !important;
  border-color: rgba(91, 70, 54, 0.15) !important;
}
.reader-pane.theme-sepia .standard-label,
.reader-pane.theme-sepia .standard-icon {
  color: #5b4636 !important;
}
.reader-pane.theme-sepia .standard-world-box {
  background: rgba(91, 70, 54, 0.08) !important;
  border-color: #5b4636 !important;
}
.reader-pane.theme-sepia .standard-world-label {
  color: #5b4636 !important;
}

.reader-pane.theme-highcontrast .standards-model-card {
  background: #000000 !important;
  border-color: #ffff00 !important;
}
.reader-pane.theme-highcontrast .standard-label,
.reader-pane.theme-highcontrast .standard-icon {
  color: #ffff00 !important;
}
.reader-pane.theme-highcontrast .standard-world-box {
  background: #000000 !important;
  border-color: #ffff00 !important;
}
.reader-pane.theme-highcontrast .standard-world-label {
  color: #ffff00 !important;
}

/* ── Mic Button ── */
.mic-btn {
  display: none !important;
}

/* ── Next module button ── */
#next-module-btn { display: none; width: 100%; padding: 15px; font-size: 1.1rem; box-shadow: 0 10px 30px rgba(39,126,255,0.25); }

/* ── Global Header (Shared) ── */
.global-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  /* Premium Silver Metallic Gradient */
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 50%, #ffffff 100%);
  backdrop-filter: blur(20px);
  border-bottom: 2px solid #cbd5e1; /* Steel tone */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  display: flex;
  align-items: center;
}
.nav-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 40px;
}
.nav-logo { text-decoration: none; display: flex; align-items: center; flex-shrink: 0; }
.logo-text { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.03em; color: var(--text-color); }
.logo-text em { font-style: normal; color: var(--primary); }
.nav-links { display: flex; align-items: center; gap: 24px; flex: 1; justify-content: flex-start; }
.nav-link { color: var(--text-muted); font-size: 0.875rem; font-weight: 600; text-decoration: none; transition: color 0.2s; }
.nav-link:hover { color: var(--primary); }
.nav-btn-primary { background: var(--primary); color: #fff; padding: 8px 20px; border-radius: 12px; font-weight: 700; text-decoration: none; font-size: 0.85rem; transition: all 0.2s; white-space: nowrap; }
.nav-btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(39, 126, 255, 0.25); }
.nav-auth-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-btn-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 12px;
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
  color: #f0f0f5;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: all 0.2s;
}
.nav-btn-dark:hover {
  background: linear-gradient(145deg, #16213e 0%, #1a1a3e 100%);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #fff;
}
html.dark-theme .nav-btn-dark {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
html.dark-theme .nav-btn-dark:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.nav-user-orb { 
  width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; 
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; 
  cursor: pointer; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.1); 
  transition: transform 0.2s; 
  margin-left: auto; /* Pushes to the right in flex-1 nav-links */
}
.nav-user-orb:hover { transform: scale(1.1); }
#clerk-user-btn { margin-left: auto !important; }
@media (max-width: 640px) { 
  .hide-mobile { display: none !important; } 
  .nav-container { padding: 0 12px; gap: 12px; }
  .logo-text { font-size: 0.95rem; }
  .nav-links {
    min-width: 0;
    justify-content: flex-end;
    gap: 8px;
  }
  .nav-link { font-size: 0.75rem; font-weight: 700; }
  .nav-btn-primary { padding: 6px 12px; font-size: 0.75rem; border-radius: 8px; }
  .nav-btn-dark { padding: 6px 12px; font-size: 0.75rem; border-radius: 8px; }
  .nav-auth-group { gap: 6px; margin-left: 0; }
  .nav-user-orb { width: 28px; height: 28px; font-size: 10px; border-width: 1px; margin-left: 0 !important; }
  #clerk-user-btn { margin-left: 0 !important; flex-shrink: 0; }
}

@media (max-width: 390px) {
  .global-header .nav-links > a[href$="/dashboard"],
  .global-header .nav-links > a[href="dashboard.html"] {
    display: none !important;
  }
  .theme-toggle-btn {
    width: 32px;
    height: 32px;
    padding: 5px;
  }
}

/* Section Header for Dashboard */
.page-header-gap { padding-top: 84px; }

/* ── TTS Toolbar ── */
.tts-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(39, 126, 255, 0.05);
  border: 1px solid rgba(39, 126, 255, 0.1);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 24px;
  backdrop-filter: blur(8px);
}

.tts-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tts-dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse-primary 2s infinite;
}

.tts-status span:not(.tts-dot) {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
}

.tts-actions {
  display: flex;
  gap: 8px;
}

.tts-btn {
  background: rgba(100, 100, 100, 0.08); /* High contrast grey */
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--primary); /* Blue icon */
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tts-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(39, 126, 255, 0.3);
}

.tts-btn-danger:hover {
  border-color: #ef4444;
  color: #ef4444;
}

@keyframes pulse-primary {
  0% { box-shadow: 0 0 0 0 rgba(39, 126, 255, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(39, 126, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(39, 126, 255, 0); }
}

/* ── NEW DASHBOARD REDESIGN (Progress Hub) ── */
.dash-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.progress-hero {
  background: linear-gradient(135deg, rgba(39,126,255,0.08) 0%, rgba(39,126,255,0.02) 100%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 32px;
  padding: 40px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 40px;
  margin-bottom: 30px;
  backdrop-filter: blur(10px);
}

@media (min-width: 768px) {
  .progress-hero { grid-template-columns: 240px 1fr; }
}

.progress-circle-container {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto;
}

.progress-circle-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.progress-circle-bg {
  fill: none;
  stroke: rgba(255,255,255,0.05);
  stroke-width: 12;
}

.progress-circle-bar {
  fill: none;
  stroke: var(--primary);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 565.48; /* 2 * PI * 90 */
  stroke-dashoffset: 565.48;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-percentage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.progress-val {
  font-family: 'Outfit', sans-serif;
  font-size: 3rem;
  font-weight: 900;
  display: block;
  line-height: 1;
}

.progress-lbl {
  font-size: 0.75rem;
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Stat Grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-3px); background: rgba(255,255,255,0.05); }

.stat-value { font-size: 1.8rem; font-weight: 800; font-family: 'Outfit', sans-serif; margin-bottom: 4px; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; font-weight: 700; }

/* Certification Roadmap */
.roadmap-container {
  margin-top: 50px;
}

.roadmap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.roadmap-track {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding: 20px 0;
  scrollbar-width: none;
}
.roadmap-track::-webkit-scrollbar { display: none; }

.milestone {
  flex: 0 0 220px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 24px;
  position: relative;
  opacity: 0.8;
  filter: none;
}

.milestone.unlocked {
  opacity: 1;
  filter: grayscale(0);
  background: linear-gradient(145deg, rgba(39,126,255,0.15), rgba(39,126,255,0.05));
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(39,126,255,0.1);
}

.milestone-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.milestone-num {
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.1em;
  margin-bottom: 4px;
  display: block;
}

.milestone-title {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.milestone-status {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
}
.milestone.unlocked .milestone-status { color: var(--primary); }

/* ── TTS UI (System Voice) ── */
.tts-status.loading {
  color: var(--warning) !important;
}

.tts-status.loading .tts-dot {
  background: var(--warning);
}

.data-usage-notice {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  margin-left: 10px;
  white-space: nowrap;
}

/* ── Interactive TTS & Word Seeking ── */
.word-span {
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  padding: 0 1px;
}
.word-span:hover {
  background: rgba(39, 126, 255, 0.1);
  box-shadow: 0 0 0 2px rgba(39, 126, 255, 0.05);
}
.word-active {
  background: rgba(39, 126, 255, 0.15);
  box-shadow: 0 0 0 2px rgba(39, 126, 255, 0.2);
  color: var(--primary);
  font-weight: 600;
}
.word-past {
  opacity: 0.6;
}

.floating-tts-bar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 30px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(39, 126, 255, 0.15);
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.floating-tts-bar.hidden {
  bottom: -100px;
  opacity: 0;
  pointer-events: none;
}
.floating-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.floating-btn:hover {
  background: var(--primary);
  transform: scale(1.1) translateY(-1px);
  box-shadow: 0 4px 10px rgba(39, 126, 255, 0.3);
}
.floating-btn:active {
  transform: scale(0.95);
}
.floating-status {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.6rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  padding-right: 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}
.global-footer {
  width: 100%;
  margin-top: 60px;
  background: #ffffff;
  border-top: 1px solid #ebebeb;
  padding: 20px 0;
  color: #1a1a1b;
  font-size: 0.75rem;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.02);
  position: relative;
  z-index: 10;
}

.global-footer .footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}
.global-footer .footer-brand .logo-text {
  font-size: 0.9rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 0;
}
.global-footer .footer-tagline {
  font-size: 0.7rem;
  opacity: 0.7;
  display: inline-block;
  margin-left: 10px;
  color: #1a1a1b;
}
.global-footer .footer-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.global-footer .footer-meta-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.global-footer .copyright {
  font-size: 0.7rem;
  opacity: 0.6;
  margin: 0;
  color: #1a1a1b;
}
.global-footer .footer-trademark {
  font-size: 0.65rem;
  opacity: 0.55;
  margin: 0;
  color: #1a1a1b;
  line-height: 1.4;
}
.global-footer .footer-version {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  background: rgba(39, 126, 255, 0.1);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(39, 126, 255, 0.2);
}

@media (max-width: 768px) {
  .global-footer .footer-container {
    flex-direction: column;
    text-align: center;
    padding: 0 12px;
    gap: 6px;
  }
  .global-footer .footer-meta {
    align-items: center;
    text-align: center;
    gap: 8px;
  }
  .global-footer .footer-meta-top {
    justify-content: center;
    gap: 8px;
  }
  .global-footer {
    padding: 10px 0;
    margin-top: 30px;
  }
  .global-footer .footer-tagline {
    display: none;
  }
}

/* ── Badge Achievement System ── */
/* ── Pokémon-Style Badge Card System (v4.2.3) ── */
#badge-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

.badge-card {
  position: relative;
  background: #12121e;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 2 / 2.8;
  display: flex;
  flex-direction: column;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5), inset 0 0 20px rgba(0,0,0,0.4);
  transition: all 0.5s cubic-bezier(0.2, 1, 0.3, 1);
  cursor: pointer;
  transform-style: preserve-3d;
}

.badge-card:not(.locked):hover {
  transform: translateY(-10px) scale(1.03) rotate(1deg);
  box-shadow: 0 25px 50px rgba(0,0,0,0.7);
  border-color: var(--card-color);
  z-index: 10;
}

.badge-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  z-index: 2;
}

.badge-card .card-lvl {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 0.6rem;
  color: #fff;
  background: var(--card-color);
  padding: 2px 8px;
  border-radius: 50px;
  text-transform: uppercase;
  box-shadow: 0 0 10px var(--card-color);
}

.badge-card .card-attr {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.55rem;
  opacity: 0.5;
  letter-spacing: 0.1em;
  color: #fff;
}

.badge-card .card-body {
  position: relative;
  flex: 1;
  background: radial-gradient(circle at center, rgba(30, 30, 50, 1), #050508);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 2px 0;
}

.badge-card .card-illustration svg {
  width: 55px;
  height: 55px;
  fill: none;
  stroke-width: 1.5;
  filter: drop-shadow(0 0 12px var(--card-color));
  transition: transform 0.6s ease;
  opacity: 0.9;
}

.badge-card:not(.locked):hover .card-illustration svg {
  transform: scale(1.2) rotate(-5deg);
  filter: drop-shadow(0 0 20px var(--card-color));
  opacity: 1;
}

.badge-card .card-footer {
  margin-top: 10px;
  text-align: left;
  z-index: 2;
}

.badge-card .card-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 0.8rem;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}

.badge-card .card-type {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.5rem;
  color: var(--card-color);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Holographic Shimmer Effect */
.badge-card .card-holo {
  position: absolute;
  top: -100%;
  left: -100%;
  width: 300%;
  height: 300%;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 45%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0) 55%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(-10deg);
  pointer-events: none;
  z-index: 5;
}

.badge-card:not(.locked):hover .card-holo {
  animation: holo-shimmer 2s infinite linear;
}

@keyframes holo-shimmer {
  0% { transform: translate(-20%, -20%) rotate(-10deg); }
  100% { transform: translate(20%, 20%) rotate(-10deg); }
}

@keyframes slide-up {
  from { bottom: -100px; opacity: 0; }
  to { bottom: 30px; opacity: 1; }
}

@keyframes slide-down {
  from { bottom: 30px; opacity: 1; }
  to { bottom: -100px; opacity: 0; }
}

/* Locked / Ghost State */
.badge-card.locked {
  filter: none;
  opacity: 1;
  cursor: not-allowed;
}

.badge-card .card-lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 0.55rem;
  color: rgba(255,255,255,1);
  letter-spacing: 0.05em;
  z-index: 20;
  backdrop-filter: none;
}

/* ── Achievement Modal ── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(5, 5, 10, 0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: rgba(18, 18, 30, 0.45);
  backdrop-filter: blur(35px) saturate(210%);
  -webkit-backdrop-filter: blur(35px) saturate(210%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 32px;
  max-width: 450px;
  width: 100%;
  padding: 30px;
  position: relative;
  text-align: center;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Preview Badge Card Scale & Holography ── */
.preview-badge-card {
  position: relative;
  width: 300px;
  height: 420px;
  background: rgba(18, 18, 30, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), inset 0 0 24px rgba(255, 255, 255, 0.05);
  transition: all 0.5s cubic-bezier(0.2, 1, 0.3, 1);
  transform-style: preserve-3d;
}

.preview-badge-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  z-index: 2;
}

.preview-badge-card .card-lvl {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 0.9rem;
  color: #fff;
  background: var(--card-color);
  padding: 4px 16px;
  border-radius: 50px;
  text-transform: uppercase;
  box-shadow: 0 0 15px var(--card-color);
}

.preview-badge-card .card-attr {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.8rem;
  opacity: 0.6;
  letter-spacing: 0.1em;
  color: #fff;
}

.preview-badge-card .card-body {
  position: relative;
  flex: 1;
  background: radial-gradient(circle at center, rgba(30, 30, 50, 0.9), #050508);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 4px 0;
}

.preview-badge-card .card-illustration svg {
  width: 120px;
  height: 120px;
  fill: none;
  stroke-width: 1.8;
  filter: drop-shadow(0 0 20px var(--card-color));
  transition: transform 0.6s ease;
  opacity: 0.95;
}

.preview-badge-card .card-footer {
  margin-top: 18px;
  text-align: left;
  z-index: 2;
}

.preview-badge-card .card-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 1.25rem;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.preview-badge-card .card-type {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--card-color);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.preview-badge-card .card-holo {
  position: absolute;
  top: -100%;
  left: -100%;
  width: 300%;
  height: 300%;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 45%,
    rgba(255, 255, 255, 0.25) 50%,
    rgba(255, 255, 255, 0) 55%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(-10deg);
  pointer-events: none;
  z-index: 5;
  animation: holo-shimmer 3s infinite linear;
}

@media (max-width: 400px) {
  .preview-badge-card {
    width: 250px;
    height: 350px;
    padding: 15px;
  }
  .preview-badge-card .card-illustration svg {
    width: 90px;
    height: 90px;
  }
  .preview-badge-card .card-name {
    font-size: 1.1rem;
  }
  .preview-badge-card .card-lvl {
    font-size: 0.8rem;
    padding: 2px 12px;
  }
}

.modal-close {
  position: absolute;
  top: 20px; right: 20px;
  background: rgba(255,255,255,0.05);
  border: none; color: #fff;
  width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}

.share-btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

.btn-share {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  border: none;
  transition: transform 0.2s;
}

.btn-download { background: var(--primary); color: #fff; }
.btn-copy { background: rgba(255,255,255,0.05); color: #fff; border: 1px solid rgba(255,255,255,0.1); }
.btn-share:hover { transform: translateY(-2px); }

/* ── Neosys Aeon Community Integration (v4.2.4) ── */
.community-banner {
  margin-top: 40px;
  margin-bottom: 60px;
}

.community-card {
  background: #050510;
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 20px;
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 20px rgba(167, 139, 250, 0.05);
}

.community-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(167, 139, 250, 0.1), transparent 70%);
  pointer-events: none;
}

.community-content h2 {
  color: #fff;
  letter-spacing: -0.02em;
}

.community-content p {
  color: rgba(255, 255, 255, 0.6);
  max-width: 400px;
}

.btn-neosys {
  background: linear-gradient(135deg, #a78bfa 0%, #7dd3fc 100%);
  color: #050510 !important;
  padding: 14px 28px;
  border-radius: 50px;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 8px 15px rgba(167, 139, 250, 0.3);
  border: none;
  text-decoration: none;
}

.btn-neosys:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 15px 30px rgba(167, 139, 250, 0.5);
  filter: brightness(1.1);
}

.btn-sparkle {
  font-size: 1.2rem;
  animation: neosys-sparkle-pulse 2s ease-in-out infinite;
}

@keyframes neosys-sparkle-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

@media (max-width: 768px) {
  .community-card {
    flex-direction: column;
    text-align: center;
    padding: 30px;
  }
  .community-content p {
    margin: 0 auto 24px;
  }
}

/* ============================================================
   DARK MODE — Glassy Premium Design Overrides
   ============================================================ */

html.dark-theme, body.dark-theme {
  --bg-color: #0b0f19;
  --text-color: #f8fafc;
  --text-muted: #94a3b8;
  --surface: rgba(15, 23, 42, 0.45);
  --border: rgba(255, 255, 255, 0.08);
  --surface-hover: rgba(30, 41, 59, 0.6);
  --bg-note: rgba(0, 242, 255, 0.03);
  --border-cyan: rgba(0, 242, 255, 0.1);
  --bg: #0b0f19;
  --bg-alt: #0e1726;
  --fg: #f8fafc;
  --fg-muted: #94a3b8;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  --primary-10: rgba(39, 126, 255, 0.15);
  --primary-20: rgba(39, 126, 255, 0.3);
  color-scheme: dark;
  background-color: #0b0f19 !important;
  color: #f8fafc !important;
}

/* Navigation Header & Footer Glassy Dark Overrides */
html.dark-theme .dash-header {
  background: rgba(11, 15, 25, 0.8) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark-theme .global-header {
  background: linear-gradient(135deg, #0e1726 0%, #0b0f19 50%, #1e293b 100%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
}

html.dark-theme .logo-text {
  color: #f8fafc !important;
}

html.dark-theme .nav-link {
  color: #94a3b8 !important;
}

html.dark-theme .nav-link:hover {
  color: var(--primary) !important;
}

html.dark-theme .nav-user-orb {
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

html.dark-theme .global-footer {
  background: #0b0f19 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3) !important;
}

html.dark-theme .global-footer .footer-tagline,
html.dark-theme .global-footer .copyright,
html.dark-theme .global-footer .footer-trademark {
  color: #94a3b8 !important;
}

html.dark-theme .hero,
html.dark-theme #proceso,
html.dark-theme #standards,
html.dark-theme #portal,
html.dark-theme #siip-nextgen,
html.dark-theme #pricing {
  background: #0b0f19 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
}

/* Hero Brand Logo — Dark Mode */
html.dark-theme .hero-brand-stem {
  color: #7baaf7 !important;
  -webkit-text-fill-color: #7baaf7 !important;
}

html.dark-theme .hero-brand-reg {
  color: #60a5fa !important;
  -webkit-text-fill-color: #60a5fa !important;
}

html.dark-theme .hero-brand-entity {
  color: #64748b !important;
}

html.dark-theme .hero-tagline {
  color: #e2e8f0 !important;
}

/* Dropdown Menu */
html.dark-theme .dd-panel {
  background: #0e1726 !important;
  box-shadow: 0 20px 60px -10px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.08) !important;
}

html.dark-theme .dd-item {
  color: #f8fafc !important;
}

html.dark-theme .dd-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

/* Pricing Grid Overrides */
html.dark-theme .pricing-card {
  background: rgba(15, 23, 42, 0.45) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
}

html.dark-theme .pricing-card.secondary {
  background: rgba(15, 23, 42, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark-theme .pricing-card.primary {
  background: rgba(39, 126, 255, 0.1) !important;
  border: 1px solid rgba(39, 126, 255, 0.3) !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
}

html.dark-theme .pricing-title {
  color: #fff !important;
}

/* Dashboard Progress Hero & Cards */
html.dark-theme .progress-hero {
  background: linear-gradient(135deg, rgba(39, 126, 255, 0.12) 0%, rgba(15, 23, 42, 0.6) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark-theme .progress-circle-bg {
  stroke: rgba(255, 255, 255, 0.05) !important;
}

html.dark-theme .stat-card {
  background: rgba(15, 23, 42, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark-theme .stat-card:hover {
  background: rgba(30, 41, 59, 0.6) !important;
}

html.dark-theme .milestone {
  background: rgba(15, 23, 42, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark-theme .milestone.unlocked {
  background: linear-gradient(145deg, rgba(39, 126, 255, 0.18), rgba(15, 23, 42, 0.65)) !important;
  border-color: var(--primary) !important;
}

/* Module Cards & Locked States */
html.dark-theme .card {
  background: rgba(15, 23, 42, 0.45) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
}

html.dark-theme .card:hover {
  border-color: var(--primary) !important;
  box-shadow: 0 10px 32px rgba(39, 126, 255, 0.25) !important;
}

html.dark-theme .card-locked .lock-overlay {
  background: rgba(11, 15, 25, 0.6) !important;
}

html.dark-theme .lock-cta {
  box-shadow: 0 4px 12px rgba(39, 126, 255, 0.5) !important;
}

/* Profile Wrap */
html.dark-theme .profile-wrap {
  background: rgba(15, 23, 42, 0.45) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
}

html.dark-theme .profile-avatar-preview {
  border-color: #0b0f19 !important;
}

html.dark-theme .edit-p-btn {
  border-color: #0b0f19 !important;
}

/* Tutor interactive panes */
html.dark-theme .reader-pane,
html.dark-theme .chat-container {
  background: rgba(15, 23, 42, 0.45) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
  color: #f8fafc !important;
}

html.dark-theme .reader-content {
  color: #f8fafc !important;
}

html.dark-theme .msg-user {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
}

html.dark-theme .chat-locked-overlay {
  background: rgba(11, 15, 25, 0.85) !important;
  color: #f8fafc !important;
}

html.dark-theme .messages-area::-webkit-scrollbar-thumb,
html.dark-theme .reader-pane::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1) !important;
}

html.dark-theme .tts-toolbar {
  background: rgba(255, 255, 255, 0.02) !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
}

html.dark-theme .tts-btn {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Forms & Text inputs */
html.dark-theme .input-text {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
}

html.dark-theme .input-text:focus {
  border-color: var(--primary) !important;
}

html.dark-theme .btn-secondary {
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #f8fafc !important;
}

html.dark-theme .btn-secondary:hover {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

/* Badge preview overlays & Holographic */
html.dark-theme .preview-badge-card {
  background: rgba(15, 23, 42, 0.75) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

/* ── Theme Toggle Button Styles ── */
.theme-toggle-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.2s, background-color 0.2s, transform 0.2s;
  width: 36px;
  height: 36px;
  outline: none;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  color: var(--primary);
  background-color: var(--primary-10);
  transform: scale(1.05);
}

.theme-toggle-btn:active {
  transform: scale(0.95);
}

/* Hide/show Icons based on theme */
.theme-toggle-btn .sun-icon {
  display: none;
}

.theme-toggle-btn .moon-icon {
  display: block;
}

html.dark-theme .theme-toggle-btn .sun-icon,
body.dark-theme .theme-toggle-btn .sun-icon {
  display: block;
  color: #f59e0b; /* Golden sun */
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.4));
}

html.dark-theme .theme-toggle-btn .moon-icon,
body.dark-theme .theme-toggle-btn .moon-icon {
  display: none;
}

/* Login Page Specific Dark Theme Overrides */
html.dark-theme .login-nav {
  background: rgba(11, 15, 25, 0.9) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark-theme .nav-brand {
  color: #f8fafc !important;
}

html.dark-theme .panel-right {
  background: #0b0f19 !important;
}

html.dark-theme .f-title {
  color: #f8fafc !important;
}

html.dark-theme .f-sub {
  color: rgba(255, 255, 255, 0.6) !important;
}

html.dark-theme .divider {
  color: rgba(255, 255, 255, 0.4) !important;
}

html.dark-theme .divider::before,
html.dark-theme .divider::after {
  background: rgba(255, 255, 255, 0.1) !important;
}

html.dark-theme .register-cta {
  color: rgba(255, 255, 255, 0.6) !important;
  border-top-color: rgba(255, 255, 255, 0.1) !important;
}

/* SIIP NextGen Dark Mode Overrides */
html.dark-theme .acronym-letter-card,
html.dark-theme .siip-details {
  background: rgba(15, 23, 42, 0.45) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: var(--shadow) !important;
}

html.dark-theme .acronym-letter-card:hover {
  border-color: rgba(39, 126, 255, 0.4) !important;
  box-shadow: 0 10px 30px -10px rgba(39, 126, 255, 0.3) !important;
}

html.dark-theme .acronym-letter-card.highlight {
  background: linear-gradient(135deg, rgba(39, 126, 255, 0.08) 0%, rgba(0, 168, 150, 0.08) 100%) !important;
  border-color: rgba(39, 126, 255, 0.3) !important;
}

html.dark-theme .acronym-letter-card.highlight:hover {
  border-color: rgba(39, 126, 255, 0.5) !important;
  box-shadow: 0 10px 30px -10px rgba(39, 126, 255, 0.3) !important;
}

/* ============================================================
   CHALLENGE GRID AND CARD ENHANCEMENTS (OCDE 2025)
   ============================================================ */
.challenge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin: 32px 0 40px;
  text-align: left;
}

.challenge-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.challenge-card:hover {
  transform: translateY(-5px);
  background: var(--surface-hover);
  border-color: var(--primary);
  box-shadow: 0 12px 30px rgba(39, 126, 255, 0.15);
}

.challenge-card .stat-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--teal);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.challenge-card .stat-val {
  font-family: var(--font-head);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.challenge-card .stat-val-sub {
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
}

.challenge-card .stat-desc {
  font-size: 0.95rem;
  color: var(--text-color);
  line-height: 1.6;
  margin-bottom: 16px;
  font-weight: 500;
  opacity: 0.9;
}

.challenge-card .stat-context {
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: auto;
}

/* ============================================================
   CLERK USER BUTTON GLASSY OVERRIDES
   ============================================================ */
.cl-userButtonPopoverCard {
  background-color: var(--bg-color) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

.cl-userButtonPopoverFooter {
  background-color: var(--surface) !important;
  border-top: 1px solid var(--border) !important;
}

.cl-userButtonPopoverActionButton {
  color: var(--text-color) !important;
}

.cl-userButtonPopoverActionButton:hover {
  background-color: var(--surface-hover) !important;
}

.cl-userButtonPopoverActionButtonText {
  color: var(--text-color) !important;
}

.cl-userButtonPopoverMain {
  background-color: var(--bg-color) !important;
}

html.dark-theme .cl-userButtonPopoverCard {
  background-color: #111827 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 10px 45px rgba(0, 0, 0, 0.6) !important;
}

html.dark-theme .cl-userButtonPopoverFooter {
  background-color: #1f2937 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

html.dark-theme .cl-userButtonPopoverActionButton {
  color: #f3f4f6 !important;
}

html.dark-theme .cl-userButtonPopoverActionButton:hover {
  background-color: #374151 !important;
}

html.dark-theme .cl-userButtonPopoverActionButtonText {
  color: #f3f4f6 !important;
}

html.dark-theme .cl-userButtonPopoverMain {
  background-color: #111827 !important;
}

/* ── Hamburger Menu Button and Dropdown Styles ── */
.hamburger-btn {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text-color);
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background-color 0.2s, color 0.2s;
  width: 38px;
  height: 38px;
  outline: none;
  flex-shrink: 0;
}

.hamburger-btn:hover {
  background-color: rgba(39, 126, 255, 0.08);
  color: var(--primary);
}

.hamburger-btn .hamburger-icon {
  width: 22px;
  height: 22px;
}

.mobile-dropdown-menu {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, rgba(241, 245, 249, 0.96) 0%, rgba(226, 232, 240, 0.96) 50%, rgba(255, 255, 255, 0.96) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 2px solid #cbd5e1;
  padding: 12px 24px;
  gap: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  z-index: 999;
}

.mobile-link {
  color: var(--text-color);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
}

.mobile-link:hover {
  background: rgba(39, 126, 255, 0.1);
  color: var(--primary);
  transform: translateX(4px);
}

/* Dark theme overrides for mobile dropdown */
html.dark-theme .mobile-dropdown-menu,
body.dark-theme .mobile-dropdown-menu {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96) 0%, rgba(30, 41, 59, 0.96) 50%, rgba(15, 23, 42, 0.96) 100%);
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

html.dark-theme .mobile-link,
body.dark-theme .mobile-link {
  color: #f1f5f9;
}

html.dark-theme .mobile-link:hover,
body.dark-theme .mobile-link:hover {
  background: rgba(39, 126, 255, 0.15);
  color: #3b82f6;
}

@keyframes slideDown {
  from {
    transform: translateY(-8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Responsive hamburger trigger */
@media (max-width: 640px) {
  .hamburger-btn {
    display: flex;
  }
  
  .hide-mobile {
    display: none !important;
  }
  
  .global-header.mobile-nav-open .mobile-dropdown-menu {
    display: flex;
    animation: slideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
}

/* WoS Glass Subtitle */
.wos-glass-subtitle {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(15, 23, 42, 0.65);
  background: rgba(15, 23, 42, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 8px 18px;
  border-radius: 9999px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.01);
  transition: all 0.3s ease;
}

html.dark-theme .wos-glass-subtitle,
body.dark-theme .wos-glass-subtitle {
  color: rgba(248, 250, 252, 0.7);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* ===== LANGUAGE SWITCHER ===== */
.lang-switcher {
  display: flex;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: transparent;
  align-items: center;
  height: 32px;
  flex-shrink: 0;
}

.lang-btn {
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: all 0.22s ease;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
  outline: none;
}

.lang-btn.active {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-color);
}

html.dark-theme .lang-btn.active,
body.dark-theme .lang-btn.active {
  background: rgba(148, 163, 184, 0.22);
  color: var(--text-color);
}

.lang-btn:hover:not(.active) {
  color: var(--text-color);
  background: rgba(148, 163, 184, 0.08);
}

html.dark-theme .lang-btn:hover:not(.active),
body.dark-theme .lang-btn:hover:not(.active) {
  color: var(--text-color);
  background: rgba(255, 255, 255, 0.04);
}

/* Mobile Dropdown Custom Helpers */
.mobile-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 16px;
  opacity: 0.6;
}

.mobile-dropdown-lang-row {
  display: flex;
  justify-content: center;
  padding: 8px 16px;
}

.mobile-dropdown-lang-row .lang-switcher {
  display: flex !important; /* Ensure it shows inside dropdown */
  height: 36px;
}

.mobile-dropdown-lang-row .lang-btn {
  padding: 6px 14px;
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .global-header .nav-auth-group {
    display: none !important;
  }
}

/* ── Content Protection: Prevent user-selection of proprietary reading text ── */
#module-content, .reader-pane, .module-body {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
}

