/**
 * Dashboard Fix - Removes empty spaces and improves layout compatibility
 * This file fixes issues with dashboard layout, navbar, sidebar and footer
 */

/* Fix for empty space between navbar and main content */
.dashboard-main {
  margin-top: 70px !important; /* Match navbar height exactly */
  min-height: calc(100vh - 70px - 50px) !important; /* Navbar (70px) + Footer (50px) */
  padding-bottom: 20px !important; /* Add some padding at the bottom */
}

/* Ensure sidebar is positioned correctly */
.dashboard-sidebar {
  top: 70px !important; /* Match navbar height */
  height: calc(100vh - 70px) !important; /* Full height minus navbar */
}

/* Remove any additional margin/padding causing empty spaces */
.dashboard-section {
  padding: 0 !important;
  margin: 0 !important;
}

/* Fix for navbar positioning */
.dashboard-navbar {
  height: 70px !important;
}

/* Fix for footer positioning and styling */
.dashboard-footer {
  position: relative !important;
  height: auto !important;
  min-height: 50px !important;
  margin-top: 30px !important;
  border-top: 1px solid var(--border-color, #2a2f42) !important;
  background-color: var(--card-bg, #1e2130) !important;
}

/* Hide standard footer when dashboard footer is present */
body:has(.dashboard-footer) .footer,
body:has(.dashboard-footer) .main-footer {
  display: none !important;
}

/* Overrides for dark/light theme compatibility */
body.theme-dark .dashboard-main {
  background-color: #151823 !important;
}

body.theme-light .dashboard-main {
  background-color: #f8fafc !important;
}

body.theme-dark .dashboard-navbar {
  background-color: #1e2130 !important;
  border-bottom: 1px solid #2a2f42 !important;
}

body.theme-light .dashboard-navbar {
  background-color: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.theme-dark .dashboard-sidebar {
  background-color: #1e2130 !important;
  border-right: 1px solid #2a2f42 !important;
}

body.theme-light .dashboard-sidebar {
  background-color: #ffffff !important; 
  border-right: 1px solid #e2e8f0 !important;
}

body.theme-dark .dashboard-footer {
  background-color: #1e2130 !important;
  border-top: 1px solid #2a2f42 !important;
}

body.theme-light .dashboard-footer {
  background-color: #ffffff !important;
  border-top: 1px solid #e2e8f0 !important;
}

/* Fix for mobile responsiveness */
@media (max-width: 991.98px) {
  .dashboard-main {
    margin-left: 0 !important;
    width: 100% !important;
  }
  
  .dashboard-sidebar {
    transform: translateX(-100%) !important;
  }
  
  .dashboard-sidebar.show {
    transform: translateX(0) !important;
  }
}

/* Ensure consistent footer styling */
.dashboard-footer .footer-content {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  padding: 0 20px !important;
  width: 100% !important;
  max-width: 1200px !important;
}

/* Fix spacing and styles for dashboard sections */
.dashboard-content {
  margin-bottom: 0 !important;
}

.dashboard-header {
  margin-bottom: 20px !important;
}

/* Ensure sidebar header space aligns with navbar */
.sidebar-header-space {
  height: 0 !important; /* Remove extra space at the top of sidebar */
}