/* ===== MODERN SIDEBAR STYLES ===== */

/* تأكد من أن القائمة تظهر بشكل صحيح عند التحميل */
.sidebar-modern:not(.collapsed) {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateX(0) !important;
  width: 280px !important;
}

/* إجبار ظهور القائمة عند التحميل */
.sidebar-modern {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateX(0) !important;
}

/* منع إخفاء القائمة إلا عند الضغط على الزر */
.sidebar-modern.collapsed:not(.user-collapsed) {
  width: 280px !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateX(0) !important;
}

/* إجبار ظهور القائمة عند التحميل */
.sidebar-modern {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateX(0) !important;
}

/* تحسين الانتقالات */
.sidebar-modern {
  width: 280px;
  height: 100vh;
  background: #2c3e50; /* Dark blue-gray */
  color: #ecf0f1;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: 0;
  transition: width 0.3s ease-in-out, transform 0.3s ease-in-out, opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
  overflow-y: hidden; /* Changed from auto */
  z-index: 1000;
  box-shadow: -2px 0 10px rgba(0,0,0,0.1);
  opacity: 1;
  visibility: visible;
}

.sidebar-modern.collapsed {
  width: 0;
  overflow: hidden;
  transform: translateX(100%);
  opacity: 0;
  visibility: hidden;
}

/* منع إخفاء القائمة إلا عند الضغط على الزر */
.sidebar-modern.collapsed:not(.user-collapsed) {
  width: 280px !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateX(0) !important;
}

.main-content {
  margin-right: 280px; /* Same as sidebar width */
  transition: margin-right 0.3s ease-in-out;
  min-height: 100vh;
  position: relative;
}

.main-content.collapsed {
  margin-right: 0;
}

.sidebar-toggle {
  position: absolute;
  top: 15px;
  left: -15px;
  width: 30px;
  height: 30px;
  background: #34495e;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.sidebar-toggle:hover {
  background: #4a627a;
  transform: scale(1.1);
}

.sidebar-toggle i {
  transition: transform 0.3s ease;
}

.sidebar-modern.collapsed .sidebar-toggle i {
  transform: rotate(180deg);
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid #34495e;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e67e22 0%, #f39c12 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.user-details h6 {
  margin: 0;
  font-weight: bold;
  font-size: 16px;
  color: #ecf0f1;
}

.user-details span {
  font-size: 12px;
  color: #bdc3c7;
}

.quick-stats {
  display: flex;
  justify-content: space-around;
  margin-top: 15px;
  text-align: center;
}

.stat-item .number {
  font-size: 18px;
  font-weight: bold;
  display: block;
  color: #3498db;
}

.stat-item .label {
  font-size: 11px;
  color: #bdc3c7;
}

.search-section {
  padding: 15px 20px;
}

.search-box {
  position: relative;
}

.search-box input {
  width: 100%;
  background: #34495e;
  border: 1px solid #4a627a;
  border-radius: 5px;
  color: white;
  padding: 8px 30px 8px 10px;
}

.search-box i {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 10px;
  color: #bdc3c7;
}

.sidebar-content {
  flex-grow: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 20px;
}

.sidebar-menu {
  flex-grow: 1;
  overflow-y: visible; /* Let the parent handle scrolling */
  padding: 0 20px;
}

.menu-section {
  margin-bottom: 10px;
}

.menu-header {
  display: flex;
  align-items: center;
  padding: 12px 10px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
  user-select: none;
  position: relative;
}

.menu-header:hover {
  background: #34495e;
  transform: translateX(-2px);
}

.menu-header.active {
  background: #3498db;
  color: white;
}

.menu-header i:first-child {
  margin-left: 10px;
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.menu-header span {
  flex-grow: 1;
  font-weight: 500;
}

.menu-header .fa-chevron-down,
.menu-header .fa-chevron-up {
  margin-right: 0;
  margin-left: auto;
  transition: transform 0.3s ease;
  font-size: 12px;
}

.menu-items {
  padding-right: 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-in-out, opacity 0.3s ease;
  opacity: 0;
}

.menu-items.show {
  max-height: 1000px;
  opacity: 1;
}

.menu-item {
  display: flex;
  align-items: center;
  color: #bdc3c7;
  padding: 10px 15px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.3s ease;
  margin-bottom: 2px;
  position: relative;
}

.menu-item:hover,
.menu-item.hover {
  background: linear-gradient(135deg, #e67e22 0%, #f39c12 100%);
  color: white;
  text-decoration: none;
  transform: translateX(-3px);
  box-shadow: 0 2px 8px rgba(230, 126, 34, 0.3);
}

.menu-item.active {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
  font-weight: 600;
}

.menu-item i {
  margin-left: 10px;
  width: 20px;
  text-align: center;
  font-size: 14px;
}

.menu-item span {
  flex-grow: 1;
}

.filter-section, .notifications-section {
  padding: 20px;
  border-top: 1px solid #34495e;
}

.filter-group {
  margin-bottom: 15px;
}

.filter-group label {
  font-size: 12px;
  margin-bottom: 5px;
  display: block;
}

.date-range {
  display: flex;
  gap: 10px;
}

.filter-presets {
  display: flex;
  gap: 5px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.filter-preset {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-preset:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.filter-preset.active {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.4);
}

#notifications-container {
  max-height: none; /* Let parent handle height */
  overflow-y: visible; /* Let parent handle scrolling */
}

.theme-switcher {
  padding: 15px 20px;
  border-top: 1px solid #34495e;
  margin-top: auto; /* Pushes it to the bottom */
}

.theme-switcher .form-check-label {
  color: #bdc3c7;
  cursor: pointer;
}

.theme-switcher .form-check-input {
  cursor: pointer;
}

/* Logout Button Styles */
.logout-section {
  padding: 15px 20px;
  border-top: 1px solid #34495e;
}

.logout-btn {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: #e74c3c;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.2);
  font-weight: 500;
  width: 100%;
  justify-content: center;
  gap: 8px;
}

.logout-btn:hover {
  background: rgba(231, 76, 60, 0.2);
  color: #c0392b;
  border-color: rgba(231, 76, 60, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(231, 76, 60, 0.2);
  text-decoration: none;
}

.logout-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

.logout-btn i {
  font-size: 16px;
}

.logout-btn span {
  font-size: 14px;
}

/* Dark theme adjustments for logout button */
[data-theme="dark"] .logout-btn {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
  border-color: rgba(255, 107, 107, 0.2);
}

[data-theme="dark"] .logout-btn:hover {
  background: rgba(255, 107, 107, 0.2);
  color: #ff5252;
  border-color: rgba(255, 107, 107, 0.4);
  box-shadow: 0 4px 8px rgba(255, 107, 107, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
  .sidebar-modern {
    width: 100%;
    transform: translateX(100%);
  }
  
  .sidebar-modern:not(.collapsed) {
    transform: translateX(0);
  }
  
  .main-content {
    margin-right: 0;
  }
  
  .sidebar-toggle {
    left: -45px;
    width: 40px;
    height: 40px;
  }
}

/* Smooth scrollbar for sidebar */
.sidebar-content::-webkit-scrollbar {
  width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: #2c3e50;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background: #4a627a;
  border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
  background: #5a7a9a;
}


