/* ملف previous-programs.css - تصميم البرامج السابقة */
: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);
}

.previous-programs-page {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  min-height: 100vh;
  padding: 40px 20px;
  direction: rtl;
}

.page-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;
}

.page-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;
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
  transform: translateY(30px);
}

@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;
}

.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-images {
  margin-bottom: 25px;
}

.main-program-image {
  width: 60%;
  height: 400px;
  object-fit: cover;
  border-radius: var(--border-radius);
  margin-bottom: 15px;
  border: 3px solid var(--primary-color);
  transition: var(--transition);
}

.sub-images {
  flex-wrap: wrap;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 0;
}

.sub-program-image {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: var(--transition);
  cursor: pointer;
  flex-shrink: 0;
}

.sub-program-image:hover {
  transform: scale(1.1);
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(168, 196, 91, 0.3);
}

/* محتوى البرنامج */
.program-content {
  position: relative;
}

.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,
    rgba(168, 196, 91, 0.05),
    rgba(132, 180, 0, 0.08)
  );
  padding: 20px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
  border-right: 4px solid var(--primary-color);
}

.date-info {
  margin-bottom: 8px;
  font-size: 1rem;
  color: var(--dark-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-label {
  color: var(--primary-dark);
  font-weight: 600;
  min-width: 100px;
}

/* الروابط */
.pdf-download-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;
}

.pdf-download-link:hover {
  background: #c82333;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
  border-color: rgba(255, 255, 255, 0.3);
}

.disabled-registration-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #6c757d;
  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;
  cursor: not-allowed;
  opacity: 0.7;
}

.disabled-registration-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

/* شريط التمرير في المعرض */
.sub-images::-webkit-scrollbar {
  height: 8px;
}

.sub-images::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.sub-images::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

.sub-images::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* التجاوب */
@media (max-width: 768px) {
  .previous-programs-page {
    padding: 20px 15px;
  }

  .page-title {
    font-size: 2rem;
    margin-bottom: 30px;
  }

  .program-card {
    padding: 20px;
    margin-bottom: 20px;
  }

  .program-title {
    font-size: 1.5rem;
  }

  .main-program-image {
    height: 200px;
  }

  .sub-program-image {
    width: 100px;
    height: 70px;
  }

  .date-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .date-label {
    min-width: auto;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 1.7rem;
  }

  .program-card {
    padding: 15px;
  }

  .program-title {
    font-size: 1.3rem;
  }

  .main-program-image {
    height: 150px;
  }

  .sub-images {
    gap: 5px;
  }

  .sub-program-image {
    width: 80px;
    height: 60px;
  }

  .program-dates {
    padding: 15px;
  }

  .program-description {
    font-size: 1rem;
    text-align: right;
  }
}

/* حالة خاصة عندما لا توجد برامج */
.previous-programs-page: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);
}

/* تأثيرات التركيز للوصول */
.pdf-download-link:focus,
.disabled-registration-link:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* تحسينات إضافية */
.program-card {
  background: linear-gradient(135deg, #ffffff, #f8f9fa);
}

/* معرض الصور المتقدم */
.image-gallery {
  position: relative;
}

.main-image-container {
  position: relative;
  overflow: hidden;
}

.main-program-image {
  width: 99%;
  height: 500px;
  object-fit: cover;
  border-radius: var(--border-radius);
  margin-bottom: 15px;
  border: 3px solid var(--primary-color);
  transition: var(--transition);
  cursor: pointer;
}

/* Lightbox للمعرض */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  position: relative;
}

.lightbox-image {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  left: 0;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.5);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.lightbox-close:hover {
  background: var(--primary-color);
  transform: rotate(90deg);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  transform: translateY(-50%);
}

.lightbox-prev,
.lightbox-next {
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--primary-color);
  transform: scale(1.1);
}

/* تأثير التكبير عند المرور على الصور */
.sub-program-image {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: var(--transition);
  cursor: pointer;
  flex-shrink: 0;
}

.sub-program-image:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(168, 196, 91, 0.3);
  z-index: 10;
}

.sub-program-image.active {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(168, 196, 91, 0.5);
}

/* مؤشر التحميل */
.loading-spinner {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--primary-color);
  font-size: 2rem;
}

.loading .loading-spinner {
  display: block;
}
