/**
 * ملف CSS موحد للقائمة الجانبية
 * نظام طلبات الشحن
 * تم التحديث: 2023
 */

/* تصميم القائمة الجانبية */
.sidebar {
  background: #0a2056; /* azraq kahli (dark blue) */
  background: linear-gradient(135deg, #0a2056 0%, #1a3a7f 100%);
  box-shadow: 0 10px 25px -5px 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: 50;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
}

.sidebar-collapsed {
  width: 80px;
}

.sidebar-expanded {
  width: 280px;
}

/* شعار النظام */
.sidebar-logo {
  display: flex;
  align-items: center;
  padding: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

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

.sidebar-logo-icon {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 0.5rem;
  border-radius: 0.5rem;
  margin-left: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo-icon i {
  color: #ffc107;
  font-size: 1.25rem;
}

.sidebar-logo-text {
  font-weight: 700;
  font-size: 1.125rem;
  white-space: nowrap;
  color: white;
  transition: opacity 0.3s ease;
}

.sidebar-collapsed .sidebar-logo-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar-toggle {
  margin-right: auto;
  background-color: rgba(255, 255, 255, 0.05);
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
}

.sidebar-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

/* قائمة التنقل */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

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

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

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

/* عناصر القائمة */
.nav-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.nav-item:before {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: width 0.3s ease;
}

.nav-item:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.05);
}

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

.nav-item.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  font-weight: 600;
}

.nav-item.active:before {
  width: 4px;
  background-color: #ffc107;
}

.nav-item-icon {
  margin-left: 0.75rem;
  font-size: 1.125rem;
  width: 1.5rem;
  text-align: center;
}

.nav-item-text {
  white-space: nowrap;
  transition: opacity 0.3s ease;
}

.sidebar-collapsed .nav-item-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

/* قسم الترقية */
.sidebar-upgrade {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

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

.upgrade-container {
  background-color: rgba(79, 70, 229, 0.1);
  padding: 1rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.sidebar-collapsed .upgrade-container {
  padding: 0.5rem;
}

.upgrade-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.upgrade-icon {
  color: #ffc107;
  margin-left: 0.5rem;
}

.upgrade-title {
  font-weight: 700;
  color: white;
  white-space: nowrap;
  transition: opacity 0.3s ease;
}

.sidebar-collapsed .upgrade-title {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.upgrade-description {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.75rem;
  transition: opacity 0.3s ease;
}

.sidebar-collapsed .upgrade-description {
  opacity: 0;
  height: 0;
  overflow: hidden;
  margin: 0;
}

.upgrade-button {
  background: linear-gradient(90deg, #4f46e5 0%, #818cf8 100%);
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.upgrade-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
}

.upgrade-button-icon {
  margin-right: 0.5rem;
}

.sidebar-collapsed .upgrade-button {
  padding: 0.5rem;
}

.sidebar-collapsed .upgrade-button span {
  display: none;
}

/* معلومات المستخدم */
.sidebar-user {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

.user-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.75rem;
  color: white;
  font-size: 1.25rem;
}

.user-info {
  transition: opacity 0.3s ease;
}

.sidebar-collapsed .user-info {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

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

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

.user-logout {
  margin-right: auto;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
  cursor: pointer;
}

.user-logout:hover {
  color: white;
}

/* تأثيرات حركية */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-item {
  animation: fadeIn 0.3s ease forwards;
}

.nav-item:nth-child(1) { animation-delay: 0.05s; }
.nav-item:nth-child(2) { animation-delay: 0.1s; }
.nav-item:nth-child(3) { animation-delay: 0.15s; }
.nav-item:nth-child(4) { animation-delay: 0.2s; }
.nav-item:nth-child(5) { animation-delay: 0.25s; }
.nav-item:nth-child(6) { animation-delay: 0.3s; }

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

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(100%);
  }

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

  .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;
  }

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