/* ==========================================================================
   EASY AMADEUS TRAINING SIMULATOR - STYLESHEET
   Brand Colors: Dark Green, Medium Green, Emerald Accents, Light Gray
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* Brand Green Palette */
  --brand-dark: #082d1b;
  --brand-dark-rgb: 8, 45, 27;
  --brand-forest: #0d472a;
  --brand-primary: #15803d;
  --brand-medium: #16a34a;
  --brand-accent: #22c55e;
  --brand-emerald: #10b981;
  --brand-light: #ecfdf5;
  --brand-tint: #d1fae5;
  --brand-glow: rgba(34, 197, 94, 0.35);

  /* Light Theme Surfaces */
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-card: #ffffff;
  --border-light: #e2e8f0;
  --border-strong: #cbd5e1;

  /* Typography */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-soft: #475569;
  --text-inverse: #ffffff;

  /* Terminal Colors */
  --term-bg: #0b0f17;
  --term-header: #151d2a;
  --term-border: #1e293b;
  --term-green: #22c55e;
  --term-cursor: #34d399;
  --term-text: #4ade80;
  --term-input-bg: #070a10;
  --term-prompt: #38bdf8;
  --term-error: #f87171;
  --term-amber: #fbbf24;

  /* Accents */
  --warning-bg: #fef3c7;
  --warning-text: #92400e;
  --danger: #ef4444;
  --success: #16a34a;

  /* Dimensions & Shadows */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(8, 45, 27, 0.08);
  --shadow-lg: 0 10px 25px rgba(8, 45, 27, 0.12);
  --shadow-xl: 0 20px 40px rgba(8, 45, 27, 0.16);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Theme Variations for Terminal */
body.term-theme-amber {
  --term-text: #fbbf24;
  --term-green: #fbbf24;
  --term-cursor: #f59e0b;
  --term-prompt: #fde68a;
}
body.term-theme-cyan {
  --term-text: #38bdf8;
  --term-green: #38bdf8;
  --term-cursor: #0284c7;
  --term-prompt: #7dd3fc;
}
body.term-theme-classic {
  --term-bg: #001100;
  --term-text: #00ff66;
  --term-green: #00ff66;
  --term-cursor: #00ff66;
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Cairo', 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  direction: rtl; /* Default Arabic RTL */
  text-align: right;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body[dir="ltr"] {
  font-family: 'Inter', 'Cairo', system-ui, -apple-system, sans-serif;
  direction: ltr;
  text-align: left;
}

/* Helper Utilities */
.container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: inherit;
  transition: var(--transition);
}

/* Simulator Notice Top Bar */
.top-notice-bar {
  background: linear-gradient(90deg, #78350f, #92400e, #78350f);
  color: #fef3c7;
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  position: relative;
  z-index: 1000;
}

/* Header & Navigation */
.main-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

/* Brand Logo */
.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-logo-mark {
  width: 44px;
  height: 44px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(8, 45, 27, 0.06);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  padding: 3px;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-text-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--brand-dark);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.brand-name-en {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--brand-dark);
}

.brand-title .badge-tag {
  background: var(--brand-light);
  color: var(--brand-primary);
  font-size: 0.62rem;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 800;
  border: 1px solid var(--brand-tint);
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.76rem;
  color: #475569;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 2px;
}

/* Nav Menu Items */
.main-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-btn {
  background: transparent;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-btn:hover {
  color: var(--brand-medium);
  background: var(--brand-light);
}

.nav-btn.active {
  color: var(--brand-dark);
  background: var(--brand-light);
  font-weight: 700;
  border: 1px solid var(--brand-tint);
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.action-icon-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
}

.action-icon-btn:hover {
  background: var(--brand-light);
  color: var(--brand-medium);
  border-color: var(--brand-tint);
}

#langSwitchBtn {
  color: #475569;
}

body.dark-mode #langSwitchBtn {
  color: var(--text-muted);
}

.btn-cta-green {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-medium));
  color: white;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.25);
}

.btn-cta-green:hover {
  background: linear-gradient(135deg, var(--brand-forest), var(--brand-primary));
  box-shadow: 0 6px 14px rgba(22, 163, 74, 0.35);
  transform: translateY(-1px);
}

.btn-cta-channel {
  background: #cc0000;
  color: #ffffff;
  padding: 0.52rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 3px 8px rgba(204, 0, 0, 0.25);
  transition: var(--transition);
}

.btn-cta-channel:hover {
  background: #e60000;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-cta-full {
  background: #0f172a;
  color: #38bdf8;
  padding: 0.85rem 1.85rem;
  border-radius: var(--radius-md);
  font-size: 1.02rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid #334155;
  transition: var(--transition);
}

.btn-cta-full:hover {
  background: #020617;
  color: #ffffff;
  border-color: #64748b;
  transform: translateY(-1px);
}

.btn-hero-yt {
  background: #ffffff;
  color: #dc2626;
  border: 1px solid #fecaca;
  padding: 0.85rem 1.45rem;
  border-radius: var(--radius-md);
  font-size: 0.98rem;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: var(--transition);
}

.btn-hero-yt:hover {
  background: #fef2f2;
  border-color: #f87171;
  color: #b91c1c;
  transform: translateY(-1px);
}

.dash-notice-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-right: 4px solid #3b82f6;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  color: #1e40af;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.6;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}
body[dir="ltr"] .dash-notice-banner {
  border-right: 1px solid #bfdbfe;
  border-left: 4px solid #3b82f6;
}

/* Mobile Hamburger */
.mobile-menu-toggle {
  display: none;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 1.25rem;
}

/* Views Container */
.app-view {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
  padding-bottom: 3rem;
}

.app-view.active {
  display: block;
}

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

/* ==========================================================================
   HOMEPAGE VIEW
   ========================================================================== */

/* Hero Section */
.hero-section {
  background: radial-gradient(circle at 10% 20%, rgba(22, 163, 74, 0.08) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(13, 71, 42, 0.06) 0%, transparent 40%),
              linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 4.5rem 0 3.5rem;
  border-bottom: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: center;
}

.hero-badge-group {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.hero-pill {
  background: var(--brand-light);
  color: var(--brand-primary);
  border: 1px solid var(--brand-tint);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.hero-pill.pro {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.hero-title {
  font-size: 2.85rem;
  font-weight: 900;
  line-height: 1.2;
  color: var(--brand-dark);
  margin-bottom: 1.25rem;
  letter-spacing: -0.5px;
}

.hero-title span.highlight {
  color: var(--brand-medium);
  position: relative;
  display: inline-block;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 620px;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.btn-hero-lg {
  padding: 0.85rem 1.85rem;
  font-size: 1.05rem;
  font-weight: 800;
  border-radius: var(--radius-md);
}

.hero-trust-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.trust-item svg {
  color: var(--brand-medium);
  width: 18px;
  height: 18px;
}

/* Hero Terminal Mockup Preview */
.hero-preview-card {
  background: var(--term-bg);
  border-radius: var(--radius-lg);
  border: 1px solid #1e293b;
  box-shadow: 0 25px 50px -12px rgba(8, 45, 27, 0.35);
  overflow: hidden;
  position: relative;
}

.hero-preview-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-forest), var(--brand-accent), var(--brand-forest));
}

.preview-bar {
  background: var(--term-header);
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1e293b;
}

.preview-dots {
  display: flex;
  gap: 6px;
}

.preview-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.preview-title {
  color: #94a3b8;
  font-size: 0.78rem;
  font-family: 'JetBrains Mono', monospace;
}

.preview-content {
  padding: 1.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--term-text);
  line-height: 1.6;
  direction: ltr; /* Real GDS is English uppercase */
  text-align: left;
  min-height: 270px;
}

.preview-line-cmd {
  color: #ffffff;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.preview-line-cmd span {
  color: var(--term-prompt);
}

.preview-line-res {
  color: var(--term-text);
  opacity: 0.95;
  white-space: pre-wrap;
}

/* Stats Counter Bar */
.stats-bar-section {
  background: var(--brand-dark);
  color: white;
  padding: 2.25rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  text-align: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-num {
  font-size: 2.35rem;
  font-weight: 900;
  color: var(--brand-accent);
  line-height: 1;
  margin-bottom: 0.4rem;
  font-family: 'Inter', sans-serif;
}

.stat-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: #d1fae5;
}

/* Features Section */
.features-section {
  padding: 5rem 0;
}

.section-head {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3.5rem;
}

.section-tag {
  background: var(--brand-light);
  color: var(--brand-primary);
  border: 1px solid var(--brand-tint);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--brand-dark);
  margin-bottom: 0.75rem;
}

.section-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-accent);
  box-shadow: var(--shadow-md);
}

.feature-icon-box {
  width: 52px;
  height: 52px;
  background: var(--brand-light);
  color: var(--brand-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  border: 1px solid var(--brand-tint);
}

.feature-icon-box svg {
  width: 26px;
  height: 26px;
}

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 750;
  color: var(--brand-dark);
  margin-bottom: 0.65rem;
}

.feature-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Modules Curriculum Grid */
.modules-section {
  padding: 4.5rem 0;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
}

.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.module-card:hover {
  border-color: var(--brand-medium);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.module-card.locked-card {
  background: #fdfdfd;
  border-style: dashed;
}

.module-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.module-badge {
  background: var(--brand-light);
  color: var(--brand-primary);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--brand-tint);
}

.module-card.locked-card .module-badge {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.module-lessons-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.module-card h4 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--brand-dark);
  margin-bottom: 0.5rem;
}

.module-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.module-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  padding-top: 1rem;
}

.btn-open-module {
  background: var(--brand-light);
  color: var(--brand-primary);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand-tint);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-open-module:hover {
  background: var(--brand-primary);
  color: white;
}

/* Full Simulator CTA Banner */
.pro-banner-cta {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-forest) 100%);
  color: white;
  border-radius: var(--radius-xl);
  padding: 3rem;
  margin: 4rem auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
}

.pro-banner-cta::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.pro-banner-text h3 {
  font-size: 1.95rem;
  font-weight: 900;
  margin-bottom: 0.65rem;
  color: #ffffff;
}

.pro-banner-text p {
  font-size: 1.05rem;
  color: #d1fae5;
  max-width: 650px;
}

/* ==========================================================================
   FREE TRAINING AREA & LESSON PANEL
   ========================================================================== */

.training-view-container {
  padding-top: 1.5rem;
}

.training-layout-grid {
  display: grid;
  grid-template-columns: 320px 1fr 1.1fr;
  gap: 1.25rem;
  align-items: start;
}

/* Left Sidebar: Lessons Navigator */
.lessons-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 120px);
  position: sticky;
  top: 90px;
}

.sidebar-header {
  padding: 1rem 1.15rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
}

.sidebar-search-box {
  position: relative;
  margin-top: 0.65rem;
}

.sidebar-search-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text-main);
}

.sidebar-search-box svg {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

body[dir="ltr"] .sidebar-search-input {
  padding: 0.45rem 0.75rem 0.45rem 2rem;
}
body[dir="ltr"] .sidebar-search-box svg {
  right: auto;
  left: 0.65rem;
}

.sidebar-modules-accordion {
  overflow-y: auto;
  flex-grow: 1;
  padding: 0.5rem;
}

.acc-module-group {
  margin-bottom: 0.5rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.acc-module-header {
  background: var(--bg-subtle);
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.acc-module-header:hover {
  background: #e2e8f0;
}

.acc-module-badge {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--brand-light);
  color: var(--brand-medium);
}

.acc-lessons-list {
  list-style: none;
  background: var(--bg-surface);
}

.acc-lesson-item {
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
  color: var(--text-main);
  border-top: 1px solid var(--border-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  transition: var(--transition);
}

.acc-lesson-item:hover {
  background: var(--brand-light);
  color: var(--brand-primary);
}

.acc-lesson-item.active {
  background: var(--brand-light);
  color: var(--brand-dark);
  font-weight: 700;
  border-right: 3px solid var(--brand-medium);
}
body[dir="ltr"] .acc-lesson-item.active {
  border-right: none;
  border-left: 3px solid var(--brand-medium);
}

.acc-lesson-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: transparent;
  flex-shrink: 0;
}

.acc-lesson-item.completed .acc-lesson-check {
  background: var(--brand-medium);
  border-color: var(--brand-medium);
  color: white;
}

/* Center Panel: Lesson Tutor & Instruction */
.lesson-tutor-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.lesson-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.lesson-module-tag {
  background: var(--brand-light);
  color: var(--brand-primary);
  border: 1px solid var(--brand-tint);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}

.lesson-progress-indicator {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.lesson-main-title {
  font-size: 1.55rem;
  font-weight: 850;
  color: var(--brand-dark);
  line-height: 1.3;
}

/* Explanation Box */
.lesson-desc-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.15rem;
}

.lesson-desc-box h5 {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--brand-dark);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.lesson-desc-box p {
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.6;
}

/* Syntax Card */
.syntax-spec-box {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.syntax-header {
  font-size: 0.82rem;
  font-weight: 750;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.syntax-code-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand-dark);
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  direction: ltr;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Task & Action Box */
.lesson-task-card {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.06), rgba(34, 197, 94, 0.02));
  border: 1px solid var(--brand-tint);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.task-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.task-tag {
  background: var(--brand-medium);
  color: white;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
}

.lesson-task-text {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 0.85rem;
}

.task-action-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.btn-try-example {
  background: var(--brand-primary);
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-try-example:hover {
  background: var(--brand-forest);
}

.btn-copy-code {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
}

.btn-copy-code:hover {
  background: var(--bg-subtle);
}

/* Common Mistakes Callout */
.mistakes-callout {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-right: 4px solid #f59e0b;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.86rem;
  color: #92400e;
}
body[dir="ltr"] .mistakes-callout {
  border-right: 1px solid #fef3c7;
  border-left: 4px solid #f59e0b;
}

.mistakes-callout strong {
  display: block;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

/* Completed Lesson Banner */
.lesson-success-banner {
  background: linear-gradient(135deg, #15803d, #22c55e);
  color: white;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  display: none;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
  animation: pulseSuccess 0.5s ease-out;
}

.lesson-success-banner.visible {
  display: flex;
}

@keyframes pulseSuccess {
  0% { transform: scale(0.96); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.lesson-nav-buttons-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border-light);
  padding-top: 1rem;
}

/* Right Panel: Interactive Command Terminal */
.terminal-wrapper {
  background: var(--term-bg);
  border: 1px solid var(--term-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: calc(100vh - 120px);
  position: sticky;
  top: 90px;
}

/* Terminal Header */
.terminal-top-strip {
  background: var(--term-header);
  border-bottom: 1px solid var(--term-border);
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.terminal-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.terminal-indicator-light {
  width: 9px;
  height: 9px;
  background: var(--brand-accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--brand-accent);
}

.terminal-name {
  color: #e2e8f0;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.5px;
}

.terminal-actions-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.term-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
}

.term-btn:hover {
  background: #334155;
  color: #ffffff;
}

/* Virtual Keyboard Row */
.virtual-gds-keys {
  background: #090d14;
  border-bottom: 1px solid var(--term-border);
  padding: 0.4rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  white-space: nowrap;
}

.virtual-key {
  background: #151d2a;
  border: 1px solid #1e293b;
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
}

.virtual-key:hover {
  background: #1e293b;
  color: #ffffff;
}

/* Terminal Screen Output Area */
.terminal-screen-body {
  flex-grow: 1;
  padding: 1rem;
  overflow-y: auto;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.88rem;
  color: var(--term-text);
  line-height: 1.5;
  direction: ltr; /* Real GDS is English / Monospace LTR */
  text-align: left;
  user-select: text;
}

.terminal-screen-body::-webkit-scrollbar {
  width: 8px;
}
.terminal-screen-body::-webkit-scrollbar-track {
  background: #090d14;
}
.terminal-screen-body::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}

.term-log-entry {
  margin-bottom: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.term-log-entry.command-echo {
  color: #ffffff;
  font-weight: 700;
  display: flex;
  gap: 0.5rem;
}

.term-log-entry.command-echo .prompt-sign {
  color: var(--term-prompt);
}

.term-log-entry.system-res {
  color: var(--term-text);
  opacity: 0.95;
  margin-top: 0.2rem;
}

.term-log-entry.error-res {
  color: var(--term-error);
  font-weight: 600;
  margin-top: 0.2rem;
}

.term-log-entry.hint-res {
  color: var(--term-amber);
  font-size: 0.82rem;
  margin-top: 0.35rem;
  padding: 0.4rem 0.65rem;
  background: rgba(251, 191, 36, 0.08);
  border-left: 3px solid var(--term-amber);
}

/* Terminal Command Prompt Input Bar */
.terminal-input-bar {
  background: var(--term-input-bg);
  border-top: 1px solid var(--term-border);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  direction: ltr;
}

.prompt-symbol {
  color: var(--term-prompt);
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 800;
}

.terminal-real-input {
  flex-grow: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.98rem;
  font-weight: 700;
  text-transform: uppercase;
}

.terminal-real-input::placeholder {
  color: #475569;
  font-size: 0.85rem;
  text-transform: none;
}

.btn-term-send {
  background: var(--brand-medium);
  color: white;
  padding: 0.4rem 0.85rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-term-send:hover {
  background: var(--brand-forest);
}

/* ==========================================================================
   PRO SIMULATOR VIEW (FULL WORKSPACE)
   ========================================================================== */

.pro-view-wrapper {
  padding-top: 1.25rem;
}

/* Pro Agent Status Strip */
.pro-agent-strip {
  background: #0f172a;
  color: #cbd5e1;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid #1e293b;
}

.agent-info-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.85rem;
  font-family: 'JetBrains Mono', monospace;
}

.agent-metric {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.agent-metric strong {
  color: #38bdf8;
}

.pro-controls-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.pro-workspace-grid {
  display: grid;
  grid-template-columns: 320px 1.15fr 0.85fr;
  gap: 1.25rem;
  align-items: start;
}

/* Pro Scenarios Panel */
.pro-scenarios-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  padding: 1.25rem;
}

.pro-scenario-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.pro-scenario-card:hover {
  border-color: var(--brand-medium);
  background: var(--brand-light);
}

.pro-scenario-card.active {
  border-color: var(--brand-primary);
  background: var(--brand-light);
  border-right: 4px solid var(--brand-primary);
}
body[dir="ltr"] .pro-scenario-card.active {
  border-right: 1px solid var(--brand-primary);
  border-left: 4px solid var(--brand-primary);
}

.pro-scenario-card h5 {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--brand-dark);
  margin-bottom: 0.35rem;
}

.pro-scenario-client {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.pro-steps-preview {
  font-size: 0.78rem;
  color: var(--brand-primary);
  font-weight: 700;
}

/* Pro Live PNR & Workspace Visualizer */
.pnr-visualizer-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  max-height: calc(100vh - 130px);
  display: flex;
  flex-direction: column;
}

.pnr-card-header {
  background: linear-gradient(135deg, var(--brand-forest), var(--brand-dark));
  color: white;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pnr-card-header h4 {
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pnr-record-locator-pill {
  background: var(--brand-accent);
  color: var(--brand-dark);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 1px;
}

.pnr-elements-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex-grow: 1;
}

.pnr-section-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.pnr-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.pnr-items-table td, .pnr-items-table th {
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--border-light);
  text-align: right;
}
body[dir="ltr"] .pnr-items-table td, body[dir="ltr"] .pnr-items-table th {
  text-align: left;
}

.pnr-items-table th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.78rem;
}

.pnr-status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
.badge-hk { background: #dcfce7; color: #166534; }
.badge-open { background: #dbeafe; color: #1e40af; }
.badge-void { background: #fee2e2; color: #991b1b; }

.pnr-empty-msg {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 2rem 0;
}

/* ==========================================================================
   MODALS: E-TICKET, CHEAT SHEET, PHONETIC, UPGRADE
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(8, 45, 27, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: zoomModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

@keyframes zoomModal {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--brand-dark);
}

.modal-close-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-muted);
}

.modal-close-btn:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.modal-body {
  padding: 1.5rem;
}

/* E-Ticket Realistic Layout */
.eticket-paper {
  background: #ffffff;
  border: 1px dashed #94a3b8;
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  font-family: 'Inter', sans-serif;
  direction: ltr; /* Official E-ticket format */
  text-align: left;
}

.eticket-top-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
}

.eticket-brand {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--brand-forest);
}

.eticket-pnr-box {
  background: #f1f5f9;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 0.95rem;
}

.eticket-flight-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 1.25rem 0;
}

.eticket-flight-table th {
  background: #f8fafc;
  padding: 0.5rem;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 700;
}

.eticket-flight-table td {
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.eticket-barcode-row {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fake-barcode {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 5px;
  font-size: 1.25rem;
  font-weight: 900;
  color: #0f172a;
  user-select: none;
}

/* Phonetic Alphabet Modal Grid */
.phonetic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
}

.phonetic-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}

.phonetic-card:hover {
  background: var(--brand-light);
  border-color: var(--brand-medium);
}

.phonetic-letter {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--brand-dark);
  font-family: 'Inter', sans-serif;
  line-height: 1;
}

.phonetic-word {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand-medium);
  margin-top: 0.25rem;
}

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

/* ==========================================================================
   DASHBOARD & PROGRESS VIEW
   ========================================================================== */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.dash-stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.dash-stat-box h4 {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.dash-stat-num {
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--brand-dark);
  line-height: 1;
}

/* Footer */
.main-footer {
  background: var(--brand-dark);
  color: #e2e8f0;
  padding: 3.5rem 0 1.5rem;
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.footer-top-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-brand h4 {
  font-size: 1.35rem;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 0.75rem;
}

.footer-brand p {
  font-size: 0.9rem;
  color: #94a3b8;
  line-height: 1.6;
}

.footer-col h5 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--brand-accent);
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
  color: #cbd5e1;
}

.footer-col a:hover {
  color: var(--brand-accent);
}

.footer-bottom-bar {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #94a3b8;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Toast Alerts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
body[dir="ltr"] .toast-container {
  right: auto;
  left: 24px;
}

.toast-msg {
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--brand-accent);
  pointer-events: auto;
  animation: slideToast 0.3s ease-out;
}
body[dir="ltr"] .toast-msg {
  border-left: none;
  border-right: 4px solid var(--brand-accent);
}

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

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */

@media (max-width: 1200px) {
  .training-layout-grid {
    grid-template-columns: 280px 1fr 1fr;
  }
  .pro-workspace-grid {
    grid-template-columns: 280px 1fr 1fr;
  }
}

@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .training-layout-grid {
    grid-template-columns: 1fr;
  }
  .terminal-wrapper {
    height: 480px;
    position: static;
  }
  .lessons-sidebar {
    position: static;
    max-height: 380px;
  }
  .pro-workspace-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .pnr-visualizer-card {
    max-height: 520px;
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-top-grid {
    grid-template-columns: 1fr 1fr;
  }
  .main-nav {
    display: none;
  }
  .mobile-menu-toggle {
    display: block;
  }
  .pro-agent-strip {
    flex-direction: column;
    align-items: flex-start;
  }
  .agent-info-group {
    flex-wrap: wrap;
    gap: 0.85rem;
  }
  .pro-controls-group {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .brand-logo-mark {
    width: 38px;
    height: 38px;
  }
  .brand-title {
    font-size: 1.02rem;
  }
  .brand-sub {
    font-size: 0.7rem;
  }
  .hero-title {
    font-size: 1.95rem;
  }
  .hero-cta-group {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-cta-group button, .hero-cta-group a {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .footer-top-grid {
    grid-template-columns: 1fr;
  }
  .terminal-wrapper {
    height: 420px;
  }
  .modal-box {
    max-height: 95vh;
  }
  .modal-body {
    padding: 1rem;
  }
  .eticket-paper {
    padding: 1rem;
    font-size: 0.75rem;
  }
  .eticket-flight-table th, .eticket-flight-table td {
    padding: 0.35rem 0.25rem;
    font-size: 0.72rem;
  }
}

/* Responsive layout refinements */
img,
video,
canvas,
svg {
  max-width: 100%;
}

.container,
.app-view,
.main-header,
.main-footer,
.modal-box {
  min-width: 0;
}

.app-view > .container,
.app-view .container {
  min-width: 0;
}

.hero-grid > *,
.features-grid > *,
.stats-grid > *,
.training-layout-grid > *,
.pro-workspace-grid > *,
.dashboard-grid > *,
.footer-top-grid > * {
  min-width: 0;
}

@media (max-width: 768px) {
  .container {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .hero-section,
  .features-section {
    padding-top: 3rem;
    padding-bottom: 2.5rem;
  }

  .section-title {
    font-size: clamp(1.55rem, 6vw, 2rem);
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 0.75rem;
  }

  .features-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }

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

  .training-layout-grid,
  .pro-workspace-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-top-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
  }

  .modal-box {
    width: min(96vw, 720px);
    margin: 2vh auto;
  }
}

@media (max-width: 480px) {
  .container {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }

  .nav-container {
    height: 62px;
    gap: 0.35rem;
  }

  .brand-link {
    min-width: 0;
    gap: 0.45rem;
  }

  .brand-logo-mark {
    width: 34px;
    height: 34px;
  }

  .brand-title {
    font-size: 0.95rem;
    white-space: nowrap;
  }

  .nav-actions {
    gap: 0.3rem;
    flex-shrink: 0;
  }

  .action-icon-btn,
  .mobile-menu-toggle {
    width: 32px;
    height: 34px;
    padding: 0.25rem;
    font-size: 0.9rem;
  }

  .mobile-menu-toggle {
    font-size: 1.1rem;
  }

  .hero-title {
    font-size: clamp(1.65rem, 8vw, 1.95rem);
    overflow-wrap: anywhere;
  }

  .hero-badge-group {
    align-items: flex-start;
  }

  .hero-pill {
    max-width: 100%;
    white-space: normal;
  }

  .features-grid,
  .stats-grid,
  .dashboard-grid,
  .footer-top-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature-card,
  .dash-stat-box {
    padding: 1.15rem;
  }

  .footer-top-grid {
    gap: 1.25rem;
  }

  .training-layout-grid,
  .pro-workspace-grid {
    gap: 1rem;
  }

  .terminal-wrapper {
    height: 360px;
  }

  .mobile-nav-drawer {
    max-height: calc(100vh - 62px);
    overflow-y: auto;
  }

  .eticket-paper {
    overflow-x: auto;
  }
}

/* Site-wide dark mode */
body.dark-mode {
  --bg-main: #0b1220;
  --bg-surface: #111c2e;
  --bg-subtle: #172338;
  --bg-card: #111c2e;
  --border-light: #2a3a50;
  --border-strong: #3a4d66;
  --text-main: #e5edf7;
  --text-muted: #a7b5c9;
  --text-soft: #a7b5c9;
  --brand-light: #173126;
  --brand-tint: #24543a;
  --brand-primary: #4ade80;
  --brand-medium: #22c55e;
  --brand-accent: #4ade80;
  background-color: var(--bg-main);
  color: var(--text-main);
  color-scheme: dark;
}

body.dark-mode .hero-section {
  background: radial-gradient(circle at 10% 20%, rgba(34, 197, 94, 0.1) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(13, 71, 42, 0.16) 0%, transparent 40%),
              linear-gradient(180deg, #0b1220 0%, #101a2a 100%);
}

body.dark-mode .brand-title,
body.dark-mode .brand-name-en,
body.dark-mode .section-title,
body.dark-mode .hero-title,
body.dark-mode .dash-stat-num,
body.dark-mode .phonetic-letter,
body.dark-mode .sidebar-header,
body.dark-mode .modal-header,
body.dark-mode [style*="color: var(--brand-dark)"], [style*="color: var(--brand-forest)"], [style*="color: var(--brand-primary)"], [style*="color: var(--brand-medium)"], [style*="color: var(--brand-accent)"] {
  color: #15AF58 !important;
}

body.dark-mode .brand-logo-mark,
body.dark-mode .feature-card,
body.dark-mode .dash-stat-box,
body.dark-mode .lessons-sidebar,
body.dark-mode .hero-preview-card,
body.dark-mode .modal-box,
body.dark-mode .mobile-nav-drawer,
body.dark-mode [style*="background: white"],
body.dark-mode [style*="background: #ffffff"],
body.dark-mode [style*="background: #fff"] {
  background-color: var(--bg-card) !important;
  color: var(--text-main);
}

body.dark-mode .nav-btn.active,
body.dark-mode .nav-btn:hover,
body.dark-mode .action-icon-btn,
body.dark-mode .sidebar-header,
body.dark-mode .lesson-list-item,
body.dark-mode .phonetic-card,
body.dark-mode .modal-header {
  background-color: var(--bg-subtle);
}

body.dark-mode .section-sub,
body.dark-mode .brand-sub,
body.dark-mode .stat-label,
body.dark-mode .lesson-list-item,
body.dark-mode .modal-body,
body.dark-mode .form-label {
  color: var(--text-muted);
}

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
  background-color: #0b1423;
  border-color: var(--border-strong);
  color: var(--text-main);
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: #8191a8;
}

body.dark-mode .feature-card,
body.dark-mode .dash-stat-box,
body.dark-mode .lessons-sidebar,
body.dark-mode .modal-box,
body.dark-mode .modal-header,
body.dark-mode .action-icon-btn {
  border-color: var(--border-light);
}

body.dark-mode .modal-backdrop {
  background: rgba(0, 0, 0, 0.78);
}



/* Keep the requested green text color in dark mode. */
body.dark-mode .brand-title {
  color: #15AF58 !important;
}

body.dark-mode .brand-name-en {
  color: #15AF58 !important;
}

body.dark-mode .brand-title .badge-tag {
  color: #15AF58 !important;
}

body.dark-mode .nav-btn:hover {
  color: #15AF58 !important;
}

body.dark-mode .nav-btn.active {
  color: #15AF58 !important;
}

body.dark-mode .action-icon-btn:hover {
  color: #15AF58 !important;
}

body.dark-mode .hero-pill {
  color: #15AF58 !important;
}

body.dark-mode .hero-title {
  color: #15AF58 !important;
}

body.dark-mode .hero-title span.highlight {
  color: #15AF58 !important;
}

body.dark-mode .trust-item svg {
  color: #15AF58 !important;
}

body.dark-mode .stat-num {
  color: #15AF58 !important;
}

body.dark-mode .section-tag {
  color: #15AF58 !important;
}

body.dark-mode .section-title {
  color: #15AF58 !important;
}

body.dark-mode .feature-card:hover {
  color: #15AF58 !important;
}

body.dark-mode .feature-icon-box {
  color: #15AF58 !important;
}

body.dark-mode .feature-card h3 {
  color: #15AF58 !important;
}

body.dark-mode .module-card:hover {
  color: #15AF58 !important;
}

body.dark-mode .module-badge {
  color: #15AF58 !important;
}

body.dark-mode .module-card h4 {
  color: #15AF58 !important;
}

body.dark-mode .btn-open-module {
  color: #15AF58 !important;
}

body.dark-mode .acc-module-header {
  color: #15AF58 !important;
}

body.dark-mode .acc-module-badge {
  color: #15AF58 !important;
}

body.dark-mode .acc-lesson-item:hover {
  color: #15AF58 !important;
}

body.dark-mode .acc-lesson-item.active {
  color: #15AF58 !important;
}

body.dark-mode .acc-lesson-item.completed .acc-lesson-check {
  color: #15AF58 !important;
}

body.dark-mode .lesson-module-tag {
  color: #15AF58 !important;
}

body.dark-mode .lesson-main-title {
  color: #15AF58 !important;
}

body.dark-mode .lesson-desc-box h5 {
  color: #15AF58 !important;
}

body.dark-mode .syntax-code-display {
  color: #15AF58 !important;
}

body.dark-mode .lesson-task-text {
  color: #15AF58 !important;
}

body.dark-mode .pro-scenario-card:hover {
  color: #15AF58 !important;
}

body.dark-mode .pro-scenario-card.active {
  color: #15AF58 !important;
}

body.dark-mode .pro-scenario-card h5 {
  color: #15AF58 !important;
}

body.dark-mode .pro-steps-preview {
  color: #15AF58 !important;
}

body.dark-mode .pnr-record-locator-pill {
  color: #15AF58 !important;
}

body.dark-mode .modal-header h3 {
  color: #15AF58 !important;
}

body.dark-mode .eticket-brand {
  color: #15AF58 !important;
}

body.dark-mode .phonetic-card:hover {
  color: #15AF58 !important;
}

/* Student sign-in */
.auth-gate[hidden],
.auth-user-name[hidden],
.auth-logout-btn[hidden],
#authNameField[hidden],
#authConfirmField[hidden],
#authNotice[hidden] {
  display: none !important;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 1.25rem;
  background: rgba(8, 28, 18, 0.82);
  backdrop-filter: blur(8px);
}

.auth-card {
  width: min(100%, 440px);
  padding: 2rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-xl);
  text-align: center;
}

.auth-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  margin: 0 auto 0.75rem;
  border-radius: var(--radius-md);
}

.auth-card h1 {
  color: var(--brand-dark);
  font-size: 1.6rem;
  margin-bottom: 0.35rem;
}

.auth-card > p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.auth-form {
  display: grid;
  gap: 0.9rem;
  text-align: right;
}

.auth-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.9rem;
}

.auth-form label[hidden] {
  display: none !important;
}

.auth-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  background: var(--bg-surface);
  color: var(--text-main);
  font: inherit;
  direction: ltr;
  text-align: left;
}

.auth-submit {
  width: 100%;
  min-height: 46px;
  justify-content: center;
  margin-top: 0.35rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.auth-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: 100%;
  min-height: 46px;
  margin-bottom: 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-main);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.auth-google-btn:hover {
  background: var(--bg-subtle);
}

.auth-google-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.auth-google-btn[hidden],
.auth-divider[hidden] {
  display: none !important;
}

.auth-google-btn svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.auth-link {
  padding: 0;
  background: transparent;
  color: #15AF58;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-switch {
  margin: 1rem 0 0 !important;
  font-size: 0.9rem;
}

.auth-notice {
  margin: 0 0 1rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--brand-tint);
  border-radius: var(--radius-sm);
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 0.88rem;
  line-height: 1.6;
}

.auth-notice.is-error {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #991b1b;
}

.auth-user-name {
  max-width: 180px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-logout-btn {
  min-height: 36px;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-main);
  font: inherit;
  font-weight: 700;
}

body.dark-mode .auth-card h1,
body.dark-mode .auth-notice,
body.dark-mode .auth-form label,
body.dark-mode .auth-link,
body.dark-mode .auth-notice.is-error {
  color: #15AF58 !important;
}

body.dark-mode .auth-notice {
  background: #173126;
  border-color: #24543a;
}

body.dark-mode .auth-notice.is-error {
  background: #351d24;
  border-color: #71313d;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 1.4rem 1.1rem;
  }

  .auth-user-name {
    display: none;
  }
}

body.dark-mode .phonetic-letter {
  color: #15AF58 !important;
}

body.dark-mode .phonetic-word {
  color: #15AF58 !important;
}

body.dark-mode .dash-stat-num {
  color: #15AF58 !important;
}

body.dark-mode .footer-col h5 {
  color: #15AF58 !important;
}

body.dark-mode .footer-col a:hover {
  color: #15AF58 !important;
}

/* Auth gate brand block (public app description for Google OAuth verification) */
.auth-brand-block {
  margin: 0.15rem 0 0.35rem;
}

.auth-brand-name {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--brand-dark);
  letter-spacing: 0.2px;
  line-height: 1.3;
}

.auth-brand-desc {
  margin: 0.3rem auto 0 !important;
  max-width: 34ch;
  font-size: 0.82rem !important;
  line-height: 1.75;
  color: var(--text-muted);
}

body.dark-mode .auth-brand-name {
  color: var(--brand-accent);
}

/* Legal links (auth gate + footer) */
.auth-legal {
  margin: 0.85rem 0 0 !important;
  font-size: 0.78rem !important;
  line-height: 1.6;
  color: var(--text-muted);
}

.auth-legal a {
  color: var(--brand-primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-legal a:hover {
  color: var(--brand-medium);
}

.footer-legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  font-size: 0.82rem;
}

.footer-legal-links a {
  color: #94a3b8;
  font-weight: 600;
  text-decoration: none;
}

.footer-legal-links a:hover {
  color: var(--brand-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-legal-links .sep {
  color: #94a3b8;
}

body.dark-mode .auth-legal a {
  color: var(--brand-accent);
}

.auth-home-link {
  margin: 0.5rem 0 0 !important;
  font-size: 0.78rem !important;
}

.auth-home-link a {
  color: var(--text-muted);
  font-weight: 700;
  text-decoration: none;
}

.auth-home-link a:hover {
  color: var(--brand-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
