/* =============================================
   أكاديمية البرمجة — التصميم الشامل
   ============================================= */

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

/* =============================================
   متغيرات CSS — نظام الألوان
   ============================================= */
:root {
  /* الألوان الرئيسية */
  --primary: hsl(262, 83%, 58%);
  --primary-dark: hsl(262, 83%, 45%);
  --primary-light: hsl(262, 83%, 70%);
  --primary-ultra-light: hsl(262, 83%, 97%);
  --primary-rgb: 124, 58, 237;

  --secondary: hsl(220, 70%, 50%);
  --secondary-dark: hsl(220, 70%, 40%);
  --secondary-light: hsl(220, 70%, 65%);

  /* الخلفيات */
  --bg: hsl(240, 20%, 98%);
  --bg-card: #ffffff;
  --bg-elevated: hsl(240, 20%, 96%);

  /* النصوص */
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  /* الحدود */
  --border: hsl(240, 15%, 90%);
  --border-focus: var(--primary);

  /* الألوان الثانوية */
  --success: hsl(142, 71%, 45%);
  --success-light: hsl(142, 71%, 95%);
  --danger: hsl(0, 84%, 60%);
  --danger-light: hsl(0, 84%, 97%);
  --warning: hsl(38, 92%, 50%);
  --warning-light: hsl(38, 92%, 96%);
  --info: hsl(199, 89%, 48%);

  /* الظلال */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --shadow-primary: 0 4px 20px rgba(var(--primary-rgb), 0.3);

  /* التخطيط */
  --radius: 1rem;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.5rem;
  --navbar-height: 70px;

  /* الخطوط */
  --font-main: 'Cairo', 'Inter', system-ui, sans-serif;

  /* التحولات */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  /* توافق */
  --card-bg: var(--bg-card);
  --text-color: var(--text-primary);
}

/* =============================================
   الوضع الداكن
   ============================================= */
[data-theme="dark"] {
  --bg: #09090b;
  --bg-card: rgba(20, 20, 25, 0.65);
  --bg-elevated: rgba(255, 255, 255, 0.05);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
  --primary-ultra-light: rgba(124, 58, 237, 0.15);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.7);
  --success-light: rgba(34, 197, 94, 0.15);
  --danger-light: rgba(239, 68, 68, 0.15);
  --card-bg: var(--bg-card);
  --text-color: var(--text-primary);
}

/* =============================================
   الأساسيات
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  direction: rtl;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}

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

a:hover { opacity: 0.8; }

img { max-width: 100%; display: block; }

button, input, select, textarea {
  font-family: var(--font-main);
  font-size: 1rem;
}

/* =============================================
   المرافق العامة
   ============================================= */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.hidden { display: none !important; }

/* =============================================
   الأزرار
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font-main);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(var(--primary-rgb), 0.4);
  color: white;
  opacity: 1;
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--primary-ultra-light);
  opacity: 1;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-elevated);
  color: var(--text-primary);
  opacity: 1;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover:not(:disabled) {
  background: var(--primary);
  color: white;
  transform: translateY(-1px);
  opacity: 1;
}

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover:not(:disabled) {
  background: hsl(0, 84%, 50%);
  transform: translateY(-1px);
  opacity: 1;
}

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover:not(:disabled) {
  background: hsl(142, 71%, 38%);
  opacity: 1;
}

.btn-icon {
  padding: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
}

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1.05rem;
}

.btn-full { width: 100%; }

/* =============================================
   حقول الإدخال
   ============================================= */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 1.1rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}

.has-icon .form-control {
  padding-right: 2.75rem;
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.875rem center;
  padding-left: 2.5rem;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* =============================================
   الكروت
   ============================================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

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

/* =============================================
   الشارات
   ============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.badge-primary {
  background: var(--primary-ultra-light);
  color: var(--primary);
}
.badge-success {
  background: var(--success-light);
  color: var(--success);
}
.badge-danger {
  background: var(--danger-light);
  color: var(--danger);
}
.badge-warning {
  background: var(--warning-light);
  color: hsl(38, 92%, 35%);
}
.badge-muted {
  background: var(--bg-elevated);
  color: var(--text-muted);
}

/* =============================================
   شريط التنقل (Navbar)
   ============================================= */
.navbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: var(--navbar-height);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: var(--transition);
}

[data-theme="dark"] .navbar {
  background: rgba(13, 13, 20, 0.92);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1.5rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
}

.navbar-brand:hover { opacity: 1; color: var(--primary); }

.brand-icon {
  width: 2.25rem;
  height: 2.25rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.navbar-nav a {
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
  font-size: 0.95rem;
}

.navbar-nav a:hover,
.navbar-nav a.active {
  background: var(--primary-ultra-light);
  color: var(--primary);
  opacity: 1;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* زر الوضع الداكن */
.theme-toggle {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.theme-toggle:hover {
  background: var(--primary-ultra-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* قائمة المستخدم */
.user-menu {
  position: relative;
}

.user-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem 0.375rem 0.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 2rem;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-btn:hover { background: var(--primary-ultra-light); border-color: var(--primary); }

.user-avatar {
  width: 2rem;
  height: 2rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: var(--transition);
  z-index: 1000;
}

.dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a, .dropdown-menu button {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  background: none;
  cursor: pointer;
  transition: var(--transition);
  text-align: right;
}

.dropdown-menu a:hover, .dropdown-menu button:hover {
  background: var(--bg-elevated);
  color: var(--primary);
  opacity: 1;
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 0.5rem;
  background: none;
  border: none;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

/* =============================================
   المحتوى الرئيسي
   ============================================= */
.main-content {
  padding-top: var(--navbar-height);
}

/* =============================================
   قسم Hero
   ============================================= */
.hero {
  position: relative;
  padding: 5rem 0 4rem;
  overflow: hidden;
  background: linear-gradient(135deg, 
    hsl(262, 83%, 58%) 0%, 
    hsl(240, 70%, 45%) 50%, 
    hsl(220, 70%, 50%) 100%);
  color: white;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
  position: relative;
  text-align: center;
  max-width: 780px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-elevated);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 2rem;
  padding: 0.4rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--primary);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 1.25rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.15);
}

.hero h1 span {
  background: linear-gradient(135deg, #ffd700, #ff8c42);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.15rem;
  opacity: 0.9;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-buttons .btn-primary {
  background: white;
  color: var(--primary);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.hero-buttons .btn-primary:hover { opacity: 1; transform: translateY(-2px); }
.hero-buttons .btn-secondary {
  background: rgba(255,255,255,0.15);
  color: white;
  border-color: rgba(255,255,255,0.4);
}
.hero-buttons .btn-secondary:hover {
  background: rgba(255,255,255,0.25);
  opacity: 1;
  color: white;
}

/* =============================================
   شريط الإحصائيات
   ============================================= */
.stats-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
}

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

.stat-item {
  text-align: center;
  padding: 1rem;
}

.stat-number {
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

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

/* =============================================
   قسم التقنيات
   ============================================= */
.section {
  padding: 4rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-tag {
  display: inline-block;
  padding: 0.25rem 0.875rem;
  background: var(--primary-ultra-light);
  color: var(--primary);
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 550px;
  margin: 0 auto;
  line-height: 1.7;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

.tech-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
}

.tech-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  color: var(--primary);
  opacity: 1;
}

.tech-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
}

.tech-name { font-weight: 700; font-size: 0.9rem; }

/* =============================================
   بطاقة الكورس
   ============================================= */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.courses-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(var(--primary-rgb), 0.3);
}

.course-thumb {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-elevated);
}

.course-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.course-card:hover .course-thumb img { transform: scale(1.05); }

.course-thumb-badges {
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.course-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.course-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
  flex-wrap: wrap;
}

.course-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1rem;
  flex: 1;
}

.course-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.875rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.course-instructor {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.course-price {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.price-original {
  text-decoration: line-through;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.price-current {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
}

.price-free {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--success);
  background: var(--success-light);
  padding: 0.2rem 0.625rem;
  border-radius: 2rem;
}

/* مؤشر المستوى */
.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 2rem;
}

.level-beginner { background: var(--success-light); color: var(--success); }
.level-intermediate { background: var(--warning-light); color: hsl(38, 92%, 35%); }
.level-advanced { background: var(--danger-light); color: var(--danger); }

/* =============================================
   قسم المميزات
   ============================================= */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.feature-card {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(var(--primary-rgb), 0.3);
}

.feature-icon {
  width: 4rem;
  height: 4rem;
  background: linear-gradient(135deg, var(--primary-ultra-light), var(--primary-ultra-light));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin: 0 auto 1.25rem;
  border: 1px solid rgba(var(--primary-rgb), 0.2);
}

.feature-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.625rem;
}

.feature-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* =============================================
   قسم CTA
   ============================================= */
.cta-section {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  padding: 5rem 0;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.08) 0%, transparent 60%),
              radial-gradient(circle at 70% 50%, rgba(255,255,255,0.05) 0%, transparent 60%);
}

.cta-section h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 1rem;
  position: relative;
}

.cta-section p {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 2rem;
  position: relative;
}

.cta-section .btn {
  position: relative;
  background: white;
  color: var(--primary);
  font-size: 1.05rem;
  padding: 0.875rem 2.5rem;
}

/* =============================================
   الفوتر
   ============================================= */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-top: 0.75rem;
}

.footer h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.footer ul { list-style: none; }
.footer ul li { margin-bottom: 0.5rem; }
.footer ul li a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: var(--transition);
}
.footer ul li a:hover { color: var(--primary); opacity: 1; }

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* =============================================
   رأس الصفحة الداخلية
   ============================================= */
.page-header {
  background: linear-gradient(135deg, var(--primary-ultra-light), var(--bg));
  border-bottom: 1px solid var(--border);
  padding: 3rem 0 2rem;
}

.page-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* =============================================
   شريط البحث والتصفية
   ============================================= */
.search-bar {
  position: relative;
  max-width: 600px;
  margin: 1.5rem auto 0;
}

.search-input {
  width: 100%;
  padding: 0.875rem 3rem 0.875rem 1.25rem;
  border: 2px solid var(--border);
  border-radius: 2rem;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
  font-family: var(--font-main);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}

.search-icon {
  position: absolute;
  right: 1.125rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1.25rem 0;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.filter-btn {
  padding: 0.375rem 0.875rem;
  border-radius: 2rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-main);
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* =============================================
   صفحة تسجيل الدخول / التسجيل
   ============================================= */
.auth-page {
  min-height: calc(100vh - var(--navbar-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, var(--primary-ultra-light) 0%, var(--bg) 50%);
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}

.auth-icon {
  width: 4rem;
  height: 4rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin: 0 auto 1.5rem;
  box-shadow: var(--shadow-primary);
}

.auth-title {
  font-size: 1.625rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.auth-divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0.5rem 0;
  position: relative;
}

.auth-link {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 1.25rem;
}

.auth-link a { font-weight: 700; }

.demo-card {
  background: var(--primary-ultra-light);
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-top: 1.25rem;
  font-size: 0.85rem;
}

.demo-card h4 {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.demo-item {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  line-height: 1.8;
}

.demo-item code {
  font-family: monospace;
  background: rgba(var(--primary-rgb), 0.1);
  padding: 0 0.25rem;
  border-radius: 3px;
  color: var(--primary);
  font-size: 0.82rem;
}

/* =============================================
   رسائل الخطأ والنجاح
   ============================================= */
.alert {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
}

.alert-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid hsl(0, 84%, 85%);
}

.alert-success {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid hsl(142, 71%, 80%);
}

.alert-warning {
  background: var(--warning-light);
  color: hsl(38, 92%, 35%);
  border: 1px solid hsl(38, 92%, 80%);
}

.alert-info {
  background: hsl(199, 89%, 95%);
  color: hsl(199, 89%, 35%);
  border: 1px solid hsl(199, 89%, 80%);
}

[data-theme="dark"] .alert-danger { border-color: hsl(0, 84%, 25%); }
[data-theme="dark"] .alert-success { border-color: hsl(142, 71%, 20%); }

/* =============================================
   لوحة الطالب
   ============================================= */
.dashboard-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 3rem 0;
}

.dashboard-header h1 {
  font-size: 1.875rem;
  font-weight: 800;
  margin-bottom: 0.375rem;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.dash-stat {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}

.dash-stat-num {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.2;
}

.dash-stat-label {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 0.25rem;
}

.enrollment-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  transition: var(--transition);
}

.enrollment-card:hover {
  transform: translateX(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(var(--primary-rgb), 0.3);
}

.enrollment-thumb {
  width: 100px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-elevated);
}

.enrollment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.enrollment-info { flex: 1; min-width: 0; }

.enrollment-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.enrollment-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.enrollment-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.375rem;
  flex-shrink: 0;
}

.enrolled-check {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--success);
  font-size: 0.85rem;
  font-weight: 600;
}

/* =============================================
   لوحة الأدمن
   ============================================= */
.admin-layout {
  display: flex;
  min-height: calc(100vh - var(--navbar-height));
}

.admin-sidebar {
  width: 260px;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  position: sticky;
  top: var(--navbar-height);
  height: calc(100vh - var(--navbar-height));
  overflow-y: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.sidebar-subtitle {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.sidebar-nav {
  padding: 1rem;
  flex: 1;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
  margin-bottom: 0.25rem;
  text-decoration: none;
}

.sidebar-nav a:hover {
  background: var(--bg-elevated);
  color: var(--primary);
  opacity: 1;
}

.sidebar-nav a.active {
  background: var(--primary-ultra-light);
  color: var(--primary);
}

.sidebar-nav .nav-icon { font-size: 1.1rem; }

.admin-main {
  flex: 1;
  padding: 2rem;
  overflow-x: hidden;
}

.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-page-title {
  font-size: 1.5rem;
  font-weight: 800;
}

/* بطاقات الإحصاء للأدمن */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.admin-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.admin-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.admin-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.admin-stat-card.purple::before { background: var(--primary); }
.admin-stat-card.blue::before { background: var(--secondary); }
.admin-stat-card.green::before { background: var(--success); }
.admin-stat-card.gold::before { background: var(--warning); }

.stat-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.admin-stat-card .stat-number {
  font-size: 2.25rem;
  font-weight: 900;
  line-height: 1.1;
  color: var(--text-primary);
  -webkit-text-fill-color: unset;
  background: none;
}

.admin-stat-card.purple .stat-number { color: var(--primary); }
.admin-stat-card.blue .stat-number { color: var(--secondary); }
.admin-stat-card.green .stat-number { color: var(--success); }
.admin-stat-card.gold .stat-number { color: var(--warning); }

.admin-stat-card .stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.25rem;
}

/* الجداول */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th {
  background: var(--bg-elevated);
  padding: 0.875rem 1rem;
  text-align: right;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-elevated); }

.table-thumb {
  width: 48px;
  height: 32px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-elevated);
}

.actions-cell {
  display: flex;
  gap: 0.375rem;
  justify-content: flex-end;
}

/* =============================================
   النوافذ المنبثقة (Modals)
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: var(--transition);
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: none;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--danger-light);
  color: var(--danger);
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* =============================================
   Toggle Switch
   ============================================= */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toggle {
  position: relative;
  width: 48px;
  height: 26px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 2rem;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  right: 4px;
  top: 4px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.toggle input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(-22px);
}

.toggle-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* =============================================
   صفحة تفاصيل الكورس
   ============================================= */
.course-detail-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem;
  align-items: start;
}

.course-detail-main { min-width: 0; }

.course-detail-image {
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: var(--bg-elevated);
}

.course-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-quick-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.quick-stat {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}

.quick-stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.quick-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* بطاقة التسجيل */
.enrollment-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: calc(var(--navbar-height) + 1.5rem);
}

.sidebar-price-block {
  text-align: center;
  margin-bottom: 1.25rem;
}

.sidebar-price-current {
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.2;
}

.sidebar-price-original {
  text-decoration: line-through;
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 0.25rem;
}

.sidebar-discount-badge {
  display: inline-block;
  background: var(--danger);
  color: white;
  padding: 0.2rem 0.625rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 0.375rem;
}

.coupon-input-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.coupon-input-group .form-control {
  flex: 1;
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.coupon-result {
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.enrolled-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--success-light);
  color: var(--success);
  border: 1px solid hsl(142, 71%, 80%);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-weight: 700;
  font-size: 0.95rem;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--primary); }
.breadcrumb-sep { opacity: 0.4; }

/* =============================================
   كود الكوبون (Monospace)
   ============================================= */
.coupon-code {
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-ultra-light);
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.1em;
  border: 1px solid rgba(var(--primary-rgb), 0.2);
}

/* =============================================
   الدوران (Spinner)
   ============================================= */
.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(var(--primary-rgb), 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-white {
  border-color: rgba(255,255,255,0.3);
  border-top-color: white;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* =============================================
   توست النجاح/الخطأ
   ============================================= */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 280px;
  max-width: 380px;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid;
}

.toast-success {
  background: var(--success-light);
  color: var(--success);
  border-color: hsl(142, 71%, 80%);
}
.toast-error {
  background: var(--danger-light);
  color: var(--danger);
  border-color: hsl(0, 84%, 80%);
}
.toast-info {
  background: var(--primary-ultra-light);
  color: var(--primary);
  border-color: rgba(var(--primary-rgb), 0.3);
}

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

/* =============================================
   تحسين الصور الناقصة
   ============================================= */
.img-placeholder {
  background: linear-gradient(135deg, var(--primary-ultra-light), var(--bg-elevated));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--primary);
}

/* =============================================
   التصميم المتجاوب
   ============================================= */
@media (max-width: 1200px) {
  .courses-grid-4 { grid-template-columns: repeat(3, 1fr); }
  .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
  .tech-grid { grid-template-columns: repeat(3, 1fr); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .course-detail-layout { grid-template-columns: 1fr; }
  .enrollment-sidebar { position: static; }
  .course-quick-stats { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  
  .admin-sidebar {
    position: fixed;
    right: -260px;
    top: var(--navbar-height);
    z-index: 999;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
  }
  .admin-sidebar.open { right: 0; }
  .admin-layout { flex-direction: column; }
}

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .navbar-nav { display: none; }
  .navbar-nav.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--navbar-height);
    right: 0;
    left: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    box-shadow: var(--shadow-md);
    z-index: 999;
  }
  
  .courses-grid { grid-template-columns: repeat(2, 1fr); }
  .courses-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
  .tech-grid { grid-template-columns: repeat(3, 1fr); }
  
  .hero { padding: 3.5rem 0 3rem; }
  
  .admin-main { padding: 1.25rem; }
  
  .enrollment-card { flex-wrap: wrap; }
  .enrollment-thumb { width: 80px; height: 54px; }
}

@media (max-width: 480px) {
  .courses-grid { grid-template-columns: 1fr; }
  .courses-grid-4 { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .tech-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-stats { grid-template-columns: 1fr; }
  .admin-stats-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .course-quick-stats { grid-template-columns: repeat(2, 1fr); }
  .auth-card { padding: 1.75rem 1.25rem; }
  
  .hero h1 { font-size: 1.75rem; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .hero-buttons .btn { width: 100%; max-width: 280px; }
  
  .table-container { overflow-x: auto; }
}

/* =============================================
   الحركات والتأثيرات
   ============================================= */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.4s ease forwards; }

.stagger > * {
  opacity: 0;
  animation: fadeIn 0.4s ease forwards;
}
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.2s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.3s; }

/* =============================================
   Scrollbar & Touch Scrolling مخصص للمنصة
   ============================================= */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(15, 23, 42, 0.6); border-radius: 10px; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: 10px;
  border: 2px solid rgba(15, 23, 42, 0.6);
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--secondary-light) 100%);
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.6);
}

.table-container, .table-responsive, .custom-scroll {
  -webkit-overflow-scrolling: touch !important;
}

/* مؤشر التقدم للقراءة */
.price-preview {
  background: var(--primary-ultra-light);
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 600;
}

/* grid-2-cols layout for admin */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.grid-2-3 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .grid-2, .grid-2-3 { grid-template-columns: 1fr; }
}

/* User role icons */
.role-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  font-size: 1rem;
  flex-shrink: 0;
}

.role-admin { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; }
.role-student { background: var(--bg-elevated); color: var(--text-secondary); }
.role-supervisor { background: linear-gradient(135deg, #10b981, #059669); color: white; }

/* =============================================
   صفحة الأقسام — sections.html
   ============================================= */
.admin-sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

.section-card {
  transition: var(--transition);
}
.section-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.section-card-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  flex-wrap: wrap;
}

.section-icon-big {
  font-size: 2.5rem;
  flex-shrink: 0;
  width: 3.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-ultra-light);
  border-radius: var(--radius-sm);
}

.section-info { flex: 1; min-width: 160px; }
.section-name { font-weight: 800; font-size: 1rem; }
.section-desc { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }
.section-meta { display: flex; gap: 1rem; font-size: 0.78rem; color: var(--text-muted); margin-top: 0.375rem; }
.section-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

/* أيقونات اقتراحية */
.icon-picker { display: flex; gap: 0.75rem; align-items: flex-start; flex-wrap: wrap; }
.icon-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.5rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex: 1;
}
.icon-suggestions span {
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: var(--transition);
  line-height: 1;
}
.icon-suggestions span:hover {
  background: var(--primary-ultra-light);
  transform: scale(1.2);
}

/* =============================================
   قوائم التشغيل — playlists.html
   ============================================= */
.playlist-number {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* =============================================
   الدروس — lessons.html
   ============================================= */
.spinner-white {
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =============================================
   بطاقات المالية وترقية الحسابات (مشتركة)
   ============================================= */
.finance-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.finance-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.fc-icon  { width:3rem;height:3rem;border-radius:var(--radius-sm);display:flex;align-items:center;justify-content:center;font-size:1.5rem;margin-bottom:1rem; }
.fc-label { font-size:.8rem;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:.05em; }
.fc-value { font-size:1.9rem;font-weight:900;color:var(--text-primary);line-height:1.1;margin-top:.25rem; }
.fc-sub   { font-size:.8rem;color:var(--text-muted);margin-top:.35rem; }


/* ===== LTR Support ===== */
html[dir="ltr"] .navbar-brand { margin-left: 0; margin-right: auto; }
html[dir="ltr"] .navbar-actions { margin-right: 0; margin-left: auto; }
html[dir="ltr"] .hero-inner, html[dir="ltr"] .hero-content, html[dir="ltr"] .section-header { text-align: left; }
html[dir="ltr"] .admin-sidebar { border-left: none; border-right: 1px solid var(--border); }
html[dir="ltr"] .input-icon { right: auto; left: 1rem; }
html[dir="ltr"] .has-icon .form-control { padding-right: 1rem; padding-left: 3rem; }
html[dir="ltr"] .auth-link, html[dir="ltr"] .demo-card { text-align: left; }
html[dir="ltr"] .course-card-meta { justify-content: flex-start; gap: 1rem; }
html[dir="ltr"] .btn-icon { margin-right: 0; margin-left: 0.5rem; }
html[dir="ltr"] .sidebar-links a i { margin-left: 0; margin-right: 0.75rem; }



/* =============================================
   Responsive Design & Media Queries
   ============================================= */
@media (max-width: 1024px) {
  .container { padding: 0 1.5rem; }
  .grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .grid-3 { grid-template-columns: repeat(2, 1fr) !important; }
  .courses-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .tech-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 768px) {
  html { font-size: 14px; }
  
  .container { padding: 0 1rem; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr !important; }
  .courses-grid { grid-template-columns: 1fr !important; }
  .tech-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .stats-grid { grid-template-columns: 1fr !important; }
  
  /* Admin Layout */
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; border-left: none; border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
  .admin-content { padding: 1.5rem; }
  
  /* Header / Hero */
  .hero-inner { padding: 4rem 0; text-align: center !important; }
  .hero-inner h1 { font-size: 2.2rem; }
  .hero-inner p { font-size: 1.1rem; }
  
  /* Course Detail / Watch */
  .course-header-inner { flex-direction: column; gap: 2rem; }
  .course-sidebar-wrapper { position: static; width: 100%; margin-top: 2rem; }
  #video-wrapper { height: 35vh !important; min-height: 250px !important; }
  .watch-layout { flex-direction: column; }
  .watch-sidebar { width: 100%; height: auto; border-left: none; border-top: 1px solid var(--border); }
  
  /* Navbar */
  .navbar-actions .btn { padding: 0.4rem 0.6rem; font-size: 0.9rem; }
  .navbar-brand span { display: none; }
  .navbar-inner { gap: 10px; justify-content: space-between; }
  .navbar-actions { gap: 0.5rem; }
  .hide-on-mobile { display: none !important; }
}

@media (max-width: 480px) {
  .hero-inner h1 { font-size: 1.8rem; }
  .hero-inner p { font-size: 1rem; }
  .tech-grid { grid-template-columns: 1fr !important; }
  .btn { width: 100%; justify-content: center; margin-bottom: 0.5rem; }
  .modal-content { padding: 1.5rem; }
}

/* =============================================
   Premium UI Enhancements (Animations & Effects)
   ============================================= */

/* 1. Scroll Reveal Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* 2. Interactive Glow (Spotlight) Effect */
.glow-card {
  position: relative;
  overflow: hidden;
}
.glow-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle 400px at var(--mouse-x) var(--mouse-y), rgba(124, 58, 237, 0.15), transparent 80%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}
.glow-card:hover::before {
  opacity: 1;
}
[data-theme="light"] .glow-card::before {
  background: radial-gradient(circle 400px at var(--mouse-x) var(--mouse-y), rgba(124, 58, 237, 0.08), transparent 80%);
}

/* 3. Skeleton Loaders */
@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}
.skeleton {
  background: #e2e8f0;
  background-image: linear-gradient(90deg, #e2e8f0 0px, #f8fafc 40px, #e2e8f0 80px);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
  border-radius: var(--radius-sm);
}
[data-theme="dark"] .skeleton {
  background: #1e1e24;
  background-image: linear-gradient(90deg, #1e1e24 0px, #2a2a35 40px, #1e1e24 80px);
}
.skeleton-text { width: 100%; height: 1rem; margin-bottom: 0.5rem; }
.skeleton-text.short { width: 60%; }
.skeleton-img { width: 100%; height: 200px; }

/* 4. Modern Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.toast-modern {
  min-width: 300px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transform: translateX(-120%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  position: relative;
  overflow: hidden;
}
.toast-modern.show {
  transform: translateX(0);
  opacity: 1;
}
.toast-modern .toast-icon { font-size: 1.5rem; }
.toast-modern.success .toast-icon { color: var(--success); }
.toast-modern.error .toast-icon { color: var(--danger); }
.toast-modern .toast-message { font-weight: 600; color: var(--text-primary); font-size: 0.95rem; }
.toast-progress {
  position: absolute;
  bottom: 0; left: 0; height: 3px; background: var(--primary);
  width: 100%;
  transform-origin: left;
  animation: toast-progress linear forwards;
}
.toast-modern.error .toast-progress { background: var(--danger); }
.toast-modern.success .toast-progress { background: var(--success); }
@keyframes toast-progress {
  100% { transform: scaleX(0); }
}

/* 5. Button Ripple Effect */
.btn { position: relative; overflow: hidden; }
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: ripple 0.6s linear;
  background: rgba(255, 255, 255, 0.4);
}
@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}
