/* =====================================================
   NUR — Quran Learning Platform
   Design System: Modern Noble Islamic / Glassmorphism
   ===================================================== */

/* ---- 1. CSS Variables ---- */
:root {
  /* Core Palette */
  --bg-base: #070e14;
  --bg-surface: #0b1520;
  --emerald-deep: #0f3d2e;
  --emerald-glow: #34d47a;
  --emerald-bright: #4ade9e;
  --gold: #c8a45e;
  --gold-light: #e2c27a;
  --gold-dim: rgba(200, 164, 94, 0.15);
  --violet: #818cf8;

  /* Glass */
  --glass-bg: rgba(15, 35, 45, 0.55);
  --glass-border: rgba(52, 212, 122, 0.12);
  --glass-border-hover: rgba(200, 164, 94, 0.5);
  --glass-blur: blur(18px);

  /* Text */
  --text-primary: #e8f4ee;
  --text-secondary: rgba(232, 244, 238, 0.6);
  --text-muted: rgba(232, 244, 238, 0.35);

  /* Sizing */
  --header-h: 72px;
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;

  /* Animation */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 0.25s;
}

/* ---- 2. Reset & Base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

img {
  max-width: 100%;
}

/* ---- 3. Islamic Background Pattern ---- */
.bg-pattern {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-pattern::before {
  content: '';
  position: absolute;
  inset: -10%;
  background-image:
    repeating-linear-gradient(0deg,
      transparent,
      transparent 58px,
      rgba(52, 212, 122, 0.04) 58px,
      rgba(52, 212, 122, 0.04) 60px),
    repeating-linear-gradient(90deg,
      transparent,
      transparent 58px,
      rgba(52, 212, 122, 0.04) 58px,
      rgba(52, 212, 122, 0.04) 60px),
    repeating-linear-gradient(45deg,
      transparent,
      transparent 40px,
      rgba(52, 212, 122, 0.025) 40px,
      rgba(52, 212, 122, 0.025) 42px),
    repeating-linear-gradient(-45deg,
      transparent,
      transparent 40px,
      rgba(52, 212, 122, 0.025) 40px,
      rgba(52, 212, 122, 0.025) 42px);
  opacity: 0.8;
}

/* Islamic star / hex overlay */
.bg-pattern::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 120% 80% at 50% 0%, rgba(13, 61, 46, 0.35) 0%, transparent 70%),
    radial-gradient(ellipse 80% 60% at 0% 100%, rgba(7, 30, 50, 0.4) 0%, transparent 60%);
}

/* ---- 4. Center Glow ---- */
.center-glow {
  position: fixed;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(52, 212, 122, 0.06) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
  animation: glow-pulse 6s ease-in-out infinite;
}

@keyframes glow-pulse {

  0%,
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  50% {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(1.05);
  }
}

/* ---- 5. App Container ---- */
.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* ---- 6. Header ---- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(7, 14, 20, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(52, 212, 122, 0.1);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 32px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(52, 212, 122, 0.1);
  border: 1px solid rgba(52, 212, 122, 0.25);
  border-radius: 10px;
  transition: all var(--dur) var(--ease);
}

.logo:hover .logo-icon {
  background: rgba(52, 212, 122, 0.18);
  box-shadow: 0 0 20px rgba(52, 212, 122, 0.2);
}

.logo-text {
  font-family: 'Amiri', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.logo-sub {
  font-family: 'Playfair Display', serif;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--emerald-bright);
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.05em;
}

/* Nav */
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-link {
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--dur) var(--ease);
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: var(--emerald-bright);
  background: rgba(52, 212, 122, 0.1);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  transition: all var(--dur) var(--ease);
}

.lang-btn.active,
.lang-btn:hover {
  background: rgba(52, 212, 122, 0.15);
  color: var(--emerald-bright);
}

/* Icon Button */
.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all var(--dur) var(--ease);
}

.icon-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.notif-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald-bright);
  box-shadow: 0 0 8px var(--emerald-bright);
  animation: dot-pulse 2s ease-in-out infinite;
}

@keyframes dot-pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.4);
    opacity: 0.7;
  }
}

/* Profile */
.profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 5px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all var(--dur) var(--ease);
}

.profile-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(52, 212, 122, 0.2);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--emerald-deep), #1a5c3a);
  border: 1px solid rgba(52, 212, 122, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--emerald-bright);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.profile-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
}

.profile-level {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f87171;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}

.btn-logout:hover {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.3);
}

/* ---- 7. Main Content ---- */
.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 32px 80px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* ---- 8. Glass Card ---- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(52, 212, 122, 0.04) 0%, transparent 50%);
  pointer-events: none;
  border-radius: inherit;
}

/* ---- 9. Greeting Section ---- */
.greeting-section {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 32px;
  align-items: start;
}

.greeting-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 8px;
}

.bismillah {
  font-family: 'Amiri', serif;
  font-size: 1.3rem;
  color: var(--gold);
  letter-spacing: 0.02em;
  line-height: 1.6;
}

.greeting-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

.greeting-name {
  background: linear-gradient(135deg, var(--emerald-bright), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.greeting-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 480px;
}

.greeting-btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* Ayah Card */
.ayah-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ayah-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ayah-badge {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--emerald-bright);
  background: rgba(52, 212, 122, 0.1);
  border: 1px solid rgba(52, 212, 122, 0.2);
  padding: 3px 10px;
  border-radius: 20px;
}

.ayah-ref {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ayah-ar {
  font-family: 'Amiri', serif;
  font-size: 1.6rem;
  line-height: 1.8;
  color: var(--gold-light);
  text-align: center;
  padding: 8px 0;
}

.ayah-tr {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  font-style: italic;
}

.ayah-play-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--emerald-bright);
  background: rgba(52, 212, 122, 0.1);
  border: 1px solid rgba(52, 212, 122, 0.2);
  transition: all var(--dur) var(--ease);
}

.ayah-play-btn:hover {
  background: rgba(52, 212, 122, 0.18);
  box-shadow: 0 0 15px rgba(52, 212, 122, 0.15);
}

/* ---- 10. Buttons ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #071510;
  background: linear-gradient(135deg, var(--emerald-bright), #26c271);
  box-shadow: 0 4px 24px rgba(52, 212, 122, 0.25);
  transition: all var(--dur) var(--ease);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(52, 212, 122, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--dur) var(--ease);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* ---- 11. Stats Row ---- */
.stats-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 20px;
}

.stat-card {
  padding: 24px;
}

.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stat-badge {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-badge.rec {
  background: rgba(200, 164, 94, 0.1);
  color: var(--gold);
  border-color: rgba(200, 164, 94, 0.2);
}

/* Circular Progress */
.progress-widget {
  display: flex;
  align-items: center;
  gap: 20px;
}

.circ-prog {
  position: relative;
  width: 110px;
  height: 110px;
  flex-shrink: 0;
}

.circ-svg {
  width: 110px;
  height: 110px;
  transform: rotate(-90deg);
}

.circ-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 10;
}

.circ-fill {
  fill: none;
  stroke: url(#prog-grad);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 295;
  transition: stroke-dashoffset 1.5s var(--ease);
}

.circ-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.circ-pct {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.circ-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.prog-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.prog-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.prog-emoji {
  font-size: 1rem;
}

.prog-item strong {
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-right: 4px;
}

/* Add gradient def to document via CSS hack */
.circ-svg defs {
  display: none;
}

/* Streak Widget */
.streak-widget {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.flame-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.flame-emoji {
  font-size: 2rem;
  animation: flame-dance 2s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(251, 146, 60, 0.6));
}

@keyframes flame-dance {

  0%,
  100% {
    transform: scale(1) rotate(-2deg);
  }

  25% {
    transform: scale(1.08) rotate(1deg);
  }

  75% {
    transform: scale(0.95) rotate(-1deg);
  }
}

.streak-num {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold-light);
}

.streak-lbl {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.week-track {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.week-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.week-labels span {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.02em;
}

.week-dots {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.dot {
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.dot.done {
  background: linear-gradient(135deg, rgba(52, 212, 122, 0.25), rgba(52, 212, 122, 0.12));
  border-color: rgba(52, 212, 122, 0.3);
}

.dot.today {
  background: linear-gradient(135deg, rgba(200, 164, 94, 0.3), rgba(200, 164, 94, 0.12));
  border-color: rgba(200, 164, 94, 0.5);
  box-shadow: 0 0 12px rgba(200, 164, 94, 0.2);
  animation: today-pulse 2s ease-in-out infinite;
}

@keyframes today-pulse {

  0%,
  100% {
    box-shadow: 0 0 8px rgba(200, 164, 94, 0.2);
  }

  50% {
    box-shadow: 0 0 18px rgba(200, 164, 94, 0.4);
  }
}

.daily-goal {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.daily-goal span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.goal-bar-bg {
  height: 6px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 3px;
  overflow: hidden;
}

.goal-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--emerald-bright), #26c271);
  transition: width 1s var(--ease);
}

/* Next Lesson Card */
.next-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.next-lesson {
  display: flex;
  align-items: center;
  gap: 14px;
}

.next-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(52, 212, 122, 0.1);
  border: 1px solid rgba(52, 212, 122, 0.15);
  flex-shrink: 0;
}

.next-meta h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.next-meta p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.lesson-bar-wrap {
  height: 5px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 3px;
  overflow: hidden;
}

.lesson-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--violet), #a5b4fc);
}

.lesson-pct-lbl {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: -6px;
}

/* ---- 12. Section Header ---- */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
}

.section-link {
  font-size: 0.82rem;
  color: var(--emerald-bright);
  font-weight: 500;
  opacity: 0.8;
  transition: opacity var(--dur) var(--ease);
}

.section-link:hover {
  opacity: 1;
}

/* ---- 13. Module Cards ---- */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.module-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}

.module-card:not(.locked):hover {
  border-color: var(--glass-border-hover);
  box-shadow: 0 8px 40px rgba(200, 164, 94, 0.1), 0 0 0 1px rgba(200, 164, 94, 0.15);
  transform: translateY(-3px);
}

.module-card:focus {
  outline: 2px solid var(--emerald-bright);
  outline-offset: 2px;
}

.module-card.locked {
  opacity: 0.5;
  filter: grayscale(100%);
  cursor: default;
}

.module-card.locked .mod-icon-wrap {
  box-shadow: none;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.mod-icon-wrap {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--c) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
  box-shadow: 0 4px 20px color-mix(in srgb, var(--c) 10%, transparent);
  transition: all var(--dur) var(--ease);
  flex-shrink: 0;
}

.module-card:not(.locked):hover .mod-icon-wrap {
  box-shadow: 0 4px 30px color-mix(in srgb, var(--c) 25%, transparent);
}

.mod-icon-ar {
  font-family: 'Amiri', serif;
  font-size: 1.4rem;
  color: var(--c, #4ade9e);
  font-weight: 700;
}

.mod-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.mod-body h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mod-body p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Level Badges */
.level-badge {
  display: inline-block;
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  width: fit-content;
  margin-bottom: 2px;
}

.level-badge.beginner {
  background: rgba(52, 212, 122, 0.1);
  color: var(--emerald-bright);
  border: 1px solid rgba(52, 212, 122, 0.2);
}

.level-badge.intermediate {
  background: rgba(129, 140, 248, 0.1);
  color: var(--violet);
  border: 1px solid rgba(129, 140, 248, 0.2);
}

.level-badge.advanced {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.mod-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.mod-meta span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Module Progress */
.mod-foot {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mod-bar-bg {
  height: 5px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 3px;
  overflow: hidden;
}

.mod-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1.2s var(--ease);
}

.mod-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
}

.mod-pct {
  color: var(--text-secondary);
  font-weight: 500;
}

.mod-bar-labels span:last-child {
  color: var(--text-muted);
}

.lock-lbl {
  color: var(--gold);
  opacity: 0.7;
}

/* Locked Module */
.locked-module {
  opacity: 0.65;
}

.locked-module:hover {
  opacity: 0.85;
}

/* Featured */
.featured {
  position: relative;
}

.featured-star {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--gold);
  background: rgba(200, 164, 94, 0.1);
  border: 1px solid rgba(200, 164, 94, 0.2);
  padding: 3px 8px;
  border-radius: 6px;
}

/* Card Glow effect on hover */
.card-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, rgba(200, 164, 94, 0.06), transparent 70%);
}

.module-card:hover .card-glow {
  opacity: 1;
}

/* ---- 14. Achievements ---- */
.achievements-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.ach-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  filter: grayscale(60%) brightness(0.6);
  min-width: 80px;
}

.ach-badge.earned {
  filter: none;
  background: rgba(200, 164, 94, 0.07);
  border-color: rgba(200, 164, 94, 0.2);
}

.ach-badge.earned:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(200, 164, 94, 0.15);
  border-color: rgba(200, 164, 94, 0.4);
}

.ach-ico {
  font-size: 1.8rem;
  font-family: 'Amiri', serif;
  line-height: 1;
}

.ach-badge span {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
}

/* ---- 15. Toast ---- */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(15, 35, 45, 0.95);
  border: 1px solid rgba(52, 212, 122, 0.3);
  backdrop-filter: blur(20px);
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.875rem;
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 9999;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
  opacity: 0;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ---- 16. SVG Gradient (injected) ---- */
.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ---- 17. Responsive ---- */
@media (max-width: 1100px) {
  .greeting-section {
    grid-template-columns: 1fr;
  }

  .greeting-right {
    max-width: 500px;
  }

  .modules-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-row {
    grid-template-columns: 1fr 1fr;
  }

  .next-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .header-inner {
    padding: 0 20px;
    gap: 16px;
  }

  .header-nav {
    display: none;
  }

  .profile-info {
    display: none;
  }

  .main {
    padding: 24px 20px 60px;
    gap: 28px;
  }

  .greeting-title {
    font-size: 2rem;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

  .modules-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .achievements-row {
    gap: 10px;
  }

  .ach-badge {
    min-width: 70px;
    padding: 12px 14px;
  }
}

@media (max-width: 500px) {
  .modules-grid {
    grid-template-columns: 1fr;
  }

  .greeting-btns {
    flex-direction: column;
  }

  .btn-primary,
  .btn-ghost {
    justify-content: center;
  }
}

/* ---- 18. Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(52, 212, 122, 0.2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(52, 212, 122, 0.35);
}

/* ---- 19. Selection ---- */
::selection {
  background: rgba(52, 212, 122, 0.25);
  color: var(--text-primary);
}