/* Custom CSS to enhance sidebar behavior in fluid layout */

/* Ensure proper flex layout for sidebar and main content */
.app-wrapper {
  display: flex !important;
  flex-direction: row !important;
  min-height: 100vh;
}

/* Sidebar should be a flex column taking defined width */
.app-sidebar {
  flex: 0 0 var(--lte-sidebar-width, 250px) !important;
  height: auto !important;
  position: relative !important;
  background-color: var(--lte-sidebar-bg, var(--bs-light)) !important;
}

/* Sidebar wrapper should accommodate content */
.sidebar-wrapper {
  overflow-y: auto;
  max-height: calc(100vh - 3.5rem); /* Subtract brand header height */
  padding-bottom: 20px;
}

/* Main content should take remaining space */
.app-main {
  flex: 1 !important;
  min-width: 0 !important; /* Allows flex item to shrink below content size */
  min-height: 100vh;
}

/* For better scrolling experience on touch devices */
.app-sidebar::-webkit-scrollbar {
  width: 6px;
}

.app-sidebar::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.2);
  border-radius: 3px;
}

.app-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.3);
}

/* On smaller screens, make sidebar collapsible */
@media (max-width: 991.98px) {
  .app-wrapper {
    flex-direction: column !important;
  }

  .app-sidebar {
    flex: 1 1 100% !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    z-index: 1037 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s ease-in-out !important;
  }

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

  .app-main {
    flex: 1 1 100% !important;
    margin-left: 0 !important;
  }
}

/* Handle sidebar collapse state */
.sidebar-collapse .app-sidebar {
  flex: 0 0 var(--lte-sidebar-mini-width, 4rem) !important;
}

.sidebar-collapse .app-main {
  margin-left: 0 !important;
}

/* Custom colors for campus reports in dashboard */
.campus-bg-nluc {
  background-color: green !important;
}

.campus-bg-mluc {
  background-color: maroon !important;
}

.campus-bg-sluc {
  background-color: blue !important;
}

/* Alternative: If we need to target by parent class */
.campus-nluc .flex-shrink-0 div:first-child {
  background-color: green !important;
}

.campus-mluc .flex-shrink-0 div:first-child {
  background-color: maroon !important;
}

.campus-sluc .flex-shrink-0 div:first-child {
  background-color: blue !important;
}