/* تحسينات إضافية للتصنيفات على الأجهزة المحمولة */
@media (max-width: 768px) {
  a.navbar-brand {
    font-size: 14px !important;
    padding: 0px !important;
  }
  [lang="en"] a.navbar-brand {
    font-size: 14px !important;
  }
  [lang="ar"] ul.navbar-nav.me-auto {
    padding-right: 0px;
    position: relative;
    right: -20px;
  }

  .news-ticker-wrapper {
    animation: ticker-scroll 10s linear infinite;
  }
  .news-card img {
    height: 150px;
  }
  .sp-recent {
    display: none;
  }
  .sp-title-bar {
    text-align: center;
    width: 90%;
    right: unset;
  }
  .sp-title-bar > div:first-child {
    margin: auto;
  }
  .sp-title-bar div.wellcome p {
    font-size: 16px;
  }
  .col-4 {
    width: 100%;
  }
  
  /* إضافة دعم لعرض المستندات على الموبايل */
  .document-viewer {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .document-viewer iframe, 
  .document-viewer embed {
    width: 100%;
    min-width: 300px;
    height: auto;
    min-height: 400px;
  }
  
  .sidebar-post-item.mb-3.loogo {
        text-align: center;
        display: block;
    }
    .loogo.sidebar-post-item img {
        width: 100%;
        height: auto;
        border-radius: 20px;
        margin: 50px 0px 10px;
    }
    .currency-rates-home {
      padding: 3px 1px;
      margin-bottom: 5px !important;
    }
    .currency-name-home {
    font-size: 12px;
    }
}

/* تنسيق المقالات كبطاقات في الشاشات الكبيرة */
@media (min-width: 992px) {
  .sidebar-posts-container {
    display: flex;
    flex-wrap: wrap;
    margin: -5px;
  }

  .sidebar-post-item {
    flex: 0 0 calc(50% - 10px);
    margin: 5px;
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
  }

  .sidebar-post-item .row {
    flex-direction: column;
  }

  .sidebar-post-image,
  .sidebar-post-content {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
  }

  .sidebar-post-image {
    margin-bottom: 10px;
  }

  .sidebar-post-image img {
    width: 100%;
    height: 170px;
    object-fit: cover;
  }
}

/* تنسيق خاص للشاشات الكبيرة جداً */
@media (min-width: 920px) {
  .container {
    display: flex !important;
  }
  .row.sp-row {
    justify-content: space-between;
  }
  .row.sp-row .col-lg-4 {
    flex: 0 0 auto;
    width: 29%;
    text-align: center;
  }
  :not(.sp-recent) .sidebar-post-item {
    flex: unset;
  }
  :not(.sp-recent) .sidebar-post-item .row {
    flex-direction: column;
    align-items: center;
  }
  :not(.sp-recent) .sidebar-post-item h6 {
    font-size: 1.3rem;
  }
  :not(.sp-recent) .sidebar-post-item .col-8,
  :not(.sp-recent) .sidebar-post-item .col-4 {
    flex: 0 0 auto;
    width: 100%;
  }
}

/* تحسينات للشاشات الصغيرة جداً */
@media (max-width: 480px) {
  .categories-list {
    padding: 0 5px;
  }
  
  .category-link {
    font-size: 12px;
    padding: 6px 12px;
    min-width: 60px;
    text-align: center;
  }
}
