/* ============================================================
   BUSINESS ENGLISH BRIDGE — Design System & Styles
   ============================================================ */

/* --- CSS Variables / Tokens --- */
:root {
  --bg-base:       #F0F4FF;
  --bg-card:       #FFFFFF;
  --bg-card-hover: #F8FAFF;
  --bg-glass:      rgba(255,255,255,0.75);
  --border:        #DDE3F0;
  --border-bright: #B8C5E0;

  --primary:       #2563EB;
  --primary-dark:  #1D4ED8;
  --primary-glow:  rgba(37,99,235,0.20);
  --accent:        #D97706;
  --accent-soft:   rgba(217,119,6,0.12);
  --success:       #059669;
  --success-soft:  rgba(5,150,105,0.12);
  --danger:        #DC2626;
  --danger-soft:   rgba(220,38,38,0.10);
  --locked:        #CBD5E1;

  --text-1: #0F172A;
  --text-2: #475569;
  --text-3: #94A3B8;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow-card: 0 4px 24px rgba(37,99,235,0.10);
  --shadow-glow: 0 0 40px var(--primary-glow);

  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: 0.5s cubic-bezier(0.4,0,0.2,1);
}

/* --- Dark Mode Theme --- */
body.dark-mode {
  --bg-base:       #0F172A;
  --bg-card:       #1E293B;
  --bg-card-hover: #334155;
  --bg-glass:      rgba(30, 41, 59, 0.75);
  --border:        #334155;
  --border-bright: #475569;
  
  --primary-glow:  rgba(37,99,235,0.30);
  --accent-soft:   rgba(217,119,6,0.20);
  --success-soft:  rgba(5,150,105,0.20);
  --danger-soft:   rgba(220,38,38,0.20);
  --locked:        #475569;

  --text-1: #F8FAFC;
  --text-2: #CBD5E1;
  --text-3: #94A3B8;

  --shadow-card: 0 4px 24px rgba(0,0,0,0.30);
  --shadow-glow: 0 0 40px var(--primary-glow);
}

body.dark-mode {
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(37,99,235,0.15) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 80% 80%, rgba(217,119,6,0.10) 0%, transparent 60%);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-base);
  color: var(--text-1);
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(37,99,235,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 80% 80%, rgba(217,119,6,0.06) 0%, transparent 60%);
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #E2E8F0; }
::-webkit-scrollbar-thumb { background: #94A3B8; border-radius: 99px; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 2rem;
  height: 70px;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.nav-inner {
  width: 100%;
  max-width: 100%;
  padding: 0 2rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  cursor: pointer;
}
.nav-logo-img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
}
.nav-logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  color: var(--text-2);
  line-height: 1.3;
}
.nav-logo-text strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-1);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}
.nav-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-bright);
  color: var(--text-1);
}
.nav-progress-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.35rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-2);
  white-space: nowrap;
}
.nav-pill-bar {
  width: 60px;
  height: 5px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.nav-pill-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 99px;
  transition: width var(--transition-slow);
  width: 6.25%;
}

/* ============================================================
   APP CONTAINER
   ============================================================ */
#app {
  padding-top: 70px;
  min-height: calc(100vh - 120px);
}

/* ============================================================
   LANDING / HERO
   ============================================================ */
.hero {
  min-height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem 6rem;
  position: relative;
  overflow: hidden;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-soft);
  border: 1px solid rgba(245,158,11,0.3);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
  border-radius: 99px;
  margin-bottom: 1.5rem;
  animation: fadeSlideDown 0.6s ease both;
}

.hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  animation: fadeSlideDown 0.7s ease both;
}
.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, #818CF8 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-2);
  max-width: 600px;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  animation: fadeSlideDown 0.8s ease both;
}

.hero-cta-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeSlideDown 0.9s ease both;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #6366F1);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.9rem 2rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 0 30px var(--primary-glow);
  transition: var(--transition);
  text-decoration: none;
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 50px var(--primary-glow), 0 8px 30px rgba(0,0,0,0.4);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-1);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.9rem 2rem;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: var(--transition);
  text-decoration: none;
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* Hero Stats */
.hero-stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4rem;
  animation: fadeSlideDown 1s ease both;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 2rem;
  text-align: center;
  min-width: 130px;
  backdrop-filter: blur(12px);
  transition: var(--transition);
}
.stat-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 0 30px var(--primary-glow);
}
.stat-number {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-1);
  display: block;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-2);
  margin-top: 0.25rem;
}

/* 3D Isometric Map (Home Page) */
.map-3d-section-title {
  text-align: center;
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  margin-top: 4rem;
  color: var(--text-1);
}

.map-3d-wrapper {
  width: 100%;
  max-width: 1200px;
  margin: 1rem auto 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 3rem 1rem 5rem;
  perspective: 1200px;
  margin: 3rem auto 0;
  overflow: visible;
  padding: 2rem 1rem 10rem;
  animation: fadeSlideDown 1.1s ease both;
}

.map-3d-grid {
  display: grid;
  grid-template-columns: repeat(4, 200px);
  grid-auto-rows: 160px;
  gap: 7.5rem 2rem; /* Much larger vertical gap to prevent tall signposts from overlapping */
  justify-content: center;
  position: relative;
  /* True Isometric Projection */
  transform: rotateX(45deg) rotateZ(-35deg); /* Slightly flatter projection to space out rows vertically */
  transform-style: preserve-3d;
  margin: 0 auto;
}

.isometric-road-svg {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: -1;
  pointer-events: none;
}

.map-3d-node-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
}

.map-3d-card {
  /* Stand upright on isometric plane */
  transform: rotateZ(35deg) rotateX(-45deg);
  transform-origin: bottom center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
}

.map-3d-card:hover {
  transform: rotateZ(35deg) rotateX(-45deg) translateY(-20px);
}

.map-3d-card.start-card, .map-3d-card.end-card {
  transform: rotateZ(35deg) rotateX(-45deg) translateY(-50px);
}
.map-3d-card.start-card:hover, .map-3d-card.end-card:hover {
  transform: rotateZ(35deg) rotateX(-45deg) translateY(-70px);
}

.map-3d-signpost {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Stand upright on isometric plane */
  transform: rotateZ(35deg) rotateX(-45deg);
  transform-origin: bottom center;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
}

.map-3d-signpost:hover {
  transform: rotateZ(35deg) rotateX(-45deg) translateY(-20px);
}

.signpost-board {
  background: var(--bg-card);
  border: 4px solid var(--node-color);
  border-radius: 12px;
  padding: 1rem 0.5rem;
  text-align: center;
  width: 150px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
  position: relative;
  z-index: 2;
}

.signpost-pole {
  width: 14px;
  height: 60px;
  background: linear-gradient(to right, #94a3b8, #cbd5e1, #64748b);
  border-radius: 7px;
  margin-top: -10px;
  z-index: 1;
  box-shadow: 5px 5px 15px rgba(0,0,0,0.3);
}

.signpost-base {
  width: 45px;
  height: 15px;
  background: #64748b;
  border-radius: 50%;
  margin-top: -7px;
  z-index: 0;
  box-shadow: inset 0 -4px 6px rgba(0,0,0,0.3), 0 5px 10px rgba(0,0,0,0.4);
}

.map-3d-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  /* Elaborate 3D drop shadow to make emojis look like 3D blocks */
  text-shadow: 
    0 1px 0 #ccc,
    0 2px 0 #c9c9c9,
    0 3px 0 #bbb,
    0 4px 0 #b9b9b9,
    0 5px 0 #aaa,
    0 6px 1px rgba(0,0,0,.1),
    0 0 5px rgba(0,0,0,.1),
    0 1px 3px rgba(0,0,0,.3),
    0 3px 5px rgba(0,0,0,.2),
    0 5px 10px rgba(0,0,0,.25),
    0 10px 10px rgba(0,0,0,.2),
    0 20px 20px rgba(0,0,0,.15);
}

.node-3d-img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 15px 15px rgba(0,0,0,0.35));
  margin-bottom: -10px;
}

.map-3d-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.2;
  transform: translateZ(20px);
}

/* Connectors */
.connector-right, .connector-left, .connector-down {
  position: absolute;
  z-index: 1;
  opacity: 0.5;
  transform: translateZ(0);
}

.connector-right {
  top: 50%;
  left: 50%;
  width: calc(100% + 2rem);
  height: 0;
  border-top: 5px dotted;
}
.connector-left {
  top: 50%;
  right: 50%;
  width: calc(100% + 2rem);
  height: 0;
  border-top: 5px dotted;
}
.connector-down {
  top: 50%;
  left: 50%;
  width: 0;
  height: calc(100% + 3.5rem);
  border-left: 5px dotted;
}

/* Floating orbs */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  animation: floatOrb 8s ease-in-out infinite alternate;
}
.orb-1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(37,99,235,0.12), transparent 70%);
  top: -100px; left: -100px;
}
.orb-2 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(217,119,6,0.10), transparent 70%);
  bottom: 0; right: -50px;
  animation-delay: 2s;
}
.orb-3 {
  width: 250px; height: 250px;
  background: radial-gradient(circle, rgba(99,102,241,0.10), transparent 70%);
  top: 50%; right: 10%;
  animation-delay: 4s;
}

/* ============================================================
   DASHBOARD
   ============================================================ */
.dashboard-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}
.page-header {
  margin-bottom: 2.5rem;
}
.page-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.page-header p {
  color: var(--text-2);
  margin-top: 0.4rem;
  font-size: 0.95rem;
}

/* Overall Progress Bar */
.overall-progress {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.progress-info { flex: 1; min-width: 200px; }
.progress-info h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.progress-bar-outer {
  background: var(--border);
  border-radius: 99px;
  height: 10px;
  overflow: hidden;
}
.progress-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 99px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}
.progress-percent {
  font-family: 'Outfit', sans-serif;
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--accent);
  white-space: nowrap;
}

/* Week Grid */
.week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.week-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  animation: fadeSlideUp 0.5s ease both;
}
.week-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: var(--transition);
  border-radius: var(--radius-lg);
}
.week-card:not(.locked)::before {
  background: linear-gradient(135deg, var(--primary-glow), transparent);
}
.week-card:not(.locked):hover::before { opacity: 1; }
.week-card:not(.locked):hover {
  border-color: var(--primary);
  transform: translateY(-6px);
  box-shadow: var(--shadow-card), 0 0 30px var(--primary-glow);
}
.week-card.locked {
  opacity: 0.65;
  cursor: pointer;
}
.week-card.locked:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
  opacity: 0.85;
}
.week-card.completed {
  border-color: var(--success);
}
.week-card.completed::before {
  background: linear-gradient(135deg, var(--success-soft), transparent);
  opacity: 1;
}
.week-card.exam-week {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(245,158,11,0.08), var(--bg-card));
}
.week-card.exam-week:not(.locked):hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card), 0 0 30px rgba(245,158,11,0.25);
}

.week-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.week-number-badge {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.05em;
  color: var(--text-3);
  text-transform: uppercase;
}
.week-status-icon {
  font-size: 1.25rem;
}
.week-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: block;
}
.week-card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  line-height: 1.3;
}
.week-card p {
  font-size: 0.8rem;
  color: var(--text-2);
  line-height: 1.5;
}
.week-card-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.week-meta {
  font-size: 0.75rem;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.week-action-btn {
  font-size: 0.78rem;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  padding: 0.3rem 0.85rem;
  border-radius: 99px;
  border: 1px solid var(--primary);
  color: var(--primary);
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
}
.week-card:not(.locked) .week-action-btn:hover {
  background: var(--primary);
  color: #fff;
}
.week-card.completed .week-action-btn {
  border-color: var(--success);
  color: var(--success);
}
.week-card.completed .week-action-btn:hover {
  background: var(--success);
  color: #fff;
}
.week-card.exam-week .week-action-btn {
  border-color: var(--accent);
  color: var(--accent);
}
.week-card.exam-week .week-action-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* ============================================================
   WEEK DETAIL PAGE
   ============================================================ */
.week-detail-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}
.back-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-2);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  transition: var(--transition);
}
.back-btn:hover {
  border-color: var(--primary);
  color: var(--text-1);
  background: var(--bg-card);
}

.week-hero-banner {
  border-radius: var(--radius-xl);
  padding: 3rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(59,130,246,0.2) 0%, rgba(129,140,248,0.1) 100%);
  border: 1px solid rgba(59,130,246,0.3);
}
.week-hero-banner.exam-banner {
  background: linear-gradient(135deg, rgba(245,158,11,0.2) 0%, rgba(239,68,68,0.1) 100%);
  border-color: rgba(245,158,11,0.3);
}
.week-hero-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 1rem;
}
.week-hero-banner h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.week-hero-banner p {
  color: var(--text-2);
  font-size: 1rem;
  max-width: 600px;
  line-height: 1.7;
}
.week-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(59,130,246,0.15);
  border: 1px solid rgba(59,130,246,0.25);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  margin-bottom: 1rem;
}

/* Videos Section */
.section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.video-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.video-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}
.video-item:hover {
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
}
.video-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #DBEAFE, #EEF2FF);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
  cursor: pointer;
}
.video-thumb iframe {
  width: 100%;
  height: 100%;
  border: none;
  position: absolute;
  inset: 0;
}
.video-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(37,99,235,0.08);
  transition: var(--transition);
}
.video-play-btn {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary), #6366F1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 0 30px var(--primary-glow);
  transition: var(--transition);
}
.video-play-btn:hover { transform: scale(1.1); }
.video-info { padding: 1rem 1.25rem; }
.video-info h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}
.video-info span {
  font-size: 0.8rem;
  color: var(--text-2);
}

/* Start Practice CTA */
.start-practice-cta {
  background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(129,140,248,0.08));
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  text-align: center;
  margin-top: 2.5rem;
}
.start-practice-cta h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.start-practice-cta p {
  color: var(--text-2);
  margin-bottom: 1.5rem;
}

/* ============================================================
   PRACTICE PAGE
   ============================================================ */
.practice-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}

.practice-header {
  text-align: center;
  margin-bottom: 2rem;
}
.practice-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}
.practice-header p { color: var(--text-2); font-size: 0.9rem; }

/* Practice Progress */
.practice-progress-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}
.practice-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.practice-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 99px;
  transition: width 0.4s ease;
}
.practice-step-label {
  font-size: 0.8rem;
  color: var(--text-2);
  white-space: nowrap;
}

/* Question Card */
.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  animation: fadeSlideUp 0.4s ease both;
}
.question-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  color: var(--text-3);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  margin-bottom: 1.25rem;
}
.question-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 2rem;
}

/* MCQ Options */
.mcq-options { display: flex; flex-direction: column; gap: 0.75rem; }
.mcq-option {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  text-align: left;
}
.mcq-option:hover:not(.selected):not(.correct):not(.wrong) {
  border-color: var(--primary);
  background: var(--bg-card-hover);
  transform: translateX(4px);
}
.mcq-option.selected { border-color: var(--primary); background: rgba(59,130,246,0.1); }
.mcq-option.correct  { border-color: var(--success); background: var(--success-soft); }
.mcq-option.wrong    { border-color: var(--danger);  background: var(--danger-soft); }

.option-letter {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
  transition: var(--transition);
}
.mcq-option.selected .option-letter { background: var(--primary); color: #fff; }
.mcq-option.correct  .option-letter { background: var(--success); color: #fff; }
.mcq-option.wrong    .option-letter { background: var(--danger); color: #fff; }

/* Fill in Blank */
.fill-blank-input {
  width: 100%;
  background: var(--bg-base);
  border: 2px solid var(--border);
  color: var(--text-1);
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  outline: none;
  transition: var(--transition);
  margin-bottom: 1rem;
}
.fill-blank-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.fill-blank-input.correct { border-color: var(--success); }
.fill-blank-input.wrong   { border-color: var(--danger); }
.fill-blank-hint {
  font-size: 0.8rem;
  color: var(--text-3);
  margin-bottom: 1.25rem;
}

/* Feedback */
.feedback-row {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: fadeSlideUp 0.3s ease;
}
.feedback-row.correct-fb { background: var(--success-soft); color: var(--success); border: 1px solid rgba(16,185,129,0.25); }
.feedback-row.wrong-fb   { background: var(--danger-soft);  color: var(--danger);  border: 1px solid rgba(239,68,68,0.2); }

/* Practice Nav Buttons */
.practice-nav {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  justify-content: flex-end;
}
.btn-next {
  background: linear-gradient(135deg, var(--primary), #6366F1);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1.75rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  box-shadow: 0 0 20px var(--primary-glow);
}
.btn-next:hover { transform: translateY(-2px); box-shadow: 0 0 35px var(--primary-glow); }
.btn-next:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Results Screen */
.results-screen {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  animation: fadeSlideUp 0.5s ease both;
}
.results-emoji { font-size: 4rem; margin-bottom: 1rem; display: block; }
.results-screen h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.results-screen p { color: var(--text-2); margin-bottom: 2rem; }
.score-display {
  font-family: 'Outfit', sans-serif;
  font-size: 4rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0.5rem 0 1.5rem;
  display: block;
}
.results-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   EXAM SCHEDULER
   ============================================================ */
.scheduler-page {
  max-width: 700px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}
.scheduler-hero {
  text-align: center;
  margin-bottom: 2.5rem;
}
.scheduler-hero .big-emoji { font-size: 5rem; display: block; margin-bottom: 1rem; }
.scheduler-hero h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.scheduler-hero p { color: var(--text-2); font-size: 1rem; }

.scheduler-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
}
.form-row { margin-bottom: 1.5rem; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
  font-family: 'Outfit', sans-serif;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-input, .form-select {
  width: 100%;
  background: var(--bg-base);
  border: 1.5px solid var(--border);
  color: var(--text-1);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  outline: none;
  transition: var(--transition);
  appearance: none;
}
.form-input:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}
.form-select option { background: #1E293B; }
.time-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.time-slot {
  background: var(--bg-base);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  text-align: center;
  font-size: 0.85rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-2);
}
.time-slot:hover { border-color: var(--accent); color: var(--text-1); }
.time-slot.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.scheduler-submit {
  background: linear-gradient(135deg, var(--accent), #EF4444);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  padding: 1rem 2.5rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  width: 100%;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: 0 0 25px rgba(245,158,11,0.25);
  transition: var(--transition);
}
.scheduler-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(245,158,11,0.35);
}

/* Confirmation Screen */
.confirmation-screen {
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--success);
  border-radius: var(--radius-xl);
  padding: 3rem 2rem;
  animation: fadeSlideUp 0.5s ease;
}
.confirmation-screen .check-circle {
  width: 80px;
  height: 80px;
  background: var(--success-soft);
  border: 2px solid var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 1.5rem;
  animation: scaleIn 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}
.confirmation-screen h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.confirmation-screen p { color: var(--text-2); margin-bottom: 1.5rem; }
.confirm-detail-card {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  margin: 0 auto 2rem;
  max-width: 320px;
  text-align: left;
}
.confirm-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.confirm-detail-row:last-child { border-bottom: none; }
.confirm-detail-row .label { color: var(--text-2); }
.confirm-detail-row .value { font-weight: 600; }

/* ============================================================
   PROGRESS PAGE
   ============================================================ */
.progress-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}
.progress-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
}
.summary-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
}
.summary-card-icon { font-size: 2rem; margin-bottom: 0.5rem; display: block; }
.summary-card-value {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  display: block;
}
.summary-card-label { font-size: 0.8rem; color: var(--text-2); }

.progress-week-list { display: flex; flex-direction: column; gap: 0.75rem; }
.progress-week-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
}
.progress-week-row:hover { border-color: var(--border-bright); }
.progress-week-row.done { border-left: 3px solid var(--success); }
.progress-week-row.current { border-left: 3px solid var(--primary); }
.progress-week-row.locked-row { opacity: 0.4; }
.progress-week-icon-small { font-size: 1.5rem; flex-shrink: 0; }
.progress-week-info { flex: 1; }
.progress-week-info h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
}
.progress-week-info span { font-size: 0.78rem; color: var(--text-2); }
.progress-status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
}
.badge-done { background: var(--success-soft); color: var(--success); }
.badge-current { background: var(--primary-glow); color: var(--primary); }
.badge-available { background: var(--accent-soft); color: var(--accent); }
.badge-locked { background: rgba(55,65,81,0.5); color: var(--text-3); }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(30,41,59,0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-bright);
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 2rem;
  border-radius: 99px;
  box-shadow: var(--shadow-card);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
  opacity: 0;
  z-index: 9999;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   CONFETTI CANVAS
   ============================================================ */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes floatOrb {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(30px, 20px) scale(1.1); }
}
@keyframes scaleIn {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--primary-glow); }
  50%       { box-shadow: 0 0 0 12px transparent; }
}

/* Stagger delay helpers */
.week-card:nth-child(1)  { animation-delay: 0.05s; }
.week-card:nth-child(2)  { animation-delay: 0.10s; }
.week-card:nth-child(3)  { animation-delay: 0.15s; }
.week-card:nth-child(4)  { animation-delay: 0.20s; }
.week-card:nth-child(5)  { animation-delay: 0.25s; }
.week-card:nth-child(6)  { animation-delay: 0.30s; }
.week-card:nth-child(7)  { animation-delay: 0.35s; }
.week-card:nth-child(8)  { animation-delay: 0.40s; }
.week-card:nth-child(9)  { animation-delay: 0.45s; }
.week-card:nth-child(10) { animation-delay: 0.50s; }
.week-card:nth-child(11) { animation-delay: 0.55s; }
.week-card:nth-child(12) { animation-delay: 0.60s; }
.week-card:nth-child(13) { animation-delay: 0.65s; }
.week-card:nth-child(14) { animation-delay: 0.70s; }
.week-card:nth-child(15) { animation-delay: 0.75s; }
.week-card:nth-child(16) { animation-delay: 0.80s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .nav-progress-pill { display: none; }
  .hero { padding: 3rem 1rem 4rem; }
  .hero-stats { gap: 0.75rem; }
  .stat-card { padding: 1rem 1.25rem; }
  .dashboard-page, .week-detail-page, .practice-page, .scheduler-page, .progress-page {
    padding-left: 1rem; padding-right: 1rem;
  }
  .week-hero-banner { padding: 2rem 1.5rem; }
  .question-card { padding: 1.5rem; }
  .scheduler-form { padding: 1.5rem; }
}

/* ============================================================
   RESPONSIVE DESIGN (MOBILE)
   ============================================================ */
@media (max-width: 768px) {
  .navbar {
    padding: 0 1rem;
  }
  .nav-logo-text {
    display: none; /* Hide text on small screens, keep icon */
  }
  .nav-links {
    gap: 0.5rem;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 5px;
  }
  .nav-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
  }
  .nav-progress-pill {
    display: none; /* Hide progress pill on very small screens to save space */
  }
  .hero {
    padding: 2rem 1.5rem 3rem;
    justify-content: flex-start;
  }
  .hero-title {
    font-size: 2.5rem;
  }
  .hero-subtitle {
    font-size: 1.1rem;
  }
  .dashboard-grid {
    grid-template-columns: 1fr; /* Stack dashboard cards */
    gap: 1.5rem;
  }
  .week-footer-content {
    flex-direction: column;
    text-align: center;
  }
  .week-footer-left {
    justify-content: center;
  }
  .progress-metrics {
    grid-template-columns: 1fr;
  }
  .progress-layout {
    flex-direction: column;
  }
  .cert-container {
    padding: 2rem 1rem !important;
  }
}


/* =========================================
   JOURNEY MAP CSS
   ========================================= */
.journey-node {
  position: absolute;
  width: 11%;
  height: 11%;
  transform: translate(-50%, -50%);
  border-radius: 12px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.2s ease;
  z-index: 10;
}

.journey-node.available:hover {
  background: rgba(37, 99, 235, 0.15);
  border-color: #2563EB;
}

.journey-node.completed:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10B981;
}

.journey-node.locked {
  cursor: not-allowed;
}

.journey-node.locked:hover {
  background: rgba(100, 116, 139, 0.15);
}

.node-status-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 11;
}

.status-completed {
  color: #10B981;
  border: 1px solid #10B981;
}

.status-available {
  color: #2563EB;
  border: 1px solid #2563EB;
}
/* NEW JOURNEY NODE HOVER STYLES */
.journey-node:not(.locked):hover .node-circle { transform: scale(1.15) !important; }
.journey-node:hover .node-tooltip { opacity: 1 !important; top: 55px !important; }

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* LIVE API TRANSLATION TOOLTIP */
.api-hover-word {
  cursor: help;
  transition: all 0.2s ease;
  border-bottom: 1px dotted transparent;
}
.api-hover-word:hover {
  background: var(--bg-card-hover);
  border-bottom: 1px dotted var(--accent);
  color: var(--primary);
}

#live-tooltip {
  position: absolute;
  background: #1E293B;
  color: #fff;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transition: opacity 0.2s ease, transform 0.2s ease;
  opacity: 0;
  transform: translateY(calc(-100% + 5px)) translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
}
#live-tooltip.visible {
  opacity: 1;
  transform: translateY(calc(-100% - 10px)) translateX(-50%);
}
#live-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #1E293B transparent transparent transparent;
}
.tooltip-loader {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

/* ============================================================
   Dark Mode Global Fixes
   ============================================================ */
body.dark-mode .navbar {
  background: var(--bg-glass) !important;
  border-bottom-color: var(--border-bright) !important;
}

body.dark-mode .mcq-option {
  border-color: var(--border-bright) !important;
}

/* Aggressive overrides for any inline white/pastel backgrounds left in the JS apps */
body.dark-mode [style*="background:#F"],
body.dark-mode [style*="background: #F"],
body.dark-mode [style*="background:#f"],
body.dark-mode [style*="background: #f"],
body.dark-mode [style*="background:#E"],
body.dark-mode [style*="background: #E"],
body.dark-mode [style*="background:#e"],
body.dark-mode [style*="background: #e"],
body.dark-mode [style*="background:white"],
body.dark-mode [style*="background: white"],
body.dark-mode [style*="background-color:white"],
body.dark-mode [style*="background-color: white"] {
  background: var(--bg-card-hover) !important;
  color: var(--text-1) !important;
  border-color: var(--border-bright) !important;
}

/* Ensure deep dark text (like #0F172A, #1E293B, #334155, etc) becomes white */
body.dark-mode [style*="color:#0"],
body.dark-mode [style*="color: #0"],
body.dark-mode [style*="color:#1"],
body.dark-mode [style*="color: #1"],
body.dark-mode [style*="color:#2"],
body.dark-mode [style*="color: #2"],
body.dark-mode [style*="color:#3"],
body.dark-mode [style*="color: #3"] {
  color: var(--text-1) !important;
}

/* ============================================================
   Component Class Specific Fixes for Dark Mode
   ============================================================ */
/* Force dark backgrounds on structural layout boxes */
body.dark-mode .rule-box,
body.dark-mode .arabic-guide-box,
body.dark-mode .content-box,
body.dark-mode .ex-card,
body.dark-mode .ex-card-new {
  background: var(--bg-card) !important;
  /* Use a lighter border for better visibility */
  border-top-color: #64748B !important;    
  border-right-color: #64748B !important;
  border-bottom-color: #64748B !important;
  /* We purposefully DO NOT override border-left-color so the colored highlights are preserved! */
}

/* ============================================================
   DARK MODE COLOR SYSTEM — WEEK PAGES ONLY
   Preserves day-mode color variety with dark-friendly equivalents
   ============================================================ */

/* ── 1. BASE: White text for all unmarked elements ── */
body.dark-mode .week1-page p,
body.dark-mode .week1-page li,
body.dark-mode .week1-page td,
body.dark-mode .week1-page th,
body.dark-mode .week1-page label,
body.dark-mode .week1-page span,
body.dark-mode .week1-page div {
    color: var(--text-1) !important;
}

/* ── 2. HEADINGS ── */
body.dark-mode .week1-page h3 { color: #C084FC !important; }
body.dark-mode .week1-page h4 { color: #60A5FA !important; }

/* ── 3. BOLD / STRONG → Amber ── */
body.dark-mode .week1-page strong,
body.dark-mode .week1-page b {
    color: #FBBF24 !important;
}

/* ── 4. ARABIC → Emerald Green ── */
body.dark-mode .week1-page [dir="rtl"] {
    color: #34D399 !important;
}

/* ── 5. ITALIC EXAMPLES → Slate 300 ── */
body.dark-mode .week1-page [style*="italic"] {
    color: #CBD5E1 !important;
}

/* ── 6. INLINE TEXT COLOR MAPPINGS (dark → bright) ── */

/* Orange / Brown family → Light Orange */
body.dark-mode .week1-page [style*="color:#9A3412"],
body.dark-mode .week1-page [style*="color:#C2410C"],
body.dark-mode .week1-page [style*="color:#431407"],
body.dark-mode .week1-page [style*="color:#78350F"],
body.dark-mode .week1-page [style*="color:#92400E"],
body.dark-mode .week1-page [style*="color:#B45309"],
body.dark-mode .week1-page [style*="color:#D97706"],
body.dark-mode .week1-page [style*="color:#A16207"],
body.dark-mode .week1-page [style*="color:#713F12"] {
    color: #FB923C !important;
}

/* Blue family → Light Blue */
body.dark-mode .week1-page [style*="color:#1E40AF"],
body.dark-mode .week1-page [style*="color:#1D4ED8"],
body.dark-mode .week1-page [style*="color:#1E3A8A"],
body.dark-mode .week1-page [style*="color:#2563EB"],
body.dark-mode .week1-page [style*="color:#0369A1"],
body.dark-mode .week1-page [style*="color:#0284C7"],
body.dark-mode .week1-page [style*="color:#0C4A6E"],
body.dark-mode .week1-page [style*="color:#312E81"],
body.dark-mode .week1-page [style*="color:#4F46E5"],
body.dark-mode .week1-page [style*="color:#5452F6"] {
    color: #60A5FA !important;
}

/* Green family → Light Green */
body.dark-mode .week1-page [style*="color:#166534"],
body.dark-mode .week1-page [style*="color:#15803D"],
body.dark-mode .week1-page [style*="color:#14532D"],
body.dark-mode .week1-page [style*="color:#047857"],
body.dark-mode .week1-page [style*="color:#059669"],
body.dark-mode .week1-page [style*="color:#065F46"] {
    color: #4ADE80 !important;
}

/* Purple family → Light Purple */
body.dark-mode .week1-page [style*="color:#581C87"],
body.dark-mode .week1-page [style*="color:#5B21B6"],
body.dark-mode .week1-page [style*="color:#7E22CE"],
body.dark-mode .week1-page [style*="color:#4C1D95"],
body.dark-mode .week1-page [style*="color:#7C3AED"],
body.dark-mode .week1-page [style*="color:#701A75"] {
    color: #C084FC !important;
}

/* Red family → Light Coral */
body.dark-mode .week1-page [style*="color:#DC2626"],
body.dark-mode .week1-page [style*="color:#991B1B"],
body.dark-mode .week1-page [style*="color:#EF4444"] {
    color: #FCA5A5 !important;
}

/* Pink family → Light Pink */
body.dark-mode .week1-page [style*="color:#BE185D"],
body.dark-mode .week1-page [style*="color:#831843"],
body.dark-mode .week1-page [style*="color:#5C2C3E"] {
    color: #F472B6 !important;
}

/* Warm stone / brown family → Warm Sand */
body.dark-mode .week1-page [style*="color:#44403C"],
body.dark-mode .week1-page [style*="color:#57534E"],
body.dark-mode .week1-page [style*="color:#4A3C31"],
body.dark-mode .week1-page [style*="color:#594F4D"],
body.dark-mode .week1-page [style*="color:#705C53"],
body.dark-mode .week1-page [style*="color:#78716C"] {
    color: #D6D3D1 !important;
}

/* Dark slate/grey text → White (already base but ensure specificity) */
body.dark-mode .week1-page [style*="color:#0F172A"],
body.dark-mode .week1-page [style*="color:#1E293B"],
body.dark-mode .week1-page [style*="color:#1F2937"],
body.dark-mode .week1-page [style*="color:#334155"],
body.dark-mode .week1-page [style*="color:#374151"],
body.dark-mode .week1-page [style*="color:#475569"],
body.dark-mode .week1-page [style*="color:#4B5563"] {
    color: #E2E8F0 !important;
}

/* Mid-grey text → Slate 400 */
body.dark-mode .week1-page [style*="color:#64748B"],
body.dark-mode .week1-page [style*="color:#94A3B8"],
body.dark-mode .week1-page [style*="color:#9CA3AF"],
body.dark-mode .week1-page [style*="color:#A8A29E"] {
    color: #94A3B8 !important;
}

/* ── 7. PASTEL BACKGROUND CONTAINERS → Dark tinted glows ── */

/* Orange-tinted backgrounds */
body.dark-mode .week1-page [style*="background:#FFF5F1"],
body.dark-mode .week1-page [style*="background:#FFF9F5"],
body.dark-mode .week1-page [style*="background:#FFEDD5"],
body.dark-mode .week1-page [style*="background:#FDF8F6"],
body.dark-mode .week1-page [style*="background:#FAF8F5"],
body.dark-mode .week1-page [style*="background:#FAF4F0"],
body.dark-mode .week1-page [style*="background:#FFFBEB"],
body.dark-mode .week1-page [style*="background:#FEF3C7"],
body.dark-mode .week1-page [style*="background:#FDFDF8"] {
    background: rgba(251, 146, 60, 0.15) !important;
}

/* Blue-tinted backgrounds */
body.dark-mode .week1-page [style*="background:#F0F9FF"],
body.dark-mode .week1-page [style*="background:#EFF6FF"],
body.dark-mode .week1-page [style*="background:#DBEAFE"],
body.dark-mode .week1-page [style*="background:#EEF2FF"],
body.dark-mode .week1-page [style*="background:#F8FAFC"] {
    background: rgba(96, 165, 250, 0.15) !important;
}

/* Green-tinted backgrounds */
body.dark-mode .week1-page [style*="background:#F0FDF4"],
body.dark-mode .week1-page [style*="background:#ECFDF5"],
body.dark-mode .week1-page [style*="background:#D1FAE5"],
body.dark-mode .week1-page [style*="background:#DCFCE7"] {
    background: rgba(74, 222, 128, 0.15) !important;
}

/* Purple-tinted backgrounds */
body.dark-mode .week1-page [style*="background:#F5F3FF"],
body.dark-mode .week1-page [style*="background:#FAF5FF"],
body.dark-mode .week1-page [style*="background:#FDF4FF"] {
    background: rgba(192, 132, 252, 0.15) !important;
}

/* Pink/Rose-tinted backgrounds */
body.dark-mode .week1-page [style*="background:#FDF2F8"],
body.dark-mode .week1-page [style*="background:#FEF2F2"],
body.dark-mode .week1-page [style*="background:#FEE2E2"] {
    background: rgba(244, 114, 182, 0.15) !important;
}

/* Neutral / stone backgrounds */
body.dark-mode .week1-page [style*="background:#FAFAF9"],
body.dark-mode .week1-page [style*="background:#FAFAFA"],
body.dark-mode .week1-page [style*="background:#F1F5F9"],
body.dark-mode .week1-page [style*="background:#F4F6FB"],
body.dark-mode .week1-page [style*="background:#fff"],
body.dark-mode .week1-page [style*="background:#FFFFFF"] {
    background: var(--bg-card-hover) !important;
}

/* ── 7b. BORDER-LEFT COLOR FIXES ── */
/* Dark border-left colors become invisible in dark mode — brighten them */
body.dark-mode .week1-page [style*="border-left"][style*="#C2410C"] { border-left-color: #FB923C !important; }
body.dark-mode .week1-page [style*="border-left"][style*="#0F172A"] { border-left-color: #60A5FA !important; }
body.dark-mode .week1-page [style*="border-left"][style*="#CA8A04"] { border-left-color: #FBBF24 !important; }
body.dark-mode .week1-page [style*="border-left"][style*="#1D4ED8"] { border-left-color: #60A5FA !important; }
body.dark-mode .week1-page [style*="border-left"][style*="#15803D"] { border-left-color: #4ADE80 !important; }
body.dark-mode .week1-page [style*="border-left"][style*="#7E22CE"] { border-left-color: #C084FC !important; }
body.dark-mode .week1-page [style*="border-left"][style*="#BE185D"] { border-left-color: #F472B6 !important; }
body.dark-mode .week1-page [style*="border-left"][style*="#DC2626"] { border-left-color: #FCA5A5 !important; }
body.dark-mode .week1-page [style*="border-left"][style*="#EF4444"] { border-left-color: #FCA5A5 !important; }
body.dark-mode .week1-page [style*="border-left"][style*="#9A3412"] { border-left-color: #FB923C !important; }
body.dark-mode .week1-page [style*="border-left"][style*="#059669"] { border-left-color: #34D399 !important; }
body.dark-mode .week1-page [style*="border-left"][style*="#0369A1"] { border-left-color: #38BDF8 !important; }
body.dark-mode .week1-page [style*="border-left"][style*="#4F46E5"] { border-left-color: #818CF8 !important; }
body.dark-mode .week1-page [style*="border-left"][style*="#B45309"] { border-left-color: #FBBF24 !important; }
body.dark-mode .week1-page [style*="border-left"][style*="#991B1B"] { border-left-color: #FCA5A5 !important; }
body.dark-mode .week1-page [style*="border-left"][style*="#5B21B6"] { border-left-color: #A78BFA !important; }
body.dark-mode .week1-page [style*="border-left"][style*="#2563EB"] { border-left-color: #60A5FA !important; }

/* ── 8. GREEN HIGHLIGHTED SPANS (email examples etc.) ── */
body.dark-mode .week1-page span[style*="background:#ECFDF5"],
body.dark-mode .week1-page span[style*="background:#D1FAE5"],
body.dark-mode .week1-page span[style*="background:#DCFCE7"],
body.dark-mode .week1-page span[style*="background: #ECFDF5"],
body.dark-mode .week1-page span[style*="background: #D1FAE5"],
body.dark-mode .week1-page span[style*="background: #DCFCE7"] {
    background: rgba(52, 211, 153, 0.18) !important;
    color: #6EE7B7 !important;
}

/* Blue highlighted spans */
body.dark-mode .week1-page span[style*="background:#DBEAFE"],
body.dark-mode .week1-page span[style*="background:#EFF6FF"] {
    background: rgba(96, 165, 250, 0.18) !important;
    color: #93C5FD !important;
}

/* Purple highlighted spans */
body.dark-mode .week1-page span[style*="background:#F5F3FF"],
body.dark-mode .week1-page span[style*="background:#FAF5FF"] {
    background: rgba(192, 132, 252, 0.18) !important;
    color: #D8B4FE !important;
}

/* Orange highlighted spans */
body.dark-mode .week1-page span[style*="background:#FFEDD5"],
body.dark-mode .week1-page span[style*="background:#FEF3C7"] {
    background: rgba(251, 191, 36, 0.18) !important;
    color: #FCD34D !important;
}

/* Badge-style spans */
body.dark-mode .week1-page span[style*="background:#E2E8F0"] {
    background: #334155 !important;
    color: #94A3B8 !important;
}

/* ── 9. GRAMMAR FORMULA (Week 1) ── */
body.dark-mode .rule-part[style*="2563EB"] { --rp-color: #60A5FA !important; }
body.dark-mode .rule-part[style*="7C3AED"] { --rp-color: #C084FC !important; }
body.dark-mode .rule-part[style*="059669"] { --rp-color: #34D399 !important; }
body.dark-mode .rule-label,
body.dark-mode .rule-word {
    color: var(--rp-color) !important;
}

/* ── 10. TABLE HEADERS ── */
body.dark-mode .week1-page th[style*="background:#581C87"],
body.dark-mode .week1-page th[style*="background:#4F46E5"],
body.dark-mode .week1-page th[style*="background:#3730A3"] {
    background: rgba(99, 102, 241, 0.3) !important;
    color: #C7D2FE !important;
}
body.dark-mode .week1-page th {
    border-color: #475569 !important;
}
body.dark-mode .week1-page td {
    border-color: #334155 !important;
}

/* Force dark backgrounds on rule sub-components */
body.dark-mode .rule-part {
  background: var(--bg-card-hover) !important;
  border-color: #64748B !important;
}

/* Force dark backgrounds on all text inputs across all weeks */
body.dark-mode textarea,
body.dark-mode input[type="text"] {
  background: var(--bg-base) !important;
  color: var(--text-1) !important;
  border-color: #64748B !important;
}

/* Custom Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-card);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 90%;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE DESIGN (PHONES ONLY)
   ============================================================ */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-1);
  cursor: pointer;
  padding: 0.5rem;
}
.nav-mobile-actions {
  display: flex;
  align-items: center;
}
@media (min-width: 551px) {
  .nav-mobile-actions {
    margin-left: 0 !important;
  }
}
@media (max-width: 550px) {
  .nav-logo-text {
    display: none;
  }
  .nav-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .nav-links {
    display: none !important;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    gap: 0.75rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    white-space: normal;
    overflow-x: hidden;
  }
  .nav-links.active {
    display: flex !important;
  }
  .nav-links .nav-btn, .nav-links .nav-progress-pill {
    padding: 0.85rem 1.2rem !important;
    font-size: 1rem !important;
    width: 100% !important;
    justify-content: center !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  .nav-links .nav-btn .nav-icon {
    display: inline-flex;
    justify-content: center;
    margin-right: 0.5rem !important;
  }
  .nav-progress-pill {
    border-radius: var(--radius-sm) !important;
  }
  .nav-progress-pill .nav-pill-bar {
    flex: 1;
    max-width: none;
  }
  .placement-test-box, .professionalism-box {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1.5rem !important;
  }
}

.mobile-only {
  display: none !important;
}

@media (max-width: 550px) {
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: flex !important;
  }
}
