/* Basic layout structure */
html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.d-flex {
  display: flex;
  flex: 1;
}

/* Sidebar main container */
.sidebar {
  width: 250px;
  flex-shrink: 0;
  background-color: #f8f9fa;
  display: flex;
  flex-direction: column;
  height: 100vh;
  transition: transform 0.3s ease;
  position: fixed;
  top: 0;
  left: 0;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  z-index: 1030;
}

/* Sidebar hidden state */
.sidebar-hidden {
  transform: translateX(-100%);
}

/* Sticky sidebar header */
.sidebar-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #f8f9fa;
  padding: 1rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #dee2e6;
  min-height: 56px;
}

.sidebar-title {
  color: #001738;
  font-size: 1.25rem;
}

/* Scrollable sidebar body */
.sidebar-body {
  flex-grow: 1;
  overflow-y: auto;
  scrollbar-width: thin;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.sidebar-body::-webkit-scrollbar {
  width: 5px;
}

.sidebar-body::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.sidebar-body::-webkit-scrollbar-thumb {
  background: #888;
}

/* Sticky sidebar footer */
.sidebar-footer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  background-color: #f8f9fa;
  border-top: 1px solid #dee2e6;
  min-height: 56px;
  transition: transform 0.3s ease, visibility 0.3s ease;
  display: flex;
  align-items: center;
  padding: 1rem 0;
}

/* Active link styling */
.sidebar .nav-link.active {
  color: #001738;
  font-weight: 500;
  background-color: rgba(13, 110, 253, 0.1);
}

.sidebar .nav-link:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Content area - Modify to handle both cases */
.content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 0px);
  transition: margin-left 0.3s ease, max-width 0.3s ease;
  width: 100%;
}

/* Only apply sidebar margin for logged-in users with sidebar */
.sidebar ~ .content-wrapper {
  margin-left: 250px;
  max-width: calc(100vw - 250px);
}

/* Non-sidebar layout - center content */
body:not(:has(.sidebar)) .content-wrapper {
  margin-left: auto;
  margin-right: auto;
  max-width: 1200px; /* Or your preferred max width */
}

.container {
  flex: 1 0 auto;
  margin: 0 auto;
  width: 100%;
  padding: 1rem;
}

/* Main footer */
.footer {
  margin-top: auto;
  width: 100%;
  background-color: #f8f9fa;
  /* border-top: 1px solid #dee2e6; */
  padding: 0.25rem 0;
  min-height: 56px;
  align-items: center;
}

/* Consistent padding for both footers */
.footer .container-fluid,
.sidebar-footer .p-3 {
  padding: 0 1rem !important;
}

/* Floating sidebar toggle button - now at top  right */
.sidebar-float-toggle {
  position: fixed;
  right: 10px;
  top: 10px;
  z-index: 1040;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Show floating button only when sidebar is hidden */
.sidebar-hidden + .content-wrapper .sidebar-float-toggle,
.sidebar-hidden ~ .sidebar-float-toggle {
  opacity: 1;
  visibility: visible;
}

/* Responsive behavior - improve mobile view */
@media (max-width: 991px) {
  .content-wrapper {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    max-width: 100%; /* Full width on mobile */
  }
  
  /* Fix sidebar relationship on mobile */
  .sidebar ~ .content-wrapper {
    margin-left: 0;
    max-width: 100%;
  }
  
  /* Add padding for better mobile readability */
  .container {
    padding: 1rem 15px;
  }
} 