/**
 * شهادة التعليم المتوسط - تنسيقات محسنة
 */

/* تنسيقات عامة للصفحة */
.middle-school-certificate-page {
  font-family: "DroidKufi-Regular", Arial, sans-serif;
  padding: 2rem 0;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  min-height: 100vh;
}

.middle-school-certificate-page .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* تنسيقات رأس الصفحة */
.middle-school-certificate-page .page-header {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.middle-school-certificate-page .main-title {
  font-size: 2.5rem;
  color: #fff;
  background: linear-gradient(135deg, #1a56db, #0e4392);
  padding: 1.5rem 2rem;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 1rem;
  position: relative;
  box-shadow: 0 10px 25px rgba(14, 67, 146, 0.3);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.middle-school-certificate-page .main-title::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shine 3s infinite;
}

.middle-school-certificate-page .page-description {
  font-size: 1.2rem;
  color: #475569;
  max-width: 800px;
  margin: 0 auto;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

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

.middle-school-year-card {
  background-color: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
  border: 1px solid rgba(59, 130, 246, 0.1);
}

.middle-school-year-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.middle-school-year-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 4px;
  background: linear-gradient(to bottom, #3b82f6, #1d4ed8);
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
}

/* تنسيقات رأس بطاقة السنة */
.year-header {
  display: flex;
  align-items: center;
  padding: 2rem;
  background: linear-gradient(135deg, #f0f7ff, #e6f0fd);
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  position: relative;
}

.year-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 1.5rem;
  box-shadow: 0 6px 15px rgba(29, 78, 216, 0.3);
}

.year-icon span {
  color: #fff;
  font-size: 1.6rem;
  font-weight: bold;
}

.year-title {
  font-size: 2rem;
  color: #1e40af;
  margin: 0;
  flex-grow: 1;
}

.latest-badge {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: bold;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

/* تنسيقات حاويات الدورات */
.sessions-container {
  padding: 2rem;
}

.session-card {
  background-color: #f9fafb;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.session-card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.session-title {
  font-size: 1.5rem;
  color: #1e40af;
  margin-top: 0;
  margin-bottom: 2rem;
  padding-right: 1rem;
  border-right: 4px solid #3b82f6;
  position: relative;
}

/* تنسيقات شبكة المواد المحسنة */
.subjects-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
  gap: 1.5rem !important;
  margin-top: 2rem !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.subject-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important;
  transition: all 0.3s ease !important;
  border: 2px solid transparent !important;
  position: relative !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.subject-card:hover {
  transform: translateY(-5px) !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
  border-color: var(--subject-color, #3b82f6) !important;
}

.subject-header {
  display: flex !important;
  align-items: center !important;
  padding: 1.5rem !important;
  background: linear-gradient(135deg, var(--subject-color, #3b82f6), rgba(var(--subject-color, #3b82f6), 0.8)) !important;
  color: white !important;
  position: relative !important;
}

.subject-icon {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 1rem;
  backdrop-filter: blur(10px);
}

.subject-name {
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  margin: 0 !important;
  flex-grow: 1 !important;
}

.subject-content {
  padding: 1.5rem !important;
  background: white !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.subject-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 8px;
}

.subject-level {
  font-size: 0.85rem;
  color: #64748b;
  background: rgba(59, 130, 246, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.subject-year {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--subject-color, #3b82f6);
}

.subject-actions {
  display: flex !important;
  gap: 0.75rem !important;
  justify-content: center !important;
}

.action-btn {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  padding: 0.75rem 1rem !important;
  border-radius: 8px !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  border: none !important;
  flex: 1 !important;
  justify-content: center !important;
}

.preview-btn {
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
  color: white !important;
}

.preview-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

.download-btn {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: white !important;
}

.download-btn:hover {
  background: linear-gradient(135deg, #059669, #047857) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

.action-btn:disabled {
  background: #94a3b8 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* رسالة قريباً */
.coming-soon-message {
  text-align: center;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-radius: 12px;
  margin: 2rem 0;
  border: 2px solid #f59e0b;
}

.coming-soon-message p {
  font-size: 1.2rem;
  color: #92400e;
  margin: 0;
  font-weight: 600;
}

/* تأثيرات متحركة */
@keyframes shine {
  0% {
    left: -100%;
  }
  20% {
    left: 100%;
  }
  100% {
    left: 100%;
  }
}

/* تنسيقات للأجهزة المحمولة */
@media (max-width: 768px) {
  .middle-school-certificate-page .main-title {
    font-size: 1.8rem;
    padding: 1rem 1.5rem;
  }

  .year-header {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }

  .year-icon {
    margin-left: 0;
    margin-bottom: 1rem;
  }

  .year-title {
    font-size: 1.5rem;
    margin-top: 0.5rem;
  }

  .subjects-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    gap: 1rem !important;
  }

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

  .action-btn {
    flex: none !important;
  }
}

@media (max-width: 480px) {
  .subjects-grid {
    grid-template-columns: 1fr !important;
  }

  .year-icon {
    width: 60px;
    height: 60px;
  }

  .year-icon span {
    font-size: 1.4rem;
  }
}

/* تنسيقات خاصة للسنة الأحدث */
.latest-year {
  position: relative;
  border: 2px solid #10b981 !important;
}

.latest-year::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.2);
  border-radius: 16px;
  pointer-events: none;
}

.latest-year .year-header {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
}

/* تنسيقات Toast للإشعارات */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  color: white;
  font-size: 0.9rem;
  max-width: 350px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}

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

.toast.success {
  background: linear-gradient(135deg, #10b981, #059669);
}

.toast.error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.toast.info {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}
