/* ============================================
   SIDEBAR.CSS - Collapsible Sidebar Navigation
   ============================================
   
   Features:
   - Collapsible vertical sidebar with smooth transitions
   - Icon-only collapsed state with tooltips
   - Responsive design for mobile
   - Accessibility focused with proper focus states
   - Uses the existing soft highlight color palette
*/

/* ==========================================
   SIDEBAR CONTAINER & LAYOUT
   ========================================== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 250px;
  background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
  border-right: 2px solid #6b7280;
  z-index: 1100;
  transition: all 0.3s ease;
  overflow: hidden;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.sidebar.collapsed {
  width: 60px;
}

/* Light theme override */
[data-theme="light"] .sidebar {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-right: 2px solid #e2e8f0;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.05);
}

/* Dark theme override - matches book panel colors */
[data-theme="dark"] .sidebar {
  background: #1a1a1a;
  border-right: 1px solid #2d2d2d;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .sidebar-header {
  background: #0f0f0f;
  border-bottom: 1px solid #2d2d2d;
}

[data-theme="light"] .sidebar-header {
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  background: transparent;
}

[data-theme=\"light\"] .sidebar-toggle {
  background: rgba(31, 41, 55, 0.1);
  color: #374151;
  box-shadow: none;
}

[data-theme=\"light\"] .sidebar-toggle:hover {
  background: rgba(31, 41, 55, 0.15);
  box-shadow: none;
}

[data-theme="light"] .sidebar-logo {
  color: #1f2937;
}

[data-theme="light"] .sidebar-logo:hover {
  color: #3b82f6;
}

[data-theme="light"] .logo-icon {
  color: #374151;
}

[data-theme="light"] .logo-text {
  color: #1f2937;
}

[data-theme="light"] .sidebar-item {
  color: #1f2937;
}

[data-theme="light"] .sidebar-text {
  color: #1f2937;
  font-weight: 500;
}

[data-theme="light"] .sidebar-icon {
  color: #374151;
}

[data-theme="light"] .sidebar-link::before {
  background: linear-gradient(135deg, 
    rgba(124, 58, 237, 0.12), 
    rgba(139, 92, 246, 0.08));
}

[data-theme="light"] .sidebar-link:hover {
  color: #1f2937;
  background: rgba(124, 58, 237, 0.08);
  box-shadow: none;
}

[data-theme="light"] .sidebar-link:hover .sidebar-icon {
  color: #7c3aed;
}

[data-theme="light"] .sidebar-link:hover .sidebar-text {
  color: #5b21b6;
}

[data-theme="light"] .sidebar-item:not(.sidebar-link):hover {
  background: rgba(124, 58, 237, 0.08);
  color: #5b21b6;
}

[data-theme="light"] .sidebar-item:focus {
  outline: 2px solid #3b82f6;
}

[data-theme="light"] .sidebar.collapsed .sidebar-item::after {
  background: #1f2937;
  color: white;
}

[data-theme="light"] .sidebar-profile {
  border-top: 1px solid rgba(226, 232, 240, 0.8);
}

[data-theme="light"] .profile-item {
  background: transparent;
  border: none;
}

[data-theme="light"] .profile-item:hover {
  background: rgba(124, 58, 237, 0.08);
  color: #5b21b6;
}

[data-theme="light"] .profile-name {
  color: #1f2937;
}

[data-theme="light"] .logout-item {
  color: #d97706;
}

[data-theme="light"] .logout-item:hover {
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
}

[data-theme="light"] .sidebar-footer {
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

/* Main content wrapper - sidebar now overlays instead of shifting content */
.main-wrapper {
  min-height: 100vh;
  padding: 0;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

/* Tablet-specific content adjustment - sidebar hidden by mobile-bottom-nav.css */
@media (min-width: 768px) and (max-width: 1366px) {
  .main-wrapper {
    margin-left: 0;
    transition: margin-left 0.3s ease;
  }
  
  .main-wrapper.sidebar-collapsed {
    margin-left: 0;
  }
}

/* Desktop 1367px+ - Sidebar visible, content shifts */
@media (min-width: 1367px) {
  .main-wrapper {
    margin-left: 250px;
    transition: margin-left 0.3s ease;
  }
  
  .main-wrapper.sidebar-collapsed {
    margin-left: 60px;
  }
}

/* Ensure body doesn't have margin/padding conflicts */
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* ==========================================
   SIDEBAR TOGGLE BUTTON & HEADER
   ========================================== */

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(107, 114, 128, 0.3);
  background: transparent;
}

.sidebar-toggle {
  background: rgba(75, 85, 99, 0.3);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: none;
  z-index: 1101;
}

.sidebar-toggle:hover {
  background: rgba(75, 85, 99, 0.5);
  transform: none;
  box-shadow: none;
}

.sidebar-toggle:focus {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

/* Arrow icon rotation based on sidebar state */
.sidebar-arrow {
  transition: transform 0.3s ease;
}

/* When sidebar is collapsed, rotate arrow to point right */
.sidebar.collapsed .sidebar-arrow {
  transform: rotate(180deg);
}

/* ==========================================
   SIDEBAR CONTENT
   ========================================== */

.sidebar-content {
  padding: 0.5rem 0 1rem 0;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ==========================================
   BIBLIATECH LOGO IN HEADER
   ========================================== */

.sidebar-logo {
  display: flex;
  align-items: center;
  color: #e2e8f0;
  text-decoration: none;
  transition: all 0.4s ease-in-out;
  position: relative;
  overflow: hidden;
}

.sidebar-logo:hover {
  text-decoration: none;
}

.sidebar-logo:hover .logo-icon {
  /* No animation - keep logo static */
}

.sidebar-logo:hover .logo-text {
  background: linear-gradient(135deg, #3b82f6, #1e40af);
  -webkit-background-clip: text;
  background-clip: text;
  font-weight: 600;
}

.logo-icon {
  width: 36px;
  height: 36px;
  margin-right: 0;
  transition: all 0.4s ease-in-out;
}

/* Theme-aware logo icons */
.logo-icon-light {
  display: block;
}

.logo-icon-dark {
  display: none;
}

[data-theme="dark"] .logo-icon-light {
  display: none;
}

[data-theme="dark"] .logo-icon-dark {
  display: block;
}

.logo-text {
  display: none;
}

/* Collapsed state - logo stays the same size */
.sidebar.collapsed .logo-icon {
  margin-right: 0;
}

/* ==========================================
   SIDEBAR ITEMS WITH ENHANCED HOVER
   ========================================== */

.sidebar-item {
  display: flex;
  align-items: center;
  padding: 0.625rem 0.875rem;
  margin: 1px 0.5rem;
  color: #cbd5e0;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
}

/* Enhanced hover effects for sidebar links - ChatGPT/BibliaTech style */
.sidebar-link {
  position: relative;
  overflow: hidden;
}

.sidebar-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(124, 58, 237, 0.12);
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: -1;
  border-radius: 8px;
}

.sidebar-link:hover::before {
  opacity: 1;
}

.sidebar-link:hover {
  color: #f1f5f9;
  text-decoration: none;
  transform: none;
  box-shadow: none;
}

.sidebar-link:hover .sidebar-icon {
  transform: scale(1.05);
  color: #a78bfa;
}

.sidebar-link:hover .sidebar-text {
  color: #f1f5f9;
  font-weight: 500;
  opacity: 1;
  visibility: visible;
}

/* Legacy hover for non-link items */
.sidebar-item:not(.sidebar-link):hover {
  background: rgba(124, 58, 237, 0.12);
  color: #f1f5f9;
  text-decoration: none;
  transform: none;
  box-shadow: none;
}

/* Dark mode sidebar hover - light grey instead of lavender */
[data-theme="dark"] .sidebar-link::before {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .sidebar-link:hover .sidebar-icon {
  color: #e5e7eb;
}

[data-theme="dark"] .sidebar-link:hover .sidebar-text {
  color: #f3f4f6;
}

[data-theme="dark"] .sidebar-item:not(.sidebar-link):hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f3f4f6;
}

.sidebar-item:focus {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

/* ==========================================
   SIDEBAR ICONS & TEXT
   ========================================== */

.sidebar-icon {
  min-width: 20px;
  min-height: 20px;
  margin-right: 0.75rem;
  transition: all 0.3s ease;
}

.sidebar-text {
  white-space: nowrap;
  transition: all 0.3s ease;
  font-weight: 500;
  opacity: 1;
  visibility: visible;
}

/* Collapsed state - hide text */
.sidebar.collapsed .sidebar-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
  visibility: hidden;
}

.sidebar.collapsed .sidebar-icon {
  margin-right: 0;
}

.sidebar.collapsed .sidebar-item {
  justify-content: center;
  padding: 0.75rem;
}

/* ==========================================
   TOOLTIPS FOR COLLAPSED STATE
   ========================================== */

.sidebar.collapsed .sidebar-item::after {
  content: attr(title);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  background: #1e293b;
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  margin-left: 0.5rem;
  z-index: 1002;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sidebar.collapsed .sidebar-item::before {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: #1e293b;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  margin-left: 0.25rem;
  z-index: 1002;
}

.sidebar.collapsed .sidebar-item:hover::after,
.sidebar.collapsed .sidebar-item:hover::before {
  opacity: 1;
  visibility: visible;
}

/* ==========================================
   PROFILE SECTION
   ========================================== */

.sidebar-profile {
  margin-top: auto;
  border-top: 1px solid rgba(107, 114, 128, 0.3);
  padding-top: 0.5rem;
}

[data-theme="light"] .sidebar-profile {
  border-top: 1px solid rgba(226, 232, 240, 0.8);
}

.profile-item {
  background: transparent;
  border: none;
  margin-bottom: 0.125rem;
}

.profile-item:hover {
  background: rgba(124, 58, 237, 0.12);
  color: #f1f5f9;
}

[data-theme="light"] .profile-item:hover {
  background: rgba(124, 58, 237, 0.08);
  color: #5b21b6;
}

.profile-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.75rem;
}

.profile-image {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-name {
  font-weight: 600;
  color: #000000 !important;
}

[data-theme="light"] .profile-name {
  color: #000000 !important;
}

[data-theme="dark"] .profile-name {
  color: #e2e8f0;
}

.logout-item {
  color: #f59e0b;
  font-size: 0.9rem;
}

.logout-item:hover {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

[data-theme="light"] .logout-item {
  color: #d97706;
}

[data-theme="light"] .logout-item:hover {
  background: rgba(217, 119, 6, 0.08);
  color: #d97706;
}

/* Collapsed profile state */
.sidebar.collapsed .profile-avatar {
  margin-right: 0;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

/* Mobile/Tablet screens under 1367px - Sidebar slides in from left when opened */
@media (max-width: 1366px) {
  /* Sidebar slides in/out on mobile instead of being hidden */
  .sidebar {
    position: fixed !important;
    top: 60px !important; /* Below top navbar */
    left: 0 !important;
    width: 280px !important;
    height: calc(100vh - 60px) !important;
    transform: translateX(-100%);
    z-index: 10001 !important; /* Above top navbar */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex !important;
    flex-direction: column !important;
  }
  
  /* Show sidebar when mobile-open class is added */
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  
  /* Hide any mobile menu toggle inside sidebar (the one in top-navbar should stay visible) */
  .sidebar .mobile-menu-toggle {
    display: none !important;
  }
  
  /* IMPORTANT: Ensure top-navbar hamburger is always visible on mobile */
  .top-navbar .mobile-menu-toggle {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  /* Adjust main wrapper for full-width content */
  .main-wrapper {
    margin-left: 0 !important;
    padding-left: 0 !important;
    width: 100% !important;
  }

  /* Hide desktop-only profile section and theme toggle on mobile (replaced by mobile-sidebar-actions) */
  .sidebar-profile,
  .sidebar-footer .theme-toggle-container,
  .sidebar-footer #loginProfileItem {
    display: none !important;
  }
  
  /* Keep sidebar footer visible for mobile actions */
  .sidebar-footer {
    display: flex !important;
    flex-direction: column !important;
  }
}

/* Desktop screens - Keep desktop functionality */
@media (min-width: 1367px) {
  /* Hide mobile hamburger menu on desktop */
  .mobile-menu-toggle {
    display: none !important;
  }

  /* Keep normal sidebar functionality */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
  }

  .sidebar.collapsed {
    width: 60px;
  }
}

/* Removed: old (min-width: 1025px) block - now unified in (min-width: 1367px) above */

/* ==========================================
   ACCESSIBILITY ENHANCEMENTS
   ========================================== */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .main-wrapper,
  .sidebar-item,
  .sidebar-toggle {
    transition: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .sidebar {
    border-right: 3px solid;
  }

  .sidebar-item {
    border: 1px solid transparent;
  }

  .sidebar-item:hover,
  .sidebar-item:focus {
    border-color: currentColor;
  }
}

/* Focus indicator for keyboard navigation */
.sidebar-item:focus-visible {
  outline: 3px solid #60a5fa;
  outline-offset: 2px;
}

/* ==========================================
   ANIMATION STATES
   ========================================== */

/* Loading state for dynamic content */
.sidebar-item.loading {
  opacity: 0.6;
  pointer-events: none;
}

.sidebar-item.loading .sidebar-icon {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Gradient shimmer animation for logo */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Glow pulse animation */
@keyframes glow-pulse {
  0%, 100% { 
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
  }
  50% { 
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.6),
                0 0 35px rgba(37, 99, 235, 0.4);
  }
}

/* Subtle breathing animation for logo */
@keyframes logo-breathe {
  0%, 100% { 
    transform: scale(1);
    opacity: 0.9;
  }
  50% { 
    transform: scale(1.02);
    opacity: 1;
  }
}

.sidebar-logo:not(:hover) {
  /* Removed breathing animation for cleaner look */
}

/* Enhanced logo hover animation */
.sidebar-logo:hover {
  opacity: 0.9;
}

/* Smooth scale transition for icon on hover - no bouncing */
.sidebar-link:hover .sidebar-icon {
  /* Scale handled in main hover styles */
}

/* Active state for current page - using lavender theme */
.sidebar-item.active {
  background: rgba(124, 58, 237, 0.15);
  font-weight: 600;
}

.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #7c3aed;
  border-radius: 0 3px 3px 0;
}

/* Dark mode active state - grey instead of lavender */
[data-theme="dark"] .sidebar-item.active {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .sidebar-item.active::before {
  background: #9ca3af;
}

[data-theme="dark"] .sidebar-item.active .sidebar-icon,
[data-theme="dark"] .sidebar-item.active .sidebar-text {
  color: #f3f4f6;
}

/* Light theme active state */
[data-theme="light"] .sidebar-item.active {
  background: rgba(124, 58, 237, 0.1);
}

[data-theme="light"] .sidebar-item.active .sidebar-icon,
[data-theme="light"] .sidebar-item.active .sidebar-text {
  color: #7c3aed;
}

/* Remove shimmer effect for cleaner look */
.sidebar-link:hover .sidebar-text {
  /* Clean hover without animations */
}

/* ==========================================
   SIDEBAR FOOTER
   ========================================== */

.sidebar-footer {
  margin-top: auto;
  padding: 0.75rem;
  border-top: 1px solid rgba(107, 114, 128, 0.3);
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Light theme footer */
[data-theme="light"] .sidebar-footer {
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  background: transparent;
}

/* Profile section in footer */
.sidebar-footer .sidebar-profile {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

/* Theme toggle container in footer */
.sidebar-footer .theme-toggle-container {
  margin-top: 0.25rem;
  padding-top: 0.25rem;
  border-top: 1px solid rgba(107, 114, 128, 0.2);
}

[data-theme="light"] .sidebar-footer .theme-toggle-container {
  border-top: 1px solid rgba(226, 232, 240, 0.6);
}

/* ==========================================
   MOBILE-ONLY SIDEBAR ACTIONS
   ========================================== */

/* Hidden by default on all devices */
.mobile-sidebar-actions {
  display: none !important;
}

/* Show on mobile/tablet devices (under 1367px) when sidebar is open */
@media (max-width: 1366px) {
  .sidebar.mobile-open .mobile-sidebar-actions {
    display: flex !important;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(107, 114, 128, 0.3);
  }
  
  [data-theme="light"] .sidebar.mobile-open .mobile-sidebar-actions {
    border-top-color: rgba(226, 232, 240, 0.8);
  }
  
  /* Mobile login button styling */
  .mobile-sidebar-login,
  .mobile-sidebar-theme {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
  }
  
  .mobile-sidebar-login:hover,
  .mobile-sidebar-login:active,
  .mobile-sidebar-theme:hover,
  .mobile-sidebar-theme:active {
    background: rgba(59, 130, 246, 0.2);
    transform: translateX(4px);
  }
  
  [data-theme="dark"] .mobile-sidebar-login,
  [data-theme="dark"] .mobile-sidebar-theme {
    background: rgba(99, 102, 241, 0.15);
    color: #e2e8f0;
  }
  
  [data-theme="dark"] .mobile-sidebar-login:hover,
  [data-theme="dark"] .mobile-sidebar-login:active,
  [data-theme="dark"] .mobile-sidebar-theme:hover,
  [data-theme="dark"] .mobile-sidebar-theme:active,
  [data-theme="dark"] .mobile-sidebar-profile:hover,
  [data-theme="dark"] .mobile-sidebar-profile:active {
    background: rgba(99, 102, 241, 0.25);
  }
  
  /* Mobile logout button - special styling */
  .mobile-sidebar-logout {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    width: 100%;
    font-size: 0.95rem;
  }
  
  .mobile-sidebar-logout:hover,
  .mobile-sidebar-logout:active {
    background: rgba(239, 68, 68, 0.2);
    transform: translateX(4px);
    text-decoration: none;
    color: #dc2626;
  }
  
  [data-theme="dark"] .mobile-sidebar-logout {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
  }
  
  [data-theme="dark"] .mobile-sidebar-logout:hover,
  [data-theme="dark"] .mobile-sidebar-logout:active {
    background: rgba(239, 68, 68, 0.25);
    color: #f87171;
  }
  
  /* Mobile profile button styling */
  .mobile-sidebar-profile {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
  }
  
  .mobile-sidebar-profile:hover,
  .mobile-sidebar-profile:active {
    background: rgba(59, 130, 246, 0.2);
    transform: translateX(4px);
  }
  
  [data-theme="dark"] .mobile-sidebar-profile {
    background: rgba(99, 102, 241, 0.15);
    color: #e2e8f0;
  }
  
  /* Theme toggle icon visibility based on current theme */
  .mobile-sidebar-theme .theme-icon-dark,
  .mobile-sidebar-theme .theme-text-dark {
    display: none;
  }
  
  .mobile-sidebar-theme .theme-icon-light,
  .mobile-sidebar-theme .theme-text-light {
    display: block;
  }
  
  [data-theme="dark"] .mobile-sidebar-theme .theme-icon-dark,
  [data-theme="dark"] .mobile-sidebar-theme .theme-text-dark {
    display: block;
  }
  
  [data-theme="dark"] .mobile-sidebar-theme .theme-icon-light,
  [data-theme="dark"] .mobile-sidebar-theme .theme-text-light {
    display: none;
  }
  
  /* Ensure sidebar text is visible in mobile sidebar actions */
  .mobile-sidebar-actions .sidebar-text {
    display: inline !important;
    opacity: 1 !important;
  }
}

/* Ensure mobile sidebar actions are hidden on desktop */
@media (min-width: 1367px) {
  .mobile-sidebar-actions {
    display: none !important;
  }
}

/* ==========================================
   MOBILE SIDEBAR OVERLAY
   ========================================== */

/* Body class when mobile sidebar is open */
body.mobile-sidebar-open::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000; /* Below sidebar but above everything else */
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Only show overlay on mobile/tablet (hide on desktop) */
@media (min-width: 1367px) {
  body.mobile-sidebar-open::before {
    display: none;
  }
}

/* Mobile sidebar additional styles */
@media (max-width: 1366px) {
  /* Ensure sidebar text is always visible on mobile (not collapsed) */
  .sidebar.mobile-open .sidebar-text {
    display: inline !important;
    opacity: 1 !important;
    width: auto !important;
    margin-left: 0.75rem;
  }
  
  /* Ensure collapsed state is overridden on mobile */
  .sidebar.mobile-open.collapsed .sidebar-text {
    display: inline !important;
    opacity: 1 !important;
    width: auto !important;
  }
  
  /* Ensure sidebar content is scrollable on mobile */
  .sidebar.mobile-open .sidebar-content {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
  }
  
  /* Mobile sidebar footer styling */
  .sidebar.mobile-open .sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(107, 114, 128, 0.3);
    background: rgba(0, 0, 0, 0.1);
  }
  
  [data-theme="light"] .sidebar.mobile-open .sidebar-footer {
    background: rgba(0, 0, 0, 0.03);
  }
}
