/* =======================================
✨ 1. الهوية والألوان (علم مصر)
======================================= */
:root {
  --primary-color: #080a74;
  --secondary-color: #D4A01D;
  --accent-color: #CE1126;
  --whatsapp-color: #25D366;
  --text-color: #333;
  --bg-light: #f9f9f9;
  --bg-white: #fff;
  --transition-speed: 0.4s;

  /* إعدادات الأنيميشن */
  --anim-ease: cubic-bezier(.2, .9, .2, 1);
  --anim-speed: 0.75s;
  --stagger-ms: 120ms;
}

/* =======================================
✨ 2. إعدادات عامة
======================================= */
body {
  font-family: 'Cairo', sans-serif;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  line-height: 1.7;
  scroll-behavior: smooth;
  color: var(--text-color);
  background-color: var(--bg-white);
  overflow-x: hidden;
}

/* تحسين الأداء: تعريف font-face لخط Cairo مع خاصية swap لضمان سرعة التحميل */
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 400;
  src: url('https://fonts.gstatic.com/s/cairo/v24/...') format('woff2'); /* يجب استبدال ... بمسار الخط الفعلي */
  font-display: swap; 
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  transition: transform var(--transition-speed);
}
img:hover {
  transform: scale(1.03);
}

/* =======================================
✨ 3. شريط التنقل
======================================= */
header {
  background: var(--bg-white);
  padding: 10px 6%;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 15px rgba(0,0,0,0.08);
  transition: background var(--transition-speed);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
nav .logo img {
  height: 55px;
  transition: transform var(--transition-speed);
}
nav .logo img:hover {
  transform: scale(1.05);
}

nav ul {
  display: flex;
  gap: 25px;
  list-style: none;
  margin: 0;
  padding: 0;
}
nav ul li a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 700;
  position: relative;
  transition: color var(--transition-speed);
}
nav ul li a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  left: 0;
  bottom: -5px;
  background: var(--secondary-color);
  transition: width var(--transition-speed);
}
nav ul li a:hover::after {
  width: 100%;
}
nav ul li a:hover {
  color: var(--secondary-color);
}

/* زر اللغة */
.lang-switcher {
  font-weight: 700;
  color: var(--secondary-color);
  border: 2px solid var(--secondary-color);
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none;
  transition: all var(--transition-speed);
}
.lang-switcher:hover {
  background: var(--secondary-color);
  color: #fff;
}

/* =======================================
✨ 4. الأقسام العامة
======================================= */
section {
  padding: 80px 10%;
  text-align: center;
  background-color: transparent;
}

/* ألوان الخلفيات */
section.hero {
  background-color: var(--primary-color);
  color: #fff;
  background-image: linear-gradient(rgba(19, 5, 88, 0.7), rgba(17, 7, 125, 0.7)), url('images/hero-bg.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  padding-bottom: 100px;
}
section:nth-of-type(even) {
  background-color: var(--bg-light);
}

section h1 {
  font-size: 42px;
  font-weight: 900;
  color: var(--secondary-color);
}
section.hero h1 {
  color: #fff;
  margin-bottom: 15px;
}
section h2 {
  font-size: 34px;
  font-weight: 700;
  color: var(--primary-color);
}
section.hero h2 {
  color: var(--secondary-color);
  margin-bottom: 40px;
  font-size: 30px;
}
section p {
  font-size: 18px;
  max-width: 850px;
  margin: 0 auto 25px auto;
}
section.hero p {
  color: #e0e0e0;
  font-size: 20px;
}

/* =======================================
✨ 5. بطاقات الخدمات في الهيرو (تم حل مشكلة المحاذاة)
======================================= */
.hero-services-grid {
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
  max-width: 1100px;
  margin: 0 auto 40px auto;
  gap: 20px;
}

.service-card {
  width: 100%;
  background: linear-gradient(135deg, var(--primary-color), #1d2ca3);
  color: #fff;
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  text-align: center;
  border-bottom: 5px solid var(--secondary-color);
}
.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

.service-card h3 {
  font-size: 20px;
  color: #fff;
  margin: 10px 0;
  font-weight: 700;
}
.service-card p {
  font-size: 15px;
  color: #fff;
  margin: 0;
}
.service-card i {
  font-size: 38px;
  color: var(--secondary-color);
}

/* تحسين SEO */
.seo-category-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--accent-color);
  margin: 40px 0 20px 0;
  border-bottom: 2px solid var(--secondary-color);
  padding-bottom: 10px;
  display: inline-block;
}

/* =======================================
✨ 6. الأزرار
======================================= */
.cta-button {
  display: inline-block;
  background: var(--secondary-color);
  color: #fff;
  padding: 14px 32px;
  font-size: 18px;
  font-weight: 700;
  border-radius: 10px;
  border: 2px solid var(--secondary-color);
  text-decoration: none;
  transition: all var(--transition-speed);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.cta-button:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
  transform: scale(1.06);
}

/* تنسيق زر "ابدأ رحلتك الآن" الجديد ليبرز */
.call-to-action-card-button {
  font-size: 22px;
  padding: 16px 40px;
  margin-top: 20px;
  background: linear-gradient(45deg, var(--secondary-color), var(--accent-color));
  border: none;
}
.call-to-action-card-button:hover {
  background: linear-gradient(45deg, var(--accent-color), var(--secondary-color));
  transform: scale(1.07);
}


.whatsapp-button {
  background: var(--whatsapp-color);
  border-color: var(--whatsapp-color);
}
.whatsapp-button:hover {
  background: #1EAE50;
  border-color: #1EAE50;
}

/* =======================================
✨ 7. الصور والمعرض وقائمة المزايا الجديدة
======================================= */
.features-images {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 25px;
  margin-top: 40px;
}
.features-images img {
  width: 45%;
  box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

/* قائمة المزايا الجديدة في قسم "لماذا مصر" */
.features-list-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 40px;
  margin-top: 25px;
}
.features-list-grid .feature-item {
  background: var(--bg-white);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  width: 250px;
}
.features-list-grid .feature-item i {
  font-size: 30px;
  color: var(--accent-color);
  margin-bottom: 10px;
}
.features-list-grid .feature-item p {
  font-weight: 700;
  color: var(--primary-color);
  margin: 0;
}


.gallery-grid {
  display: grid;
  /* تم التعديل: ليعرض 4 صور في الصف على الشاشات الكبيرة */
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
  gap: 15px;
  /* place-content: center; يحل مشكلة محاذاة grid في المنتصف */
  place-content: center;
}
/* تم تعديل قيمة التكبير لتصبح 1.4 (أفضل للقراءة من 2.5) */
.gallery-grid img {
  height: 200px;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  transition: all var(--transition-speed);
  position: relative; /* لضمان ظهور التكبير بشكل صحيح */
}
.gallery-grid img:hover {
  transform: scale(2.4); /* تكبير بنسبة 40% لتمكين رؤية أفضل */
  z-index: 10; /* لضمان ظهورها فوق العناصر المجاورة */
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}


/* =======================================
✨ 8. زر واتساب العائم
======================================= */
.whatsapp-floating-button {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: var(--whatsapp-color);
  color: #fff;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 28px;
  text-decoration: none;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  z-index: 1000;
  transition: transform var(--transition-speed);
}
.whatsapp-floating-button:hover {
  transform: scale(1.1);
}

/* =======================================
✨ 9. الفوتر
======================================= */
footer {
  background: var(--primary-color);
  color: #e3dbdb;
  padding: 40px 10%;
  text-align: center;
  font-size: 16px;
}
footer a {
  color: var(--secondary-color);
  text-decoration: none;
}
footer a:hover {
  color: var(--accent-color);
}

/* =======================================
✨ 10. قسم التخصصات (تم حل مشكلة المحاذاة)
======================================= */
.specialties-grid,
.bachelor-specialties-row { /* تم دمج التنسيقين لتحقيق محاذاة grid */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* عرض 3 أعمدة في الشاشات الكبيرة */
  max-width: 1100px;
  margin: 20px auto;
  gap: 25px;
}

.specialty-item {
  width: 100%; /* أصبح العرض تلقائيًا في Grid */
  background-color: var(--bg-white);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 6px 25px rgba(0,0,0,0.08);
  transition: all var(--transition-speed);
  border: 1px solid #eee;
  text-align: center;
  color: #000;
}
.specialty-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  border-color: var(--secondary-color);
}
.specialty-item h4 {
  font-size: 22px;
  color: var(--primary-color);
  margin-top: 15px;
  margin-bottom: 10px;
}
.specialty-item p {
  font-size: 16px;
  color: #000;
  margin: 0 auto;
  line-height: 1.6;
  max-width: 90%;
}
.specialty-item i {
  font-size: 40px;
  color: var(--secondary-color);
  margin-bottom: 10px;
  display: block;
  text-align: center;
}

/* =======================================
✨ 11. التجاوب
======================================= */
@media (max-width: 1024px) {
  .specialty-item {
    max-width: 90%;
  }
}
@media (max-width: 768px) {
  nav {
    flex-direction: column;
  }
  nav ul {
    flex-direction: column;
    width: 100%;
    text-align: center;
    margin-top: 10px;
  }
  nav ul li {
    margin: 8px 0;
  }
  section {
    padding: 60px 6%;
  }
  section h1 { font-size: 30px; }
  section h2 { font-size: 26px; }
  .features-images img { width: 100%; }
  .gallery-grid img { height: 160px; }
  
  /* التعديل: على شاشات الموبايل يتم عرض صورتين في الصف */
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
  
  /* التخصصات والخدمات في الشاشات الصغيرة تكون عمودية */
  .specialties-grid,
  .bachelor-specialties-row,
  .hero-services-grid {
    grid-template-columns: 1fr;
    align-items: center;
  }
  .features-list-grid .feature-item {
    width: 100%;
  }
}

/* =======================================
✨ 12. الأنيميشن عند التحميل
======================================= */
.animate-on-load {
  opacity: 0;
  transform: translateY(18px) scale(0.995);
  will-change: opacity, transform;
}
body.loaded .animate-on-load {
  animation-name: fadeUp;
  animation-duration: var(--anim-speed);
  animation-timing-function: var(--anim-ease);
  animation-fill-mode: both;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .animate-on-load,
  body.loaded .animate-on-load {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
/* ... (التنسيقات السابقة من 1 إلى 12) ... */

/* =======================================
✨ 13. قسم المعلومات المهمة (Accordion)
======================================= */
.accordion-container {
    max-width: 900px;
    margin: 40px auto;
    text-align: right;
}

.accordion-item {
    background-color: var(--bg-white);
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.accordion-header {
    background-color: var(--bg-light);
    color: var(--primary-color);
    padding: 18px 25px;
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    position: relative;
    user-select: none;
    transition: background-color 0.3s;
}

.accordion-header i {
    color: var(--secondary-color);
    margin-left: 15px;
    transition: transform 0.3s;
}

/* سهم الإظهار/الإخفاء */
.accordion-header::after {
    content: '+';
    position: absolute;
    left: 20px;
    font-size: 24px;
    line-height: 1;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s, content 0.3s;
    color: var(--accent-color);
}

/* حالة الفتح */
.accordion-header.active::after {
    content: '-';
    transform: translateY(-50%) rotate(0deg); 
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, padding 0.5s ease-out;
    padding: 0 25px;
    background-color: #fafafa;
}

.accordion-header.active + .accordion-content {
    max-height: 1500px; /* قيمة كبيرة بما يكفي لاستيعاب المحتوى */
    padding: 20px 25px;
    border-top: 1px solid #eee;
}

.accordion-content h4 {
    color: var(--accent-color);
    font-size: 18px;
    margin-top: 15px;
    border-bottom: 1px dashed #ddd;
    padding-bottom: 5px;
}

.accordion-content ul, 
.accordion-content p {
    text-align: right;
    padding-right: 0;
    margin-right: 0;
}

.note-box {
    background-color: #ffeccf;
    border-right: 5px solid var(--secondary-color);
    padding: 15px;
    margin: 20px 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-color);
}

.styled-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 15px;
    text-align: right;
}
.styled-table th, .styled-table td {
    padding: 10px;
    border: 1px solid #ddd;
}
.styled-table th {
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 700;
}
.styled-table tr:nth-child(even) {
    background-color: #f2f2f2;
}

/* ... (بقية ملف style.css) ... */