:root {
  --primary-color: #a8c45b;
  --primary-dark: #84b400;
  --secondary-color: #00c4cc;
  --accent-color: #579192;
  --dark-color: #2c3e50;
  --light-color: #f8f9fa;
  --text-color: #333;
  --text-light: #6c757d;
  --border-color: #e9ecef;
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --border-radius: 12px;
  --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "IBM Plex Sans Arabic", sans-serif;
}

body {
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* قسم البرامج */
.programs-section {
  padding: 40px 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  min-height: 100vh;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--dark-color);
  margin-bottom: 40px;
  padding-bottom: 15px;
  border-bottom: 3px solid var(--primary-color);
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -3px;
  right: 50%;
  transform: translateX(50%);
  width: 100px;
  height: 3px;
  background: var(--primary-dark);
}

/* بطاقة البرنامج */
.program-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  border: 1px solid #e9ecef;
  position: relative;
  overflow: hidden;
}

.program-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-dark)
  );
  transition: var(--transition);
}

.program-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.program-card:hover::before {
  width: 8px;
}

/* الصورة الرئيسية */
.program-main-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
  border: 3px solid var(--primary-color);
  transition: var(--transition);
}

.program-card:hover .program-main-image {
  transform: scale(1.02);
  border-color: var(--primary-dark);
}

/* معرض الصور */
.program-gallery {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding: 10px 0;
}

.program-gallery-image {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: var(--transition);
  cursor: pointer;
  flex-shrink: 0;
}

.program-gallery-image:hover {
  transform: scale(1.1);
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(168, 196, 91, 0.3);
}

/* عنوان البرنامج */
.program-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--dark-color);
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-color);
}

/* وصف البرنامج */
.program-description {
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 20px;
  font-size: 1.05rem;
  text-align: justify;
}

/* تواريخ البرنامج */
.program-dates {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  padding: 20px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
  border-right: 4px solid var(--primary-color);
}

.program-date {
  margin-bottom: 8px;
  font-size: 1rem;
  color: var(--dark-color);
}

.program-date strong {
  color: var(--primary-dark);
}

.program-duration {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #dee2e6;
}

/* رابط PDF */
.program-pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #dc3545;
  color: white;
  padding: 12px 25px;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  margin-bottom: 15px;
  border: 2px solid transparent;
}

.program-pdf-link:hover {
  background: #c82333;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
  border-color: #fff;
}

/* زر التسجيل */
.program-register-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-dark)
  );
  color: white;
  padding: 15px 30px;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: var(--transition);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.program-register-btn::before {
  content: "";
  position: absolute;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: right 0.6s ease;
}

.program-register-btn:hover::before {
  right: 100%;
}

.program-register-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(168, 196, 91, 0.4);
  border-color: rgba(255, 255, 255, 0.3);
}

/* تأثيرات الظهور */
.program-card {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* تأخير في ظهور البطاقات */
.program-card:nth-child(1) {
  animation-delay: 0.1s;
}
.program-card:nth-child(2) {
  animation-delay: 0.2s;
}
.program-card:nth-child(3) {
  animation-delay: 0.3s;
}
.program-card:nth-child(4) {
  animation-delay: 0.4s;
}
.program-card:nth-child(5) {
  animation-delay: 0.5s;
}

/* التجاوب */
@media (max-width: 768px) {
  .programs-section {
    padding: 20px 0;
  }

  .section-title {
    font-size: 2rem;
    margin-bottom: 30px;
  }

  .program-card {
    padding: 20px;
    margin-bottom: 20px;
  }

  .program-title {
    font-size: 1.5rem;
  }

  .program-main-image {
    height: 200px;
  }

  .program-gallery-image {
    width: 100px;
    height: 70px;
  }

  .program-register-btn {
    padding: 12px 25px;
    font-size: 1rem;
    width: 100%;
    justify-content: center;
  }

  .program-pdf-link {
    padding: 10px 20px;
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }

  .section-title {
    font-size: 1.7rem;
  }

  .program-card {
    padding: 15px;
  }

  .program-title {
    font-size: 1.3rem;
  }

  .program-main-image {
    height: 150px;
  }

  .program-gallery {
    gap: 5px;
  }

  .program-gallery-image {
    width: 80px;
    height: 60px;
  }

  .program-dates {
    padding: 15px;
  }
}

/* تحسينات إضافية */
.program-card {
  background: linear-gradient(135deg, #ffffff, #f8f9fa);
}

.program-dates {
  background: linear-gradient(
    135deg,
    rgba(168, 196, 91, 0.05),
    rgba(132, 180, 0, 0.08)
  );
}

/* تأثيرات التركيز للوصول */
.program-register-btn:focus,
.program-pdf-link:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* شريط التمرير في المعرض */
.program-gallery::-webkit-scrollbar {
  height: 8px;
}

.program-gallery::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.program-gallery::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

.program-gallery::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* حالة خاصة عندما لا توجد برامج */
.programs-section:empty::before {
  content: "لا توجد برامج حالياً";
  display: block;
  text-align: center;
  font-size: 1.5rem;
  color: var(--text-light);
  padding: 60px 20px;
  background: white;
  border-radius: var(--border-radius);
  margin: 20px 0;
  box-shadow: var(--box-shadow);
}

.details-box {
  display: none;
  background: linear-gradient(135deg, #f8fffe 0%, #f0f9ff 100%);
  padding: 20px;
  margin-top: 15px;
  border-radius: 12px;
  border: 2px solid #00c4cc;
  box-shadow: 0 4px 15px rgba(0, 196, 204, 0.1);
  transform: translateY(-10px);
  opacity: 0;
  animation: slideDown 0.3s ease forwards;
}

@keyframes slideDown {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.details-toggle-btn {
  background: linear-gradient(135deg, #00c4cc 0%, #00a8b0 100%);
  color: white;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 10px;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 196, 204, 0.3);
  position: relative;
  overflow: hidden;
}

.details-toggle-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.details-toggle-btn:hover::before {
  left: 100%;
}

.details-toggle-btn i {
  margin-right: 8px;
  transition: transform 0.3s ease;
}

.details-toggle-btn:hover {
  background: linear-gradient(135deg, #00a8b0 0%, #009099 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 196, 204, 0.4);
}

.details-toggle-btn:hover i {
  transform: rotate(-90deg);
}

.apply-btn {
  display: block;
  margin-top: 20px;
  background: linear-gradient(135deg, #a8c45b 0%, #95b34a 100%);
  padding: 14px;
  color: white;
  text-align: center;
  border-radius: 10px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(168, 196, 91, 0.3);
  position: relative;
  overflow: hidden;
}

.apply-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transition: width 0.3s, height 0.3s, top 0.3s, left 0.3s;
}

.apply-btn:hover::after {
  width: 300px;
  height: 300px;
  top: -50px;
  left: -50px;
}

.apply-btn:hover {
  background: linear-gradient(135deg, #95b34a 0%, #85a341 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(168, 196, 91, 0.4);
}

/* Animation for details box when showing */
@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 196, 204, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(0, 196, 204, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 196, 204, 0);
  }
}

.details-box.showing {
  animation: slideDown 0.3s ease forwards, pulseGlow 1s ease 0.3s;
}
/* تحسينات للصور القابلة للنقر */
.program-gallery-image {
  cursor: pointer;
  transition: all 0.3s ease;
}

.program-gallery-image:hover {
  transform: scale(1.1);
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(168, 196, 91, 0.3);
}

/* تأثير عند النقر على الصورة */
.program-gallery-image:active {
  transform: scale(0.95);
}

/* تحسينات للصورة الرئيسية */
.program-main-image {
  transition: all 0.5s ease;
  cursor: pointer;
}

.program-main-image.updated {
  animation: imageUpdate 0.5s ease;
}

@keyframes imageUpdate {
  0% {
    opacity: 0.7;
    transform: scale(0.98);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
