/* ✅ إعدادات أساسية */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background-color: #edf3f8;
  font-family: 'Tajawal', sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
html {
  overflow-y: scroll;
    overflow-x: hidden; /* يمنع السكرول العرضي */

}

html::-webkit-scrollbar {
  width: 3px;
}

html::-webkit-scrollbar-thumb {
  background-color: #23190c;
  border-radius: 3px;
}

/* ✅ السايدبار */
#sidebar {
  width: 280px;
  min-height: 100vh;
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1040;
  transition: all 0.3s ease;
}

/* ✅ المحتوى */
#mainContent {
  transition: all 0.3s ease;
  margin-top: 64px;
  margin-right: 280px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ✅ إخفاء السايدبار على الشاشات العريضة */
.sidebar-hidden #sidebar {
  display: none;
}
.sidebar-hidden #mainContent {
  margin-right: 0 !important;
  width: 100% !important;
}

/* ✅ مربع البحث */
.search-wrapper {
  width: 100%;
  max-width: 100%;
  background: #e3ebf2;
  border-radius: 40px;
  padding: 0.6rem 1.2rem;
  margin-bottom: 30px;
}
.search-wrapper input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  text-align: right;
  font-size: 15px;
  color: #333;
}



/* ✅ تنسيق البطاقة */
.category-box a.card {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 0.5rem;
  overflow: hidden;
  transition: transform 0.3s ease;
  height: 100%;
  background: transparent !important;
  box-shadow: none !important;
}
.category-box a.card:hover {
  transform: scale(1.02);
}

.category-box .card-img-top {
  width: 100%;
  aspect-ratio: 1 / 1; /* ✅ يجعل الصورة مربعة دائمًا */
  object-fit: cover;
  display: block;
  border-radius: 0.5rem 0.5rem 0 0;
}


.category-box .card-body {
  padding: 10px 5px 5px 5px;
  margin: 0;
  text-align: center;
  background: transparent !important;
}

.category-box .card-title {
  color: #23190c;
  font-size: 1.1rem;
  font-weight: bold;
  margin: 0;
  text-shadow: none;
  background: transparent !important;
}

.category-box {
  height: auto;
}
/* ✅ الموبايل */
@media (max-width: 768px) {
  #sidebar {
    right: -280px;
  }

  .sidebar-visible #sidebar {
    right: 0;
  }

  #mainContent {
    margin-right: 0 !important;
  }

  /* الهيدر */
  .bg-dark {
    right: 0 !important;
  }
}


/* ✅ الهيدر */
.bg-dark {
  background-color: #23190c
 !important;
  height: 64px;
  place-content: center;
  position: fixed;
  top: 0;
  right: 280px;
  left: 0;
  z-index: 1030;
  transition: all 0.3s ease;
}
.sidebar-hidden .bg-dark {
  right: 0;
}

.bg-darks {
  background-color: #082c49 !important;
}
.bg-warning {
  background-color: #ffa900 !important;
}
 .logo-link {
    display: inline-block;
  }


  .logo-link:hover {
    transform: scale(1.02);
  }
/* ✅ محتوى الصفحة */
#mainContent {
  transition: all 0.3s ease;
  margin-top: 64px;
  margin-right: 280px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.sidebar-hidden #mainContent {
  margin-right: 0 !important;
  width: 100% !important;
}

.card {
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease;
}
.card:hover {
  transform: scale(1.02);
}

img {
  max-width: 100%;
  height: auto;
}

/* ✅ الأزرار */
.btn-light {
  color: #004c45;
  font-weight: bold;
}

.btn-success {
  background-color: #23190c !important;
  border-color: #fff !important;
  color: white !important;
  font-weight: bold;
}

.btn-success:hover {
  background-color: #fff !important;
  border-color: #092643 !important;
  color: black !important;
}

.btn-success:focus,
.btn-success:active,
.btn-success:focus:active {
  background-color: #23190c !important;
  color: white !important;
  border-color: #fff !important;
  box-shadow: none !important;
  outline: none !important;
}

/* ✅ التنقل */
#sidebar .nav-link {
  text-align: right;
  direction: rtl;
  color: #082c49;
}
#sidebar .nav-link:hover {
  background-color: #f0f0f0;
  border-radius: 6px;
}
.nav-link.active {
  background-color: #f1f1f1;
  border-radius: 10px;
}

.logout-hover:hover {
  background-color: #f8d7da !important;
  transition: background-color 0.2s;
}

hr {
  border-color: #e0e0e0;
  opacity: 0.75;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #333;
  transition: background-color 0.3s, transform 0.2s;
  text-decoration: none;
  background-color: transparent;
}
.icon-btn:hover {
  background-color: rgba(0,0,0,0.1);
  transform: scale(1.1);
}
.icon-btn.text-danger {
  color: #ff4757;
}

.logout-hover:hover {
  background-color: #ffe6e6 !important;
}

/* ✅ الموبايل */
@media (max-width: 768px) {
  #sidebar {
    right: -280px;
    left: auto;
    top: 0;
    position: fixed;
    z-index: 1050;
    height: 100%;
  }
  .sidebar-visible #sidebar {
    right: 0;
  }
  .bg-dark {
    right: 0;
  }
  #mainContent {
    margin-right: 0 !important;
  }
}

/* ✅ الفوتر دائمًا أسفل الصفحة */
footer .footer-flex {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  flex-direction: row;
}

@media (max-width: 576px) {
  footer .footer-flex {
    flex-wrap: wrap;
    text-align: center;
    gap: 2px;
  }
}


/* ✅ اللودر */
    #loader-overlay {
      position: fixed;
      width: 100%;
      height: 100%;
      background: rgba(255, 255, 255, 0.58);
      top: 0;
      left: 0;
      z-index: 9999;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .loader-wrapper {
      position: relative;
      width: 100px;
      height: 100px;
    }

    .loader-logo {
      width: 60px;
      height: 60px;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      border-radius: 50%;
    }

    .spinner-ring {
      width: 100px;
      height: 100px;
      border: 6px solid #23190c;
      border-top-color: transparent;
      border-radius: 50%;
      animation: spin 1s linear infinite;
      box-sizing: border-box;
    }

    @keyframes spin {
      to {
        transform: rotate(360deg);
      }
    }
#sidebar {
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;           /* فايرفوكس */
  -ms-overflow-style: none;        /* إنترنت إكسبلورر/إيدج القديم */
}

#sidebar::-webkit-scrollbar {
  display: none;                   /* كروم، سفاري، أوبرا */
}
