:root {
  --bg-light: #f5f7fb;
  --bg-dark: #020617;
  --bg-card-light: #ffffff;
  --bg-card-dark: #020617;
  --text-light: #020617;
  --text-dark: #e5e7eb;
  --primary: #0ea5e9;
  --primary-strong: #059669;
  --border-light: #e5e7eb;
  --border-dark: #1e293b;
  --shadow-soft: 0 20px 60px rgba(15, 23, 42, 0.18);
  --radius-lg: 24px;
  --transition-fast: 0.2s ease;
  --main-orange: #008040;           /* اللون الأحمر الغامق الأساسي */
}

/* وضع الليل */
body.dark-mode {
  background: var(--bg-dark);
  color: var(--text-dark);
}
body.dark-mode .main-header {
  background: #020617;
  border-bottom-color: var(--border-dark);
}
body.dark-mode .btn.outline {
  border-color: #4b5563;
  color: var(--text-dark);
}

/* النهار */
body.light-mode {
  background: radial-gradient(circle at top, #dbeafe 0, #f5f7fb 40%, #f9fafb 100%);
  color: var(--text-light);
}

/* الأساسي */
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  direction: rtl;
  text-align: right;
  box-sizing: border-box;
  font-size: 18px;
  font-weight: 600;
  max-width: 100vw;        /* لا يتعدى عرض الشاشة */
  overflow-x: hidden;      /* منع التمرير الأفقي */
}
*, *::before, *::after {
  box-sizing: inherit;
}

/* الهيدر */
.main-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248, 250, 252, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}
body.dark-mode .main-header {
  background: rgba(15, 23, 42, 0.95);
}

/* صف الهيدر العلوي */
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
}

.header-right,
.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-wrap {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

/* شعار الهيدر */
#siteLogo {
  width: 68px;
  height: 68px;
  border-radius: 999px;
  border: 2px solid rgba(56, 189, 248, 0.5);
  object-fit: cover;
  background: #eff6ff;
}

.site-name {
  font-weight: 900;
  font-size: 24px;
  white-space: nowrap;
}
body.dark-mode .site-name {
  color: #f9fafb;
}

/* زر القائمة للموبايل (Drop-down) */
.mobile-menu-toggle {
  display: none;
  position: relative;
  width: 48px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: #f9fafb;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
  cursor: pointer;
  padding: 0 10px;
  align-items: center;
  justify-content: center;
}
body.dark-mode .mobile-menu-toggle {
  background: #020617;
}
.mobile-menu-toggle span {
  display: block;
  width: 20px;
  height: 3px;
  border-radius: 999px;
  background: var(--main-orange);
  margin: 3px 0;
}

/* زر تبديل الوضع (سويتش) */
.theme-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: #e5e7eb;
  color: #0f172a;
  transition: background 0.3s ease, color 0.3s ease;
  font-weight: 700;
}
body.dark-mode .theme-switch {
  background: #1f2937;
  color: #e5e7eb;
}

.theme-switch:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

/* إخفاء النص للشاشات القارئة فقط */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* الأيقونات الخارجية */
.theme-switch-icon {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* الشمس خارجية في وضع النهار تكون ظاهرة */
.theme-switch-sun-out {
  transform: scale(1);
  opacity: 1;
}

/* القمر الخارجي في النهار يكون مخفي */
.theme-switch-moon-out {
  margin-right: 6px;
  transform: scale(0);
  opacity: 0;
}

/* عندما يكون الوضع داكن نعكس الأيقونات */
body.dark-mode .theme-switch-sun-out {
  transform: scale(0);
  opacity: 0;
}
body.dark-mode .theme-switch-moon-out {
  transform: scale(1);
  opacity: 1;
}

/* الدائرة المتحركة */
.theme-switch-knob {
  position: relative;
  margin-inline-start: 6px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.2);
  transition: transform 0.5s ease, background 0.3s ease;
}

/* في وضع الليل تتحرك قليلاً وتغمق */
body.dark-mode .theme-switch-knob {
  transform: translateX(-10px);
  background: #020617;
}

/* الأيقونات داخل الدائرة */
.theme-switch-sun-in,
.theme-switch-moon-in {
  position: absolute;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* في النهار */
.theme-switch-sun-in {
  opacity: 1;
  transform: scale(1);
  color: #f59e0b;
}
.theme-switch-moon-in {
  opacity: 0;
  transform: scale(0);
  color: #e5e7eb;
}

/* في الليل */
body.dark-mode .theme-switch-sun-in {
  opacity: 0;
  transform: scale(0);
}
body.dark-mode .theme-switch-moon-in {
  opacity: 1;
  transform: scale(1);
}

/* القائمة المنسدلة للموبايل داخل الهيدر */
.mobile-menu {
  overflow: hidden;
  max-height: 0;
  background: transparent;
  transition: max-height 0.25s ease;
}
.mobile-menu.open {
  max-height: 240px;
}
.mobile-menu-inner {
  background: var(--main-orange);
  padding: 12px 18px 16px;
  box-shadow: 0 10px 26px rgba(127, 29, 29, 0.55);
  border-radius: 0 0 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* أزرار القائمة في الموبايل */
.mobile-menu-btn {
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  background: var(--main-orange);
  color: #f9fafb;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 8px 20px rgba(127, 29, 29, 0.6);
}
.mobile-menu-btn:hover {
  background: #7f1d1d;
}

/* الأزرار العامة */
.btn {
  border: none;
  border-radius: 999px;
  padding: 9px 20px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.btn:active {
  transform: scale(0.97);
}

.btn.primary {
  background: linear-gradient(135deg, #22c55e, #0ea5e9);
  color: #f9fafb;
  box-shadow: 0 14px 30px rgba(22, 163, 74, 0.4);
}
.btn.primary:hover {
  background: linear-gradient(135deg, #16a34a, #0284c7);
}

.btn.outline {
  background: transparent;
  border: 1px solid #cbd5f5;
  color: #1f2937;
}
.btn.outline:hover {
  background: rgba(59, 130, 246, 0.06);
  border-color: #93c5fd;
}

/* المحتوى */
.main-content {
  max-width: 1200px;
  margin: 18px auto 26px auto;
  padding: 0 14px 26px;
}

/* ===== قسم البطل ===== */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 34px;
  align-items: center;
  margin: 26px 0;
}

/* النصوص أوضح */
.hero-text {
  text-align: right;
}

.hero-small-title {
  margin: 0 0 8px 0;
  font-size: 22px;
  font-weight: 900;
  color: #0f766e;
}
body.dark-mode .hero-small-title {
  color: #6ee7b7;
}

.hero-main-title {
  margin: 0 0 12px 0;
  font-size: 40px;
  line-height: 1.4;
  font-weight: 900;
  color: #020617;
}
body.dark-mode .hero-main-title {
  color: #e5e7eb;
}

.hero-description {
  margin: 0 0 22px 0;
  font-size: 20px;
  line-height: 1.9;
  color: #4b5563;
}
body.dark-mode .hero-description {
  color: #d1d5db;
}

/* زر البطل */
.hero-cta-btn {
  border: none;
  outline: none;
  border-radius: 999px;
  padding: 13px 34px;
  font-size: 18px;
  font-weight: 900;
  background: var(--main-orange);
  color: #fef2f2;
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(127, 29, 29, 0.6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background 0.18s;
}
.hero-cta-btn:hover {
  background: #7f1d1d;
  transform: translateY(-2px);
  box-shadow: 0 22px 52px rgba(127, 29, 29, 0.75);
}

/* صورة البطل */
.hero-image {
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-image img {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 0;
  object-fit: contain;
  box-shadow: none;
  background: transparent;
}

/* أنيميشن */
.hero-animate {
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.hero-animate.hero-animate-ready {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ===== قسم ترحيب الرياضيات والرموز ===== */
.math-welcome-section {
  margin: 10px auto 26px auto;
  max-width: 1200px;
  padding: 0 8px;
}

.math-welcome-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 24px;
  border-radius: 26px;
  background: linear-gradient(135deg, #eff6ff, #e0f2fe);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.18);
}

body.dark-mode .math-welcome-inner {
  background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.2), transparent 60%),
              radial-gradient(circle at 100% 100%, rgba(236, 72, 153, 0.25), transparent 60%),
              #020617;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.7);
}

.math-welcome-text {
  max-width: 520px;
}

.math-welcome-title {
  margin: 0 0 6px 0;
  font-size: 26px;
  font-weight: 900;
  color: #0f172a;
}
.math-welcome-subtitle {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #334155;
}

body.dark-mode .math-welcome-title {
  color: #f9fafb;
}
body.dark-mode .math-welcome-subtitle {
  color: #e5e7eb;
}

/* صف الرموز */
.math-symbols-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 18px;
  justify-content: center;
  align-items: center;
}

/* الرمز نفسه: سميك وملون ومتحرك */
.math-symbol {
  width: 70px;
  height: 70px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 900;
  color: #ffffff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.35);
  animation: float-math 2.4s ease-in-out infinite;
}

/* ألوان متدرجة لكل رمز */
.math-symbol-plus     { background: linear-gradient(135deg, #6366f1, #ec4899); }
.math-symbol-minus    { background: linear-gradient(135deg, #f97316, #facc15); }
.math-symbol-multiply { background: linear-gradient(135deg, #22c55e, #0ea5e9); }
.math-symbol-divide   { background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.math-symbol-equal    { background: linear-gradient(135deg, #0ea5e9, #22d3ee); }
.math-symbol-pi       { background: linear-gradient(135deg, #f97316, #ef4444); }

/* أنيميشن احترافية بسيطة */
@keyframes float-math {
  0%   { transform: translateY(0px) scale(1); }
  50%  { transform: translateY(-10px) scale(1.05); }
  100% { transform: translateY(0px) scale(1); }
}

/* اختلاف بسيط في التوقيت لكل عنصر */
.math-symbol:nth-child(2) { animation-delay: 0.12s; }
.math-symbol:nth-child(3) { animation-delay: 0.24s; }
.math-symbol:nth-child(4) { animation-delay: 0.36s; }
.math-symbol:nth-child(5) { animation-delay: 0.48s; }
.math-symbol:nth-child(6) { animation-delay: 0.6s; }

/* ===== قسم لماذا تختار المدرس ===== */
.why-section {
  margin: 24px 0 28px;
  text-align: center;
}
.why-title {
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 20px;
}
body.dark-mode .why-title {
  color: #f9fafb;
}

.why-cards-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px;
  padding-bottom: 4px;
  overflow-x: visible;
}

.why-card {
  flex: 0 0 270px;
  max-width: 270px;
  background: var(--bg-card-light);
  border-radius: 24px;
  border: 1px solid var(--border-light);
  padding: 22px 20px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: right;
  transform-origin: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.2s ease, border-color 0.2s ease;
}

.why-card[data-index="0"] { transform: rotate(-4deg); }
.why-card[data-index="1"] { transform: rotate(2deg);  }
.why-card[data-index="2"] { transform: rotate(-2deg); }
.why-card[data-index="3"] { transform: rotate(4deg);  }

.why-card:hover {
  transform: rotate(0deg) translateY(-6px);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
}

/* ألوان الليل */
body.dark-mode .why-card {
  background: #020617;
  border-color: #1f2937;
  box-shadow: 0 20px 55px rgba(15, 23, 42, 0.9);
}
body.dark-mode .why-card-title {
  color: #e5e7eb;
}
body.dark-mode .why-card-text {
  color: #e5e7eb;
}
body.dark-mode .why-card-icon {
  background: #0f172a;
}

/* الأيقونة */
.why-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: #e0f2fe;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  overflow: hidden;
}
.why-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.why-card-icon span {
  font-size: 28px;
}

.why-card-title {
  font-size: 20px;
  font-weight: 900;
  margin: 0 0 8px 0;
  color: #0f172a;
}
.why-card-text {
  font-size: 16px;
  line-height: 1.85;
  margin: 0;
  color: #4b5563;
}

/* ===== الصفوف الدراسية ===== */
.classes-section {
  margin-bottom: 28px;
  text-align: center;
}
.classes-main-title {
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 6px;
}
.classes-subtitle {
  margin: 0 0 20px 0;
  font-size: 18px;
  color: #4b5563;
}
body.dark-mode .classes-main-title {
  color: #f9fafb;
}
body.dark-mode .classes-subtitle {
  color: #e5e7eb;
}

/* الشبكة */
.classes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

/* الكارت */
.class-card {
  background: #ffffff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter 0.18s ease-out, background 0.2s ease;
}

/* وضع الليل للكروت */
body.dark-mode .class-card {
  background: #020617;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.8);
}
body.dark-mode .class-bottom {
  background: transparent;
}
body.dark-mode .class-title {
  color: #f9fafb;
}
body.dark-mode .class-level {
  color: #e5e7eb;
}

.class-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  filter: saturate(1.04);
  cursor: pointer;
}

/* البانر */
.class-banner {
  position: relative;
  width: 100%;
  padding-top: 62%;
  overflow: hidden;
}
.class-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.class-banner-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #06b6d4, #22c55e);
  color: #f9fafb;
  font-size: 24px;
  font-weight: 900;
}

.class-number-badge {
  position: absolute;
  inset-inline-end: 14px;
  inset-block-start: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.76);
  color: #f9fafb;
  font-weight: 900;
  font-size: 15px;
}

/* الشريط السفلي */
.class-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 16px;
  background: #ffffff;
}

.class-bottom-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.class-title {
  font-size: 20px;
  font-weight: 900;
  color: #0f172a;
}
.class-level {
  font-size: 16px;
  color: #4b5563;
}

/* زر ابدأ الآن */
.class-start-btn {
  border: none;
  outline: none;
  border-radius: 999px;
  padding: 9px 20px;
  font-size: 16px;
  font-weight: 800;
  background: #0f766e;
  color: #ecfeff;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.35);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background 0.18s;
}
.class-start-btn::before {
  content: "◀";
  font-size: 13px;
}
.class-start-btn:hover {
  background: #115e59;
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15, 118, 110, 0.45);
}

/* نص لا يوجد صفوف */
.empty-msg {
  margin-top: 6px;
  font-size: 15px;
  color: #6b7280;
}
body.dark-mode .empty-msg {
  color: #cbd5f5;
}

/* ===== أسعار الكورسات ===== */
.course-price-box {
  margin-top: 6px;
  font-size: 16px;
  display: inline-flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
  direction: rtl;
}

.course-old-price {
  text-decoration: line-through;
  color: #9ca3af;
  font-size: 15px;
  font-weight: 700;
}

.course-price {
  font-weight: 900;
  color: #16a34a;
  font-size: 20px;
}

.course-center-only {
  font-weight: 800;
  color: var(--main-orange);
  font-size: 16px;
}

.course-no-price {
  color: #6b7280;
  font-size: 15px;
}
body.dark-mode .course-no-price {
  color: #d1d5db;
}

.course-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ===== كارت تفاصيل الكورس ===== */
.course-details-card {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 24px;
  align-items: center;
  padding: 22px 20px;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.15);
  margin-bottom: 20px;
}

.course-details-image-wrap {
  position: relative;
  width: 100%;
  padding-top: 62%;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(135deg, #06b6d4, #22c55e);
}
.course-details-image-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-details-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.course-details-title {
  font-size: 32px;
  font-weight: 900;
  margin: 0;
}
.course-details-sub {
  margin: 0;
  font-size: 18px;
  color: #4b5563;
}

.course-details-stats-row {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 15px;
}
.course-details-pill {
  padding: 7px 12px;
  border-radius: 999px;
  background: #f1f5f9;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
}

/* وضع الليل لتفاصيل الكورس */
body.dark-mode .course-details-card {
  background: #020617;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
}
body.dark-mode .course-details-title {
  color: #f9fafb;
}
body.dark-mode .course-details-sub {
  color: #e5e7eb;
}
body.dark-mode .course-details-pill {
  background: #111827;
}

/* ===== قسم الدعوة أسفل الصفحة (جاهز ياضنايا؟) ===== */
.bottom-cta-section {
  margin: 32px auto 40px auto;
  max-width: 1200px;
  padding: 0 8px;
}
.bottom-cta-inner {
  border-radius: 26px;
  background: var(--main-orange);
  padding: 26px 32px 30px;
  text-align: center;
  box-shadow: 0 28px 70px rgba(127, 29, 29, 0.55);
}
.bottom-cta-title {
  margin: 0 0 10px 0;
  font-size: 26px;
  font-weight: 900;
  color: #fef2f2;
}
.bottom-cta-text {
  margin: 0 0 18px 0;
  font-size: 18px;
  font-weight: 700;
  color: #fee2e2;
}
.bottom-cta-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 28px;
  font-size: 17px;
  font-weight: 900;
  background: #e5f4f5;
  color: #065f46;
  cursor: pointer;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.4);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.bottom-cta-btn:hover {
  background: #ccfbf1;
  transform: translateY(-2px);
  box-shadow: 0 20px 52px rgba(15, 23, 42, 0.55);
}
.bottom-cta-btn:active {
  transform: scale(0.97);
}

/* نفس الشكل في الدارك مود */
body.dark-mode .bottom-cta-inner {
  background: var(--main-orange);
}
body.dark-mode .bottom-cta-title {
  color: #fef2f2;
}
body.dark-mode .bottom-cta-text {
  color: #fee2e2;
}
body.dark-mode .bottom-cta-btn {
  background: #e5f4f5;
  color: #065f46;
}

/* ===== الفوتر ===== */
.main-footer {
  max-width: 1200px;
  margin: 0 auto 16px auto;
  padding: 16px 14px 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  column-gap: 22px;
  align-items: center;
}

/* شعار الفوتر أكبر */
.footer-left {
  display: flex;
  justify-content: flex-start;
}
.footer-logo {
  width: 96px;
  height: 96px;
  border-radius: 999px;
  object-fit: contain;
}

/* تقليل الفراغ في الوسط وتكبير النصوص */
.footer-middle {
  display: flex;
  justify-content: center;
  gap: 34px;
}

.footer-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--main-orange);
  margin: 0 0 8px 0;
}
body.dark-mode .footer-title {
  color: #f97316;
}

/* روابط السوشيال */
.footer-social-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-social-list li {
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.footer-social-list a {
  color: inherit;
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
}
.footer-social-list a:hover {
  text-decoration: underline;
}
.footer-social-icon {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  object-fit: cover;
}

/* أرقام التواصل */
.footer-phones-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-phones-list li {
  margin-bottom: 4px;
}
.footer-phones-list a {
  color: inherit;
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
}
.footer-phones-list a:hover {
  text-decoration: underline;
}

/* حقوق الطبع */
.footer-right {
  text-align: left;
  direction: ltr;
  font-size: 14px;
}
.footer-copy {
  margin: 0 0 3px 0;
  font-weight: 800;
  color: #020617;
}
.footer-dev {
  margin: 0;
  color: #4b5563;
}
body.dark-mode .main-footer {
  color: #e5e7eb;
}
body.dark-mode .footer-copy {
  color: #f9fafb;
}
body.dark-mode .footer-dev {
  color: #cbd5f5;
}

/* موبايل وتابلت */
@media (max-width: 991px) {
  #siteLogo {
    width: 60px;
    height: 60px;
  }

  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-image {
    order: -1;
  }
  .hero-main-title {
    font-size: 34px;
  }
  .hero-text {
    text-align: center;
  }

  .math-welcome-inner {
    flex-direction: column;
    text-align: center;
  }
  .math-welcome-text {
    max-width: 100%;
  }

  .classes-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .course-details-card {
    grid-template-columns: 1fr;
  }

  .bottom-cta-section {
    margin: 28px auto 34px auto;
  }
  .bottom-cta-inner {
    padding: 22px 18px 24px;
  }
}

@media (max-width: 768px) {
  .main-header {
    padding: 0;
  }

.site-name {
    display: inline-block;
    font-size: 16px;         
    max-width: none;        
    overflow: visible;      
    text-overflow: clip;     
    white-space: normal;    
    line-height: 1.2;        
    vertical-align: middle;
  }

  .header-auth-btn {
    display: none;
  }
  .mobile-menu-toggle {
    display: inline-flex;
  }

  /* ضبط الهيرو للموبايل */
  .hero {
    grid-template-columns: 1fr;
    gap: 18px;
    margin: 18px 0;
  }

  .hero-text {
    text-align: center;
  }

  .hero-main-title {
    font-size: 26px;
    line-height: 1.4;
  }

  .hero-small-title {
    font-size: 16px;
  }

  .hero-description {
    font-size: 15px;
    line-height: 1.8;
  }

  .hero-cta-btn {
    padding: 10px 22px;
    font-size: 16px;
  }

  .main-content {
    padding: 0 10px 18px;
  }

  .math-welcome-inner {
    flex-direction: column;
    text-align: center;
    padding: 16px 14px;
  }

  .math-welcome-title {
    font-size: 20px;
  }

  .math-welcome-subtitle {
    font-size: 15px;
  }

  .math-symbols-row {
    gap: 10px;
    flex-wrap: wrap;
  }

  .math-symbol {
    width: 52px;
    height: 52px;
    font-size: 26px;
  }

  .why-cards-row {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    overflow-x: visible;
  }
  .why-card {
    flex: 1 1 auto;
    max-width: 100%;
    transform: rotate(0deg);
  }

  .main-footer {
    grid-template-columns: 1fr;
    row-gap: 12px;
    align-items: center;
    text-align: center;
  }
  .footer-left {
    justify-content: center;
  }
  .footer-middle {
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }
  .footer-right {
    text-align: center;
    direction: rtl;
  }

  .math-symbol {
    width: 60px;
    height: 60px;
    font-size: 32px;
  }
}