/* =========================================================
   Inline Styles Replacement
   جميع الأنماط التي كانت inline تم نقلها هنا
   ========================================================= */

/* Main catalog pages - margin-top:0 */
.mx-catalog {
  margin-top: 0;
}

/* Search result content - font-size */
.search-result-content,
.single-content.small-text {
  font-size: 0.9rem;
}

/* Grid spacing - margin-top */
.index-grid {
  margin-top: 12px;
}

/* Page head spacing */
.page-head {
  margin: 16px 0 12px;
}

/* Small text with color */
.small-text-muted {
  font-size: 0.9em;
  color: #6b7280;
}

/* Spacing for post thumbnails */
.post-thumbnail-wrapper {
  margin-bottom: 24px;
}

/* Centered text */
.text-center {
  text-align: center;
}

/* Centered flex */
.flex-center {
  justify-content: center;
}

/* Search autocomplete styles (for JavaScript) */
.mx-autocomplete-item-title {
  font-weight: 700;
  margin-bottom: 4px;
  color: #1f2937;
}

.mx-autocomplete-item-type {
  font-size: 0.85rem;
  color: #6b7280;
}

/* Post thumbnail image */
.post-thumbnail-image {
  width: 100%;
  height: auto;
  border-radius: 12px;
}

/* Hero Icon Styles - مخفية */
.mx-block__media--icon {
  display: none !important;
}

.mx-hero-icon {
  display: none !important;
}

.mx-block__icon {
  display: none !important;
}

/* جعل النصوص في الوسط */
.mx-block__body.mx-block__body,
.mx-block__body {
  text-align: center !important;
  max-width: 900px !important;
  margin: 0 auto !important;
}

.mx-block__title {
  text-align: center !important;
  justify-content: center !important;
}

.mx-block__text {
  text-align: center !important;
}

@media (max-width: 768px) {
  .mx-block__media--icon {
    display: none !important;
  }
  .mx-hero-icon {
    display: none !important;
  }
  .mx-block__icon {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .mx-block__media--icon {
    display: none !important;
  }
  .mx-hero-icon {
    display: none !important;
  }
  .mx-block__icon {
    display: none !important;
  }
}

/* Search autocomplete container */
.mx-search,
.mx-search-wide,
.mx-search__wrapper,
.mx-search-wide__wrapper {
  position: relative;
}

.mx-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
  margin-top: 4px;
}

/* Search autocomplete item */
.mx-autocomplete-item {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: #1f2937;
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.2s;
}

.mx-autocomplete-item:hover,
.mx-autocomplete-item:focus {
  background-color: #f9fafb;
  outline: 2px solid #3b82f6;
  outline-offset: -2px;
}

.mx-autocomplete-item:last-child {
  border-bottom: none;
}

/* Focus states for interactive elements */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.mx-back-btn:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  background-color: #f3f4f6;
}

.mx-single-file:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.mx-single-related__item:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.mx-single-nav__item:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* =========================================================
   Fix for mx-section-separated buttons - إصلاح أزرار الروابط الخاصة والعامة
   ========================================================= */

/* إصلاح grid للأزرار في أقسام mx-section-separated */
.mx-section-separated .mx-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: clamp(12px, 2vw, 16px) !important;
  margin-top: 12px !important;
  align-items: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* الشاشات المتوسطة: 2 أزرار في السطر */
@media (max-width: 992px) and (min-width: 769px) {
  .mx-section-separated .mx-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* الشاشات الصغيرة: 2 أزرار في السطر */
@media (max-width: 768px) and (min-width: 481px) {
  .mx-section-separated .mx-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* الشاشات الصغيرة جداً: زر واحد في السطر */
@media (max-width: 480px) {
  .mx-section-separated .mx-grid {
    grid-template-columns: 1fr !important;
  }
}

/* إصلاح الأزرار في mx-section-separated */
.mx-section-separated .mx-grid .mx-mini {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 10px !important;
  padding: clamp(16px, 2.5vw, 22px) clamp(18px, 3vw, 24px) !important;
  min-height: 72px !important;
  height: auto !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
  font-size: clamp(0.95rem, 1.5vw, 1.05rem) !important;
  transition: transform .2s, box-shadow .2s, background .2s, color .2s, border-color .2s !important;
  border: 1px solid transparent !important;
  text-decoration: none !important;
  width: 100% !important;
  box-sizing: border-box !important;
  line-height: 1.5 !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  overflow: visible !important;
}

/* إصلاح النص في الأزرار */
.mx-section-separated .mx-grid .mx-mini .mx-mini__text {
  flex: 1 !important;
  min-width: 0 !important;
  line-height: 1.5 !important;
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  hyphens: auto !important;
  overflow: visible !important;
  text-overflow: clip !important;
  display: block !important;
  text-align: center !important;
  max-width: 100% !important;
  -webkit-line-clamp: unset !important;
  -webkit-box-orient: unset !important;
}

/* إصلاح الأيقونة */
.mx-section-separated .mx-grid .mx-mini .mx-mini__emoji {
  font-size: 1.3rem !important;
  line-height: 1 !important;
  flex-shrink: 0 !important;
}

/* =========================================================
   ألوان الأزرار حسب نوع الرابط - Colors based on link type
   ========================================================= */

/* الأزرار التي تنقل إلى الفروض - أزرق */
.mx-section-separated .mx-grid .mx-mini[href*="/devoirs/"] {
  background: var(--edu-blue, #1976d2) !important;
  color: #fff !important;
  border-color: var(--edu-blue, #1976d2) !important;
}

.mx-section-separated .mx-grid .mx-mini[href*="/devoirs/"]:hover {
  background: rgba(25, 118, 210, 0.10) !important;
  color: #0c3c71 !important;
  border-color: rgba(25, 118, 210, 0.25) !important;
  transform: translateY(-2px) !important;
}

/* الأزرار التي تنقل إلى الدروس - أخضر */
.mx-section-separated .mx-grid .mx-mini[href*="/lessons/"] {
  background: var(--edu-green, #2e7d32) !important;
  color: #fff !important;
  border-color: var(--edu-green, #2e7d32) !important;
}

.mx-section-separated .mx-grid .mx-mini[href*="/lessons/"]:hover {
  background: rgba(46, 125, 50, 0.10) !important;
  color: #14532d !important;
  border-color: rgba(46, 125, 50, 0.25) !important;
  transform: translateY(-2px) !important;
}

/* الأزرار التي تنقل إلى الامتحانات - برتقالي */
.mx-section-separated .mx-grid .mx-mini[href*="/exams/"] {
  background: var(--edu-orange, #ef6c00) !important;
  color: #fff !important;
  border-color: var(--edu-orange, #ef6c00) !important;
}

.mx-section-separated .mx-grid .mx-mini[href*="/exams/"]:hover {
  background: rgba(239, 108, 0, 0.10) !important;
  color: #5b2b00 !important;
  border-color: rgba(239, 108, 0, 0.25) !important;
  transform: translateY(-2px) !important;
}

