/* Professional CSS Variables */
:root {
  /* Brand Colors */
  --brand: #7C5CFF;
  --accent: #22D3EE;
  --secondary: #A855F7;
  --tertiary: #06B6D4;
  
  /* ذهب */
  --gold-1: #D4AF37;
  --gold-2: #F5D76E;
  
  /* Dark Theme */
  --bg: #0C0F17;
  --card: #121829;
  --surface: #1A1F35;
  --text: #EAF0F6;
  --text-secondary: #A9B3C1;
  --text-muted: #6B7280;
  --border: #2A3441;
  --border-light: #374151;
  
  /* Glassmorphism */
  --glass-bg: rgba(18, 24, 41, 0.6);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  
  /* Gradients */
  --aurora-gradient: linear-gradient(135deg, #7C5CFF 0%, #A855F7 25%, #06B6D4 50%, #22D3EE 75%, #7C5CFF 100%);
  --card-gradient: linear-gradient(135deg, var(--brand), var(--accent));
  --text-gradient: linear-gradient(135deg, var(--gold-1), var(--gold-2));
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 16px 64px rgba(0, 0, 0, 0.25);
  
  /* Animation */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* Spacing */
  --container-padding: 2rem;
  --section-gap: 5rem;
  --card-padding: 2rem;
  --border-radius: 1.25rem;
  --border-radius-lg: 2rem;
}

/* Light Theme */
[data-theme="light"] {
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --surface: #F1F5F9;
  --text: #1E293B;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --border-light: #CBD5E1;
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* High Contrast Theme */
[data-theme="high-contrast"] {
  --bg: #000000;
  --card: #1A1A1A;
  --surface: #2A2A2A;
  --text: #FFFFFF;
  --text-secondary: #E0E0E0;
  --text-muted: #CCCCCC;
  --border: #444444;
  --border-light: #666666;
  --brand: #00CCFF;
  --accent: #FFD700;
  --glass-bg: rgba(26, 26, 26, 0.9);
  --glass-border: rgba(255, 255, 255, 0.2);
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  gap: 6px;
  margin-right: 0.5rem;
}

.btn.lang {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 0.5rem;
  transition: all var(--transition-fast);
}

.btn.lang.active {
  background: var(--brand);
  color: white;
  box-shadow: 0 0 0 2px var(--accent);
}

.btn.lang:hover:not(.active) {
  background: var(--surface);
  transform: translateY(-1px);
}

/* LTR Support for English */
:root:dir(ltr) .title-separator { 
  margin: 0 0.5rem; 
}

:root:dir(ltr) .timeline-container::before { 
  left: 2rem; 
  right: auto; 
}

:root:dir(ltr) .timeline-marker {
  left: 2rem;
  right: auto;
}

:root:dir(ltr) .timeline-content {
  margin-left: 4rem;
  margin-right: 0;
}

:root:dir(ltr) .hero-title {
  text-align: left;
}

:root:dir(ltr) .hero-description {
  text-align: left;
}

:root:dir(ltr) .section-title {
  text-align: center;
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: 'IBM Plex Sans Arabic', 'Tajawal', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
  position: relative;
}

/* Aurora Background */
.aurora-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--aurora-gradient);
  background-size: 300% 300%;
  animation: aurora-move 20s ease-in-out infinite;
  opacity: 0.1;
  z-index: -2;
}

@keyframes aurora-move {
  0%, 100% { background-position: 0% 50%; }
  33% { background-position: 100% 50%; }
  66% { background-position: 50% 100%; }
}

/* Noise Overlay */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.03;
  z-index: -1;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><filter id="noiseFilter"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="3" stitchTiles="stitch"/></filter></defs><rect width="100%" height="100%" filter="url(%23noiseFilter)" opacity="0.4"/></svg>') repeat;
}

/* Glassmorphism Effect */
.glass-effect {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1, h2, h3,
.hero-title .title-main,
.section-title,
.title-main {
  background: var(--text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* Fallback for browsers that don't support background-clip: text */
  color: var(--gold-1);
}

.title-main {
  display: block;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem var(--container-padding);
  transition: all var(--transition-normal);
}

.nav.scrolled {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 700;
  font-size: 1.1rem;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--glass-border);
  transition: transform var(--transition-normal);
}

.brand-logo:hover {
  transform: scale(1.05);
}

.avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
}

.gradient-bg {
  background: var(--card-gradient);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-subtitle {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-controls {
  display: flex;
  gap: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--border-radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  font-family: inherit;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn.primary {
  background: var(--card-gradient);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn.subtle {
  background: var(--glass-bg);
  color: var(--text);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
}

.btn.subtle:hover {
  background: var(--surface);
  transform: translateY(-1px);
}

.btn:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Hero Section */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 8rem var(--container-padding) 4rem;
  position: relative;
}

.hero-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 4rem;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.5rem 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 2rem;
  backdrop-filter: blur(8px);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
}

.title-main {
  display: block;
}

.title-separator {
  color: var(--accent);
  margin: 0 0.5rem;
}

.title-sub {
  color: var(--text-secondary);
  font-size: 0.7em;
  font-weight: 600;
}

.hero-description {
  font-size: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 600px;
}

/* تنسيق قائمة الخبرات الجديدة */
.experience-list {
  list-style: disc inside;
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--glass-shadow);
}
.experience-list li { 
  margin: .5rem 0; 
}
.experience-list strong {
  color: var(--gold-2);
}

/* Special Offers Section */
.special-offers-section {
  padding: var(--section-gap) 0;
  text-align: right;
}

/* ذهبي موحّد للعناوين في الوضع النهاري */
:root {
  --gold-1: #D4AF37;
  --gold-2: #F5D76E;
  /* تأكد أن تدرّج النص يعتمد الذهبي */
  --text-gradient: linear-gradient(135deg, var(--gold-1), var(--gold-2));
}

/* طبّق الذهبي على العناوين مباشرة أيضاً لضمان ظهوره حتى لو لم تُطبّق text-gradient */
h1, h2, .hero-title .title-main, .section-title {
  background: var(--text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* Fallback for browsers that don't support background-clip: text */
  color: var(--gold-1);
}

/* ألوان الأيقونات والدوائر إلى ذهبي */
.program-icon,
.timeline-marker .marker-dot {
  background: linear-gradient(135deg, var(--gold-1), var(--gold-2)) !important;
  color: #1A1F2E; /* تباين جيد مع الذهبي */
}

/* لو كانت هناك أيقونات SVG ملونة بالتيار (currentColor) داخل بطاقات/أزرار، اجعل لونها ذهبيًا */
.program-card svg,
.btn-cta svg,
.timeline-content svg {
  color: var(--gold-1);
  fill: currentColor;
}

/* تحسين تباين الأيقونات داخل الأيقونات الذهبية */
.program-icon svg,
.fab svg,
.btn-cta svg {
  color: #1A1F2E !important;
  fill: currentColor !important;
}

/* تنسيق جدول الدورات الجديدة */
.courses-table {
  margin-top: 1.25rem;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

.courses-head,
.course-row {
  display: grid;
  grid-template-columns: 1.5fr .7fr 1fr; /* اسم – ساعات – جهة اعتماد */
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.courses-head {
  background: rgba(255, 255, 255, 0.04);
  font-weight: 700;
  color: var(--gold-2);
  border-bottom: 1px solid var(--glass-border);
}

.course-row {
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
}

.course-row:nth-child(even) {
  background: rgba(255,255,255,0.03);
}

.course-row .c-name { color: var(--text); }
.course-row .c-hours { color: var(--text-secondary); font-weight: 600; }
.course-row .c-cert { color: var(--text-secondary); }

/* في الشاشات الصغيرة نجعلها صفوفًا مكدّسة */
@media (max-width: 640px) {
  .courses-head, .course-row {
    grid-template-columns: 1fr;
  }
  .courses-head span { padding: .15rem 0; }
  .course-row span { padding: .1rem 0; }
}

.hero-stats {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Hero Card */
.hero-card {
  border-radius: var(--border-radius-lg);
  padding: var(--card-padding);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-gradient);
}

.card-header {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.profile-image {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--glass-border);
}

.profile-info h3 {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.profile-info p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.card-description {
  color: var(--text-secondary);
  font-style: italic;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--border-radius);
  border-left: 4px solid var(--accent);
}

.cta-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-cta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition-normal);
  border: 2px solid transparent;
}

.btn-cta.whatsapp {
  background: #25D366;
  color: white;
}

.btn-cta.whatsapp:hover {
  background: #128C7E;
  transform: translateX(-4px);
}

.btn-cta.email {
  background: #4F46E5; /* Indigo color for email button */
  color: white;
  border-color: transparent;
}

.btn-cta.email:hover {
  background: #4338CA; /* Darker indigo on hover */
  transform: translateX(-4px);
}

.btn-cta.links {
  background: var(--card-gradient);
  color: white;
}

.btn-cta.links:hover {
  transform: translateX(-4px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.card-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--glass-border);
}

.location {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Expertise Section */
.expertise-section {
  padding: var(--section-gap) 0;
}

.expertise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.expertise-card {
  padding: var(--card-padding);
  border-radius: var(--border-radius-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.expertise-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.card-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.expertise-card h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.expertise-card p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.card-stats {
  padding-top: 1rem;
  border-top: 1px solid var(--glass-border);
}

.stat {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Timeline Section */
.timeline-section {
  padding: var(--section-gap) 0;
  background: transparent; /* Fixed: was var(--surface) causing gray block */
}

.timeline-container {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.timeline-container::before {
  content: '';
  position: absolute;
  top: 0;
  right: 2rem;
  bottom: 0;
  width: 2px;
  background: var(--card-gradient);
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}

.timeline-item:nth-child(even) {
  flex-direction: row-reverse;
}

.timeline-item:nth-child(even) .timeline-content {
  text-align: right;
}

.timeline-marker {
  position: relative;
  flex-shrink: 0;
  z-index: 2;
}

.marker-dot {
  width: 20px;
  height: 20px;
  background: var(--card-gradient);
  border-radius: 50%;
  border: 4px solid var(--bg);
  position: relative;
  z-index: 2;
}

.marker-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  background: var(--brand);
  border-radius: 50%;
  opacity: 0.3;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.3;
  }
  100% {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}

.timeline-content {
  flex: 1;
  padding: var(--card-padding);
  border-radius: var(--border-radius-lg);
  position: relative;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.timeline-header h3 {
  color: var(--brand);
  font-size: 1.3rem;
  margin: 0;
}

.timeline-period {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--surface);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
}

.timeline-role {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.timeline-description {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.timeline-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  background: var(--glass-bg);
  color: var(--text);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  border: 1px solid var(--glass-border);
}

/* Programs Section */
.programs-section {
  padding: var(--section-gap) 0;
}

.programs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.program-card {
  padding: var(--card-padding);
  border-radius: var(--border-radius-lg);
  text-align: center;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.program-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.program-card h3 {
  color: var(--text);
  margin-bottom: 1rem;
}

/* QR Section */
.qr-section {
  padding: var(--section-gap) 0;
  text-align: center;
}

.qr-container {
  max-width: 400px;
  margin: 0 auto;
  padding: var(--card-padding);
  border-radius: var(--border-radius-lg);
  text-align: center;
}

.qr-image {
  width: 200px;
  height: 200px;
  margin: 0 auto 1rem;
  border-radius: var(--border-radius);
  transition: all var(--transition-normal);
  cursor: pointer;
}

.qr-image:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.qr-note {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Floating Action Buttons */
.fab-container {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 1000;
}

.fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-normal);
  backdrop-filter: blur(8px);
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-xl);
}

.fab.whatsapp {
  background: #25D366;
}

.fab.email {
  background: var(--card-gradient);
}

/* Footer */
.footer {
  margin-top: var(--section-gap);
  padding: var(--card-padding) 0;
  border-top: 1px solid var(--glass-border);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--container-padding);
  text-align: center;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.contact-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-secondary);
}

.contact-item a {
  color: var(--brand);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.contact-item a:hover {
  color: var(--accent);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  text-align: initial;
}

.footer-bottom small {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.credit-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
}

.credit-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.credit-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .hero-container {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }
  
  .hero-card {
    max-width: 500px;
    margin: 0 auto;
  }
  
  .timeline-item {
    flex-direction: column !important;
    text-align: center !important;
  }
  
  .timeline-container::before {
    right: 50%;
    transform: translateX(50%);
  }
  
  .timeline-content {
    text-align: center !important;
  }
}

@media (max-width: 768px) {
  :root {
    --container-padding: 1rem;
    --section-gap: 3rem;
    --card-padding: 1.5rem;
  }
  
  .nav {
    padding: 1rem;
  }
  
  .brand {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  
  .brand-logo {
    width: 40px;
    height: 40px;
  }
  
  .actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .theme-controls {
    flex-direction: row;
  }
  
  .hero-section {
    padding: 6rem 1rem 3rem;
    min-height: auto;
  }
  
  .hero-stats {
    flex-direction: column;
    gap: 1rem;
  }
  
  .stat-item {
    flex-direction: row;
    justify-content: space-between;
    background: var(--glass-bg);
    padding: 1rem;
    border-radius: var(--border-radius);
  }
  
  .expertise-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .programs-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .fab-container {
    bottom: 1rem;
    left: 1rem;
  }
  
  .fab {
    width: 48px;
    height: 48px;
  }

  .footer-bottom {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: .5rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-description {
    font-size: 1rem;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
  
  .cta-buttons {
    gap: 0.5rem;
  }
  
  .btn-cta {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
  
  .timeline-header {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .qr-image {
    width: 160px;
    height: 160px;
  }
}

/* Animation Classes */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.fade-in-right {
  animation: fadeInRight 0.6s ease-out;
}

.fade-in-left {
  animation: fadeInLeft 0.6s ease-out;
}

.zoom-in {
  animation: zoomIn 0.6s ease-out;
}

/* تعزيز أولوية قاعدة العناوين الذهبية - إضافة في 2025/09/02 */
h1, h2, .hero-title .title-main, .section-title { 
  background: var(--text-gradient) !important; 
  -webkit-background-clip: text !important; 
  background-clip: text !important; 
  -webkit-text-fill-color: transparent !important; 
  color: var(--gold-1) !important; 
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  .aurora-bg {
    animation: none;
  }
  
  .marker-pulse {
    animation: none;
  }
  
  .btn::before {
    transition: none;
  }
  
  .fade-in-up,
  .fade-in-right,
  .fade-in-left,
  .zoom-in {
    animation: none;
  }
}

/* Focus Styles */
.btn:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* High Contrast Mode Adjustments */
@media (prefers-contrast: high) {
  :root {
    --glass-bg: rgba(0, 0, 0, 0.9);
    --glass-border: rgba(255, 255, 255, 0.3);
  }
  
  .glass-effect {
    background: var(--card);
    border: 2px solid var(--border);
  }
}

/* Print Styles */
@media print {
  .nav,
  .fab-container,
  .aurora-bg,
  .noise-overlay {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .glass-effect {
    background: white !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
  }
  
  .hero-section {
    padding: 2rem 1rem;
  }
  
  .section-title {
    color: black !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
  }
}

/* Loading State */
.loading {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.loaded {
  opacity: 1;
}

/* Utility Classes */
.text-gradient {
  background: var(--text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* Fallback for browsers that don't support background-clip: text */
  color: var(--gold-1);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--brand);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 9999;
}

.skip-link:focus {
  top: 6px;
}

/* إيقاف الأقسام القديمة إن بقيت بالملف */
.grid.stats, section.timeline {
  display: none !important;
}

/* Enhanced Program Cards */
.program-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.program-card {
  text-align: center;
  transition: all var(--transition-normal);
}

.program-card h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.program-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* === Mobile timeline fixes (<= 640px) === */
@media (max-width: 640px) {
  .timeline-container::before { right: 1rem; }
  .timeline-item,
  .timeline-item:nth-child(even) { flex-direction: row; }
  .timeline-content { margin: 0; }
  .timeline-marker { margin-inline-start: 0; }
}