/**
 * شهادة البكالوريا - جميع السنوات
 *
 * @package DzExams
 */

/* تنسيقات عامة للصفحة */
.baccalaureate-all-years-page {
  font-family: "Tajawal", Arial, sans-serif;
  direction: rtl;
  color: #333;
  background-color: #f5f7fa;
  padding: 2rem 0;
}

.baccalaureate-all-years-page .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* عنوان الصفحة */
.page-header {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

.header-banner {
  background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
  padding: 2rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.page-title {
  color: #fff;
  font-size: 2.2rem;
  margin: 0;
  font-weight: 700;
  text-align: center;
}

.page-description {
  font-size: 1.1rem;
  color: #666;
  max-width: 800px;
  margin: 0 auto;
}

/* شريط البحث والتصفية */
.search-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  background-color: #fff;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.search-box {
  flex: 1;
  display: flex;
  position: relative;
  min-width: 250px;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem;
  padding-left: 3rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
}

.search-box button {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3rem;
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-box button:hover {
  color: #207cca;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  padding: 0.75rem 1.25rem;
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.filter-btn:hover {
  background-color: #e0e3e9;
}

.filter-btn.active {
  background-color: #4a90e2;
  color: #fff;
  border-color: #4a90e2;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(74, 144, 226, 0.3);
}

/* تصفية السنوات */
.years-filter {
  margin-bottom: 2rem;
  background-color: #fff;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.years-filter-title {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  color: #333;
}

.years-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.year-btn {
  padding: 0.5rem 0.75rem;
  background-color: #f0f2f5;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.year-btn:hover {
  background-color: #e0e3e9;
}

.year-btn.active {
  background-color: #207cca;
  color: #fff;
}

/* بطاقات السنوات */
.years-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.year-card {
  background-color: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 2px solid #e9ecef;
}

.year-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-color: #4a90e2;
}

.year-card.latest-year {
  border: 2px solid #28a745;
  position: relative;
}

.year-header {
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e7eb 100%);
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
}

.year-title-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.year-title {
  margin: 0;
  font-size: 1.5rem;
  color: #333;
}

.latest-badge {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.year-badge {
  background-color: #207cca;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: bold;
  font-size: 1.2rem;
}

/* Estilo para el mensaje "próximamente" */
.coming-soon-message {
  text-align: center;
  padding: 30px;
  background-color: #f8f9fa;
  border-radius: 8px;
  margin: 20px 0;
  font-size: 18px;
  color: #6c757d;
  border: 1px dashed #dee2e6;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 150px;
}

.coming-soon-message p {
  font-weight: bold;
  font-size: 20px;
}

/* تبويبات الشعب */
.streams-tabs {
  padding: 1.5rem;
}

.tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 1rem;
}

.tab-btn {
  padding: 0.75rem 1.25rem;
  background-color: #f0f2f5;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background-color: #e0e3e9;
}

.tab-btn.active {
  background-color: #207cca;
  color: #fff;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block !important;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* قسم الدورة */
.session-section {
  margin-bottom: 1.5rem;
}

.session-title {
  font-size: 1.2rem;
  margin-top: 0;
  margin-bottom: 1rem;
  color: #555;
  border-right: 3px solid #207cca;
  padding-right: 0.75rem;
}

/* شبكة المواد - مهم جداً لظهور البطاقات */
.subjects-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 1rem;
}

/* بطاقة المادة - مهم جداً لظهور البطاقات */
.subject-card {
  background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
  border-radius: 6px;
  padding: 0.75rem;
  display: flex !important;
  flex-direction: column;
  transition: all 0.3s ease;
  border: 1px solid #b3d9ff;
  position: relative;
  overflow: hidden;
  min-height: 85px;
  box-shadow: 0 2px 6px rgba(74, 144, 226, 0.1);
}

/* معلومات المادة */
.subject-info {
  margin-bottom: 0.5rem;
  flex-grow: 1;
}

.subject-name {
  display: block !important;
  font-weight: bold;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  color: #2c5282;
  line-height: 1.2;
}

.subject-stream {
  display: block !important;
  font-size: 0.7rem;
  color: #4a90e2;
  background-color: rgba(74, 144, 226, 0.1);
  padding: 0.15rem 0.3rem;
  border-radius: 3px;
  display: inline-block;
  font-weight: 500;
}

/* أزرار التحميل والمعاينة */
.subject-actions {
  display: flex !important;
  gap: 0.3rem;
  margin-top: auto;
}

.preview-btn,
.download-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
  flex: 1;
  text-align: center;
}

.preview-btn {
  background-color: #4a90e2;
  color: white;
  border: none;
}

.preview-btn:hover {
  background-color: #357abd;
  transform: translateY(-1px);
  color: white;
  text-decoration: none;
}

.download-btn {
  background-color: #28a745;
  color: white;
  border: none;
}

.download-btn:hover {
  background-color: #218838;
  transform: translateY(-1px);
  color: white;
  text-decoration: none;
}

/* نافذة معاينة PDF */
.pdf-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.pdf-modal-content {
  background-color: white;
  width: 90%;
  max-width: 1000px;
  height: 90%;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.pdf-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: #2c3e50;
  color: white;
}

.pdf-modal-title {
  margin: 0;
  font-size: 1.2rem;
}

.pdf-modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.pdf-modal-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.pdf-container {
  flex: 1;
  overflow: hidden;
}

.pdf-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* زر العودة للأعلى */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: #207cca;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 100;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: #1a6cb0;
  transform: translateY(-3px);
}

/* رسائل النجاح والخطأ */
.toast {
  position: fixed;
  bottom: 20px;
  left: 20px;
  padding: 1rem 1.5rem;
  border-radius: 6px;
  color: white;
  font-size: 1rem;
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: 300px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background-color: #4caf50;
}

.toast.error {
  background-color: #f44336;
}

/* تصميم متجاوب */
@media (max-width: 768px) {
  .search-filter-bar {
    flex-direction: column;
  }

  .subjects-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.4rem;
  }

  .subject-card {
    padding: 0.6rem;
    min-height: 80px;
  }

  .subject-name {
    font-size: 0.85rem;
  }

  .subject-stream {
    font-size: 0.65rem;
  }

  .tabs-nav {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
  }

  .tab-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .year-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .year-badge {
    align-self: flex-end;
  }

  .years-buttons {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 0.5rem;
  }

  .subject-actions {
    flex-direction: column !important;
    gap: 0.3rem;
  }

  .preview-btn,
  .download-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 1.5rem;
  }

  .year-title {
    font-size: 1.2rem;
  }

  .back-to-top {
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
  }

  .subjects-grid {
    grid-template-columns: 1fr !important;
  }

  .subject-card {
    padding: 0.6rem;
    min-height: 75px;
  }

  .subject-actions {
    flex-direction: column !important;
    gap: 0.25rem;
  }

  .preview-btn,
  .download-btn {
    width: 100%;
    justify-content: center;
    padding: 0.4rem;
    font-size: 0.7rem;
  }
}

/* إصلاحات إضافية لضمان ظهور البطاقات */
.tab-pane.active .subjects-grid {
  display: grid !important;
}

.tab-pane.active .subject-card {
  display: flex !important;
}

/* تأكد من ظهور المحتوى */
.streams-tabs .tabs-content {
  min-height: 200px;
}

.session-section {
  display: block !important;
}

.subjects-grid .subject-card {
  opacity: 1 !important;
  visibility: visible !important;
}

/* الوضع المخفي (الأخضر) */
.hidden-mode {
  /* تغيير الألوان الرئيسية */
  --primary-color: #00a67d;
  --primary-hover: #008f6b;
  --secondary-color: #e8f5f0;
  --accent-color: #4caf50;
  --text-color: #00a67d;
  --border-color: #e0f2e9;
  --card-bg: #ffffff;
  --header-bg: #00a67d;
  --download-btn-bg: #ffebee;
  --download-btn-color: #e57373;
  --download-btn-hover: #ffcdd2;
  --preview-btn-bg: #e3f2fd;
  --preview-btn-color: #64b5f6;
  --preview-btn-hover: #bbdefb;
}

.hidden-mode .header-banner {
  background: var(--header-bg);
}

.hidden-mode .year-badge {
  background-color: var(--header-bg);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hidden-mode .latest-badge {
  background-color: #ffffff;
  color: var(--primary-color);
}

.hidden-mode .tab-btn.active {
  background-color: transparent;
  color: var(--primary-color);
  border-bottom: 3px solid var(--primary-color);
  border-radius: 0;
}

.hidden-mode .session-title {
  border-right-color: var(--primary-color);
  color: var(--primary-color);
}

.hidden-mode .download-btn {
  background-color: var(--download-btn-bg);
  color: var(--download-btn-color);
}

.hidden-mode .download-btn:hover {
  background-color: var(--download-btn-hover);
}

.hidden-mode .preview-btn {
  background-color: var(--preview-btn-bg);
  color: var(--preview-btn-color);
}

.hidden-mode .preview-btn:hover {
  background-color: var(--preview-btn-hover);
}

.hidden-mode .filter-btn.active {
  background-color: var(--primary-color);
}

.hidden-mode .year-btn.active {
  background-color: var(--primary-color);
}

.hidden-mode .back-to-top {
  background-color: var(--primary-color);
}

.hidden-mode .back-to-top:hover {
  background-color: var(--primary-hover);
}

/* زر تبديل الوضع */
.theme-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  transform: rotate(30deg);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.hidden-mode .theme-toggle {
  background-color: var(--primary-color);
  color: white;
}

.subject-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  border-color: #4a90e2;
}

.subject-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4a90e2, #28a745, #dc3545, #6f42c1);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.subject-card:hover::before {
  opacity: 1;
}
