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

:root {
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Pure Clean Light / White Palette */
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-solid: #ffffff;
  --bg-elevated: #f1f5f9;
  --bg-input: #ffffff;

  /* Accent System (Vibrant & Crisp) */
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-glow: rgba(79, 70, 229, 0.2);
  --primary-subtle: #eef2ff;

  --cyan: #0284c7;
  --cyan-glow: rgba(2, 132, 199, 0.2);
  --cyan-subtle: #f0f9ff;

  --purple: #7c3aed;
  --purple-glow: rgba(124, 58, 237, 0.2);
  --purple-subtle: #f5f3ff;

  --emerald: #059669;
  --emerald-glow: rgba(5, 150, 105, 0.2);
  --emerald-subtle: #ecfdf5;

  --amber: #d97706;
  --amber-subtle: #fffbeb;
  
  --rose: #e11d48;
  --rose-subtle: #fff1f2;

  /* Text (Dark & High Contrast) */
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-disabled: #94a3b8;

  /* Borders (Subtle & Clean) */
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --border-primary: rgba(79, 70, 229, 0.35);

  /* Radius */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-full: 9999px;

  /* Soft Modern Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-primary: 0 4px 14px rgba(79, 70, 229, 0.25);
  --shadow-cyan: 0 4px 14px rgba(2, 132, 199, 0.2);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== LIGHT BACKGROUND GRID PATTERN ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.1) 1px, transparent 1px);
  background-size: 48px 48px;
  z-index: 0;
  pointer-events: none;
}

/* Subtle atmospheric pastel glow orbs */
.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 14s ease-in-out infinite;
}
.glow-orb-1 {
  width: 600px;
  height: 600px;
  top: -150px;
  left: -80px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.07) 0%, transparent 70%);
  animation-delay: 0s;
}
.glow-orb-2 {
  width: 500px;
  height: 500px;
  bottom: -100px;
  right: -80px;
  background: radial-gradient(circle, rgba(2, 132, 199, 0.07) 0%, transparent 70%);
  animation-delay: -7s;
}
.glow-orb-3 {
  width: 400px;
  height: 400px;
  top: 45%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(124, 58, 237, 0.05) 0%, transparent 70%);
  animation-delay: -3.5s;
}

@keyframes orbFloat {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-25px) scale(1.04); }
}

.page-wrap {
  position: relative;
  z-index: 1;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

/* ===== CONTAINER ===== */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ===== NAVBAR ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 110px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--primary) 0%, var(--cyan) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
  flex-shrink: 0;
  position: relative;
}

.brand-logo::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--r-sm) + 1px);
  background: linear-gradient(135deg, rgba(255,255,255,0.4), transparent 60%);
  pointer-events: none;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #1e1b4b 0%, #4338ca 60%, #0284c7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-top: -2px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--r-md);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
  text-decoration: none;
  user-select: none;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn:hover::after { opacity: 1; }

/* Primary */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-color: rgba(79, 70, 229, 0.5);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
  color: #fff;
}
.btn-primary:active { transform: translateY(0); }

/* Cyan */
.btn-cyan {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  border-color: rgba(2, 132, 199, 0.4);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
}
.btn-cyan:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.35);
  color: #fff;
}

/* Ghost */
.btn-ghost {
  background: #ffffff;
  color: var(--text-secondary);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover {
  background: #f1f5f9;
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* Danger */
.btn-danger {
  background: var(--rose-subtle);
  color: var(--rose);
  border-color: #fecdd3;
}
.btn-danger:hover {
  background: #ffe4e6;
  transform: translateY(-1px);
}

/* Success */
.btn-success {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #fff;
  border-color: rgba(5, 150, 105, 0.4);
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.25);
}
.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.35);
  color: #fff;
}

/* Sizes */
.btn-xs  { padding: 5px 12px; font-size: 0.78rem; border-radius: var(--r-sm); }
.btn-sm  { padding: 8px 16px; font-size: 0.85rem; border-radius: var(--r-sm); }
.btn-lg  { padding: 13px 26px; font-size: 0.98rem; border-radius: var(--r-md); }
.btn-xl  { padding: 16px 32px; font-size: 1.05rem; border-radius: var(--r-lg); }
.btn-block { width: 100%; }

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.card-body { padding: 26px; }
.card-sm .card-body { padding: 18px; }
.card-lg .card-body { padding: 32px; }

/* Card Accents */
.card-accent-primary { border-top: 3px solid var(--primary); }
.card-accent-cyan     { border-top: 3px solid var(--cyan); }
.card-accent-purple   { border-top: 3px solid var(--purple); }
.card-accent-emerald  { border-top: 3px solid var(--emerald); }

/* ===== FORMS ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
}

.form-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}

.form-input {
  width: 100%;
  padding: 11px 15px;
  background: var(--bg-input);
  border: 1px solid #cbd5e1;
  border-radius: var(--r-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.92rem;
  outline: none;
  transition: all 0.2s;
}

.form-input:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-input::placeholder { color: var(--text-disabled); }

textarea.form-input { resize: vertical; min-height: 90px; }

/* ===== TABS ===== */
.tabs {
  display: inline-flex;
  gap: 4px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 4px;
}

.tab-btn {
  padding: 8px 18px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.86rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.tab-btn:hover:not(.active) {
  color: var(--text-primary);
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-primary  { background: var(--primary-subtle); color: var(--primary); border: 1px solid rgba(79, 70, 229, 0.25); }
.badge-cyan     { background: var(--cyan-subtle); color: var(--cyan); border: 1px solid rgba(2, 132, 199, 0.25); }
.badge-emerald  { background: var(--emerald-subtle); color: var(--emerald); border: 1px solid rgba(5, 150, 105, 0.25); }
.badge-purple   { background: var(--purple-subtle); color: var(--purple); border: 1px solid rgba(124, 58, 237, 0.25); }
.badge-amber    { background: var(--amber-subtle); color: var(--amber); border: 1px solid rgba(217, 119, 6, 0.25); }
.badge-rose     { background: var(--rose-subtle); color: var(--rose); border: 1px solid rgba(225, 29, 72, 0.25); }

/* ===== PROGRESS BAR ===== */
.progress-wrap {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: var(--r-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--primary) 0%, var(--cyan) 100%);
  transition: width 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  position: relative;
}

/* ===== STAT CARDS ===== */
.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  position: relative;
}

.stat-num {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 500;
}

/* ===== DATA TABLE ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: #f8fafc;
  padding: 12px 16px;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.88rem;
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8fafc; }

/* ===== MODAL ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 520px;
  padding: 32px;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  position: relative;
}

.modal-backdrop.open .modal-box {
  transform: translateY(0) scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: #f1f5f9;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
}
.modal-close-btn::before {
  content: "✕"; /* Clear X icon */
}
.modal-close-btn:hover { background: #e2e8f0; color: var(--text-primary); }

/* Credential display */
.cred-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px;
  margin: 18px 0;
}

.cred-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
}
.cred-item:last-child { border-bottom: none; }

.cred-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

.cred-value {
  font-family: monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-subtle);
  padding: 4px 12px;
  border-radius: var(--r-xs);
  border: 1px solid rgba(79, 70, 229, 0.2);
  letter-spacing: 0.5px;
}

.btn-copy-inline {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--r-xs);
  color: var(--text-secondary);
  padding: 5px 11px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.btn-copy-inline:hover { background: var(--primary-subtle); border-color: var(--border-primary); color: var(--primary); }

/* Warning box */
.warn-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--r-sm);
  padding: 13px 16px;
  font-size: 0.85rem;
  color: #92400e;
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.5;
}

/* Info box */
.info-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--r-sm);
  padding: 12px 16px;
  font-size: 0.85rem;
  color: #166534;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.5;
  margin-top: 14px;
}

/* ===== TOAST ===== */
#toast-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 500;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  border-left: 4px solid var(--primary);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);
  min-width: 280px;
  max-width: 400px;
  pointer-events: all;
  animation: toastIn 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.toast.t-success { border-left-color: var(--emerald); }
.toast.t-error   { border-left-color: var(--rose); }
.toast.t-info    { border-left-color: var(--cyan); }

@keyframes toastIn {
  from { transform: translateX(30px) translateY(8px); opacity: 0; }
  to   { transform: translateX(0) translateY(0); opacity: 1; }
}

/* ===== LESSON NAV SIDEBAR ===== */
.lesson-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 0.2s;
  background: #ffffff;
  width: 100%;
  text-align: left;
  color: var(--text-secondary);
  position: relative;
  overflow: hidden;
}

.lesson-nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background 0.2s;
}

.lesson-nav-item:hover:not(.locked) {
  background: #f8fafc;
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.lesson-nav-item.active {
  background: var(--primary-subtle);
  border-color: rgba(79, 70, 229, 0.35);
  color: var(--primary);
}

.lesson-nav-item.active::before { background: var(--primary); }

.lesson-nav-item.completed {
  border-color: rgba(5, 150, 105, 0.25);
  background: #fafdfb;
}
.lesson-nav-item.completed::before { background: var(--emerald); }

.lesson-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
  font-family: var(--font-heading);
}

.dot-pending  { background: #f1f5f9; color: var(--text-muted); border: 1px solid var(--border); }
.dot-active   { background: var(--primary); color: #fff; box-shadow: 0 0 10px rgba(79, 70, 229, 0.4); }
.dot-done     { background: var(--emerald); color: #fff; box-shadow: 0 0 10px rgba(5, 150, 105, 0.35); }

/* Quiz options */
.quiz-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary);
  font-size: 0.92rem;
  background: #ffffff;
}

.quiz-opt:hover {
  background: #f8fafc;
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.quiz-opt.selected {
  background: var(--primary-subtle);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.quiz-opt.correct {
  background: var(--emerald-subtle);
  border-color: var(--emerald);
  color: var(--emerald);
  font-weight: 700;
}

.quiz-opt.wrong {
  background: var(--rose-subtle);
  border-color: var(--rose);
  color: var(--rose);
}

.quiz-letter {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 800;
  background: #f1f5f9;
  color: var(--text-secondary);
  flex-shrink: 0;
  font-family: var(--font-heading);
  transition: all 0.2s;
}

/* ===== VIDEO PLAYER ===== */
.video-aspect {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
}

.video-aspect iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ===== DIVIDERS ===== */
.divider {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f8fafc; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(5, 150, 105, 0.3); }
  50%       { box-shadow: 0 0 24px rgba(5, 150, 105, 0.6); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.animate-fade-up {
  animation: fadeUp 0.4s cubic-bezier(0.25, 1, 0.5, 1) both;
}

.animate-delay-1 { animation-delay: 0.06s; }
.animate-delay-2 { animation-delay: 0.12s; }
.animate-delay-3 { animation-delay: 0.18s; }

/* ===== RESPONSIVE — MOBIL MOSLASHUV (HAR BIR QURILMA UCHUN) ===== */

/* ── Global Mobil Himoyasi ── */
@media (max-width: 992px) {
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  .container {
    padding: 0 14px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* ── 1. NAVBAR (Tablet va Telefon) ── */
  .navbar-inner {
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
    height: auto !important;
    padding: 10px 0 !important;
  }

  .nav-links {
    width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 4px 6px !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
  }
  .nav-links::-webkit-scrollbar { display: none; }

  .nav-link-anim, .nav-links a {
    font-size: 0.82rem !important;
    padding: 6px 10px !important;
    white-space: nowrap !important;
    border-radius: 8px !important;
    background: rgba(241, 245, 249, 0.6) !important;
  }

  .nav-right {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .nav-right .btn {
    padding: 7px 11px !important;
    font-size: 0.78rem !important;
    white-space: nowrap !important;
    flex: 1 1 auto !important;
    text-align: center !important;
    justify-content: center !important;
  }

  /* ── 2. O'QUVCHI KABINETI (student.html) ── */
  .s-root {
    width: 100% !important;
    overflow-x: hidden !important;
  }

  .s-header {
    height: auto !important;
    padding: 10px 14px !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    justify-content: space-between !important;
  }

  .s-header .brand img {
    height: 46px !important;
  }

  .s-header .brand span {
    font-size: 1.15rem !important;
  }

  .s-header > div:last-child {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: center !important;
    width: 100% !important;
    justify-content: space-between !important;
  }

  .s-body {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    grid-template-columns: 1fr !important;
  }

  .sidebar-col {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 280px !important;
    overflow-y: auto !important;
    border-right: none !important;
    border-bottom: 2px solid var(--border) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04) !important;
  }

  .player-col {
    width: 100% !important;
    padding: 18px 12px !important;
    gap: 18px !important;
  }

  .ltitle {
    font-size: 1.35rem !important;
    line-height: 1.3 !important;
  }

  .sync-bar {
    padding: 8px 14px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
  }

  .sync-right {
    width: 100% !important;
    min-width: unset !important;
    justify-content: space-between !important;
  }

  /* ── 3. O'QITUVCHI BOSHQARUV PANELI (teacher.html) ── */
  .t-root {
    flex-direction: column !important;
    min-height: auto !important;
    width: 100% !important;
    overflow-x: hidden !important;
  }

  .t-sidebar {
    width: 100% !important;
    height: auto !important;
    position: static !important;
    border-right: none !important;
    border-bottom: 2px solid var(--border) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03) !important;
  }

  .t-brand {
    padding: 14px 16px !important;
  }

  .t-login-section {
    padding: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .t-nav {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 8px 12px !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
  }
  .t-nav::-webkit-scrollbar { display: none; }

  .t-nav-item {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    padding: 8px 14px !important;
    font-size: 0.8rem !important;
    border-radius: 8px !important;
    width: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .t-main {
    width: 100% !important;
    flex: 1 !important;
  }

  .t-topbar {
    padding: 12px 14px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  #topBarActions {
    width: 100% !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    display: flex !important;
  }

  .t-content {
    padding: 14px 10px !important;
    width: 100% !important;
  }

  .stat-strip {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .teacher-welcome-grid,
  .teacher-overview-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .l-cards {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
}

/* ── Telefonlar (max 768px) ── */
@media (max-width: 768px) {
  /* Hero va Bosh Sahifa */
  .hero {
    padding: 35px 0 25px !important;
    text-align: center !important;
  }
  .hero-title {
    font-size: clamp(1.75rem, 6.5vw, 2.3rem) !important;
    letter-spacing: -0.5px !important;
    line-height: 1.25 !important;
  }
  .hero-sub {
    font-size: 0.9rem !important;
    margin-bottom: 22px !important;
    line-height: 1.55 !important;
  }

  /* Portallar va Kartalar */
  .portal-grid {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
  .portal-card {
    padding: 22px 16px !important;
    border-radius: 16px !important;
  }
  .portal-title {
    font-size: 1.35rem !important;
  }

  /* Kirish / Login Sahifasi */
  .auth-container {
    margin: 20px auto 40px !important;
    padding: 0 12px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Formalar — iOS Auto-Zoom himoyasi (font-size >= 16px) */
  .form-input, input[type="text"], input[type="password"], select, textarea {
    font-size: 16px !important;
    padding: 12px 14px !important;
    border-radius: 10px !important;
  }

  /* Touch-friendly tugmalar */
  .btn {
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .btn-lg {
    padding: 12px 20px !important;
    font-size: 0.95rem !important;
  }

  /* Test savollari (Quiz) */
  .quiz-section {
    padding: 18px 14px !important;
    border-radius: 16px !important;
  }
  .q-card {
    padding: 14px 12px !important;
    border-radius: 12px !important;
  }
  .q-opt {
    padding: 13px 14px !important;
    min-height: 50px !important;
    font-size: 0.9rem !important;
    gap: 10px !important;
  }
  .q-letter {
    width: 26px !important;
    height: 26px !important;
    font-size: 0.8rem !important;
  }

  /* Jadvallar — Gorizontal Scroll */
  .tbl-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 10px !important;
    width: 100% !important;
    margin-bottom: 12px !important;
  }
  .data-table {
    min-width: 580px;
    font-size: 0.82rem !important;
  }
  .data-table th, .data-table td {
    padding: 10px 12px !important;
    white-space: nowrap !important;
  }

  /* Modal oynalar — Telefonda to'liq sig'ish */
  .modal-backdrop, .modal-overlay {
    padding: 10px !important;
    align-items: center !important;
  }
  .modal-box {
    width: 95vw !important;
    max-width: 95vw !important;
    padding: 20px 16px !important;
    border-radius: 18px !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    margin: auto !important;
  }

  /* Xabarnomalar (Toast) */
  #toast-root {
    bottom: 10px !important;
    right: 10px !important;
    left: 10px !important;
  }
  .toast {
    min-width: unset !important;
    max-width: 100% !important;
    font-size: 0.85rem !important;
  }

  /* Sayt haqida / Kutubxona / Yo'nalishlar sahifalari */
  .page-header {
    padding: 40px 14px 60px !important;
  }
  .page-title {
    font-size: 2rem !important;
    letter-spacing: -0.5px !important;
  }
  .page-subtitle {
    font-size: 0.92rem !important;
    padding-left: 0 !important;
  }
  .about-card, .course-grid, .library-grid {
    margin-top: -30px !important;
    padding: 20px 14px !important;
    border-radius: 18px !important;
  }
  .about-stats {
    gap: 10px !important;
    margin: 20px 0 !important;
  }
  .stat-box {
    min-width: 110px !important;
    padding: 12px 10px !important;
  }
  .stat-num {
    font-size: 1.7rem !important;
  }
  .about-features, .course-grid, .library-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .tabs-container {
    margin-top: -25px !important;
    gap: 6px !important;
  }
  .tab-btn {
    padding: 9px 16px !important;
    font-size: 0.85rem !important;
  }
}

/* ── Kichik Telefonlar (max 480px) ── */
@media (max-width: 480px) {
  .container { padding: 0 10px !important; }
  .stat-strip {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  .s-tile {
    padding: 12px 10px !important;
  }
  .s-tile-val {
    font-size: 1.35rem !important;
  }
  .s-tile-lbl {
    font-size: 0.7rem !important;
  }
  .nav-right .btn {
    font-size: 0.74rem !important;
    padding: 6px 8px !important;
  }
}

