/* Sidebar Responsive Styles */

/* === Layout Adjustments === */
body.has-sidebar {
  padding-left: 0;
}

/* Header and content margin */
.header {
  padding: 15px 20px;
  background-color: #f4f4f4;
  color: #000;
  margin-left: 80px;
  transition: margin-left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), background-color 0.3s ease, color 0.3s ease;
}

html.dark-mode .header {
  background-color: #2a2a2a;
  color: #fff;
}

#content {
  margin-left: 80px;
  padding: 20px;
  background-color: #fff;
  color: #000;
  transition: margin-left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), background-color 0.3s ease, color 0.3s ease;
}

html.dark-mode #content {
  background-color: #1a1a1a;
  color: #fff;
}

/* Ensure content doesn't go under sidebar on any page */
.page-content,
.main-content {
  margin-left: 80px;
  transition: margin-left 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* === Mobile Responsiveness === */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 280px;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.15);
  }
  
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  
  .header,
  #content,
  .page-content,
  .main-content {
    margin-left: 0;
  }
  
  .mobile-sidebar-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #8bc34a, #7ab82d);
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(139, 195, 74, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .mobile-sidebar-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(139, 195, 74, 0.4);
  }
  
  .mobile-sidebar-toggle:active {
    transform: scale(0.95);
  }
}

@media (min-width: 769px) {
  .mobile-sidebar-toggle {
    display: none;
  }
}

/* === Reduced Motion Support === */
@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .nav-item,
  .nav-icon,
  .nav-label,
  .search-input,
  .profile-info,
  .toggle-slider::before {
    transition: none;
  }
}
