:root {
  /* ألوان العلامة التجارية المستمدة من الشعار */
  --primary-color: #4D0F1E; /* عنابي داكن */
  --secondary-color: #3F4E60; /* رمادي مزرق */
  --light-color: #F7F6F3; /* لون فاتح للخلفيات */
  --text-color: #222; /* لون النص الأساسي */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Tajawal', sans-serif;
}

body {
  background-color: var(--light-color);
  direction: rtl;
  text-align: right;
  /* منع التمرير الأفقي */
  overflow-x: hidden;
}

/* الحاوية الرئيسية لضبط العرض */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* رأس الموقع */
/* رأس الموقع بلون أبيض لإظهار الشعار بوضوح */
header {
  background-color: #ffffff;
  color: var(--primary-color);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

header .logo {
  width: 120px;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
}

nav ul li a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s;
}

nav ul li a:hover {
  opacity: 0.7;
}

.lang-switch a {
  color: var(--primary-color);
  text-decoration: none;
}

/* قسم الواجهة */
.hero {
  position: relative;
  background-image: url('images/hero.png');
  background-size: cover;
  background-position: center;
  color: var(--light-color);
  padding: 120px 20px;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.45);
}

.hero .hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  font-size: 36px;
  margin-bottom: 20px;
}

.hero p {
  font-size: 18px;
  margin-bottom: 30px;
}

/* الأزرار */
.btn,
.btn,
.btn-secondary {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s;
  border: none;
  background-color: var(--primary-color);
  color: var(--light-color);
}

/* تغيير اللون عند التمرير لتوضيح التفاعل */
.btn:hover,
.btn-secondary:hover {
  background-color: #3a0b18;
}

/* قسم الشهادات المعتمدة */
.certifications {
  padding: 60px 20px;
}

.certifications h2 {
  text-align: center;
  margin-bottom: 40px;
  color: var(--primary-color);
  font-size: 28px;
}

.certifications .cards {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.certifications .card {
  background-color: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  padding: 20px;
  width: 280px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.certifications .card h3 {
  color: var(--primary-color);
  margin-bottom: 10px;
  font-size: 20px;
}

.certifications .card p {
  color: var(--text-color);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* قسم التوصيات */
.testimonials {
  background-color: var(--secondary-color);
  color: var(--light-color);
  padding: 60px 20px;
}

.testimonials h2 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 28px;
}

.testimonial-slider {
  display: flex;
  transition: transform 0.5s ease-in-out;
  /* عرض العرضات متعدّد العناصر */
}

.testimonial {
  flex: 0 0 100%;
  text-align: center;
  padding: 0 20px;
}

.testimonial p {
  font-size: 18px;
  margin-bottom: 10px;
  line-height: 1.6;
}

.testimonial span {
  font-size: 14px;
  font-weight: 600;
}

/* قسم الاتصال */
.contact {
  background-color: var(--light-color);
  padding: 60px 20px;
}

.contact h2 {
  text-align: center;
  margin-bottom: 20px;
  color: var(--primary-color);
  font-size: 28px;
}

.contact form {
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--text-color);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: 'Tajawal', sans-serif;
}

.form-group textarea {
  resize: vertical;
}

.contact button.btn {
  display: block;
  margin: 0 auto;
}

/* التذييل */
footer {
  background-color: var(--primary-color);
  color: #fff;
  text-align: center;
  padding: 20px 0;
  font-size: 14px;
}

/* شريط العرض في الصفحة الرئيسية */
.hero-slider {
  position: relative;
  overflow: hidden;
  margin: 40px 0;
}

.hero-slider .slides {
  display: flex;
  transition: transform 0.6s ease-in-out;
}

.hero-slider .slide {
  flex: 0 0 100%;
  height: 400px;
  position: relative;
  background-size: cover;
  background-position: center;
  border-radius: 16px;
}

.hero-slider .overlay {
  position: absolute;
  bottom: 30px;
  right: 30px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  padding: 20px;
  border-radius: 8px;
  max-width: 50%;
}

.hero-slider .overlay h2 {
  font-size: 28px;
  margin-bottom: 10px;
}

.hero-slider .overlay p {
  font-size: 16px;
  margin-bottom: 15px;
}

.hero-slider .slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-slider .prev {
  right: auto;
  left: 15px;
}

.hero-slider .next {
  left: auto;
  right: 15px;
}

/* جعل بطاقات الدورات بنفس الطول ومحاذاة الأزرار في الأسفل */
.courses-list .card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* السماح للبطاقة بالتوسع وفق شبكة CSS */
  width: auto;
  min-width: 0;
}

/* ضمان امتداد نص الوصف لملء المساحة ودفع الزر للأسفل في بطاقات الدورات */
.courses-list .card p {
  flex-grow: 1;
}

/* تمييز الرابط النشط في شريط التنقل */
nav ul li a.active {
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 4px;
}

/* أقسام الصفحات الإضافية */
.courses-list,
.cert-list-section,
.executive-info,
.blog-posts,
.login-page {
  padding: 60px 20px;
}

.courses-list h2,
.cert-list-section h2,
.executive-info h2,
.blog-posts h2,
.login-page h2 {
  text-align: center;
  margin-bottom: 40px;
  color: var(--primary-color);
  font-size: 28px;
}

/* القوائم في صفحة الشهادات */
.certifications-list {
  list-style: none;
  max-width: 600px;
  margin: 0 auto;
  padding: 0;
}

.certifications-list li {
  position: relative;
  padding-right: 30px;
  margin-bottom: 10px;
  font-size: 18px;
  color: var(--text-color);
}

.certifications-list li::before {
  content: '✓';
  position: absolute;
  right: 0;
  top: 0;
  color: var(--secondary-color);
  font-weight: bold;
}

/* معلومات التعليم التنفيذي */
.executive-info p {
  margin-bottom: 20px;
  line-height: 1.6;
  color: var(--text-color);
  text-align: justify;
}

.executive-info .btn {
  margin-top: 20px;
}

/* صفحة المدونة */
.blog-posts .cards {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

/* بطاقات صفحة الدورات التدريبية */
/* شبكة لبطاقات الدورات في صفحة الدورات التدريبية لضمان محاذاة الأزرار في الصف نفسه */
.courses-list .cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* صفحة تسجيل الدخول */
.login-page {
  background-color: var(--light-color);
}

.login-form {
  max-width: 400px;
  margin: 0 auto;
}

.login-form button.btn {
  width: 100%;
}

/* قسم البرامج المميزة - شريط عرض أفقي */
.feature-slider {
  padding: 60px 20px;
  background-color: var(--light-color);
}

.feature-slider h2 {
  text-align: center;
  margin-bottom: 30px;
  color: var(--primary-color);
  font-size: 28px;
}

.feature-slider-wrapper {
  position: relative;
}

.feature-slides {
  display: flex;
  overflow: hidden;
  gap: 20px;
  direction: ltr; /* تسهيل التمرير الأفقي */
}

.feature-card {
  flex: 0 0 280px;
  height: 320px;
  border-radius: 16px;
  background-size: cover;
  background-position: center;
  position: relative;
  color: #fff;
}

.feature-overlay {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  padding: 20px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 0 0 16px 16px;
}

.feature-overlay h3 {
  margin-bottom: 8px;
  font-size: 20px;
}

.feature-overlay p {
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.4;
}

/* أزرار التنقل في قسم البرامج */
.feature-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.feature-nav:hover {
  background: rgba(0, 0, 0, 0.6);
}

.feature-nav.prev-feature {
  right: auto;
  left: 10px;
}

.feature-nav.next-feature {
  left: auto;
  right: 10px;
}

@media (max-width: 768px) {
  .feature-card {
    flex: 0 0 80%;
    height: 300px;
  }
  .feature-nav.prev-feature {
    left: 10px;
  }
  .feature-nav.next-feature {
    right: 10px;
  }
}