/* 
 * تصميم القائمة الجانبية للإدارة
 * تم تصميم هذا الملف خصيصًا للقائمة الجانبية في لوحة تحكم الإدارة
 */

/* تصميم القائمة الجانبية الأساسي */
.sidebar {
  background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  z-index: 40;
  overflow-y: auto;
  overflow-x: hidden;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

/* حالات القائمة الجانبية */
.sidebar-collapsed {
  width: 80px;
}

.sidebar-expanded {
  width: 280px;
}

/* تصميم شريط التمرير للقائمة الجانبية */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

/* تصميم شعار النظام */
.sidebar .logo-container {
  position: relative;
  overflow: hidden;
}

.sidebar .logo-container::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
}

/* تصميم عناصر القائمة */
.nav-item {
  transition: all 0.3s ease;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

.nav-item:before {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 0;
  background-color: #f59e0b; /* لون ثانوي */
  transition: width 0.3s ease;
}

.nav-item:hover:before {
  width: 4px;
}

.nav-item.active {
  background-color: rgba(255, 255, 255, 0.15);
  font-weight: 600;
  color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.nav-item.active:before {
  width: 4px;
  background-color: #f59e0b; /* لون ثانوي */
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  transform: translateY(-2px);
}

.nav-item i {
  transition: all 0.3s ease;
}

.nav-item:hover i {
  transform: scale(1.2);
  color: #f59e0b; /* لون ثانوي */
}

/* تصميم القوائم المنسدلة */
.orders-toggle, .reports-toggle {
  position: relative;
  cursor: pointer;
}

.orders-toggle .fa-chevron-down, .reports-toggle .fa-chevron-down {
  transition: transform 0.3s ease;
}

.orders-dropdown-menu, .reports-dropdown-menu {
  transition: all 0.3s ease;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  margin-top: 4px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.orders-dropdown-menu.hidden, .reports-dropdown-menu.hidden {
  display: none;
}

.orders-dropdown-menu:not(.hidden), .reports-dropdown-menu:not(.hidden) {
  max-height: 500px;
  opacity: 1;
  padding: 0.5rem;
  animation: slideDown 0.3s ease-out forwards;
}

@keyframes slideDown {
  from {
    max-height: 0;
    opacity: 0;
  }
  to {
    max-height: 500px;
    opacity: 1;
  }
}

.orders-dropdown-menu .nav-item, .reports-dropdown-menu .nav-item {
  margin-bottom: 2px;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
}

.orders-dropdown-menu .nav-item:hover, .reports-dropdown-menu .nav-item:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.orders-dropdown-menu .nav-item.active, .reports-dropdown-menu .nav-item.active,
.orders-dropdown-menu .nav-item.bg-indigo-700, .reports-dropdown-menu .nav-item.bg-indigo-700 {
  background-color: rgba(255, 255, 255, 0.2);
}

/* تدوير أيقونة السهم */
.rotate-180 {
  transform: rotate(180deg);
}

/* تصميم معلومات المستخدم */
.user-info {
  position: relative;
  overflow: hidden;
}

.user-info::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.user-avatar {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.user-avatar:hover {
  transform: scale(1.1);
}

.user-name {
  font-weight: 600;
  color: white;
}

.user-role {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
}

.logout-button {
  transition: all 0.3s ease;
}

.logout-button:hover {
  color: #ef4444;
  transform: translateX(-3px);
}

/* تصميم المحتوى الرئيسي */
.main-content {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: calc(100% - 280px);
  margin-right: 280px;
  min-height: 100vh;
  padding-bottom: 2rem;
  position: relative;
}

/* زر القائمة للجوال */
#mobileMenuButton {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 45;
  background-color: #4f46e5;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  display: none;
}

#mobileMenuButton:hover {
  background-color: #4338ca;
  transform: translateY(-2px);
}

/* طبقة التعتيم للجوال */
.overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(3px);
}

.overlay-open {
  opacity: 1;
  pointer-events: auto;
}

/* تصميم متجاوب */
@media (max-width: 1280px) {
  .sidebar-expanded {
    width: 260px;
  }

  .main-content {
    width: calc(100% - 260px);
    margin-right: 260px;
  }
}

@media (max-width: 1024px) {
  .sidebar-expanded {
    width: 240px;
  }

  .main-content {
    width: calc(100% - 240px);
    margin-right: 240px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 50;
    width: 280px !important;
  }

  .sidebar-open {
    transform: translateX(0);
  }

  .main-content {
    width: 100% !important;
    margin-right: 0 !important;
    padding-top: 60px;
  }

  #mobileMenuButton {
    display: flex;
  }
}

/* تأثيرات الانتقال */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

.slide-up {
  animation: slideInUp 0.5s ease-in-out;
}

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

@keyframes slideInUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* تأثيرات إضافية للقائمة الجانبية */
.sidebar-expanded .nav-item span {
  animation: fadeIn 0.5s ease-in-out;
}

.sidebar-collapsed .nav-item span {
  display: none;
}

.sidebar-collapsed .logo-text {
  display: none;
}

.sidebar-collapsed .user-info div {
  display: none;
}

.sidebar-collapsed .logout-button {
  margin-right: 0;
}

/* تأثير نبض للإشعارات */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.notification-badge {
  animation: pulse 2s infinite;
}
