/* 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 - Glass pane overlay style */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  background-color: rgba(248, 249, 250, 0.98);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 24px);
  transition: transform 0.3s ease;
  position: fixed;
  top: 12px;
  left: 12px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 1030;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

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

/* Sticky sidebar header */
.sidebar-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: rgba(248, 249, 250, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #dee2e6;
  min-height: 56px;
  border-radius: 16px 16px 0 0;
}

.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: rgba(248, 249, 250, 0.95);
  backdrop-filter: blur(10px);
  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;
  border-radius: 0 0 16px 16px;
}

/* 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 - Push mode (shifts when sidebar visible) */
.content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 0px);
  width: calc(100% - 304px); /* Full width minus sidebar and gap */
  margin-left: 304px; /* 280px sidebar + 24px gap */
  transition: margin-left 0.3s ease, width 0.3s ease, filter 0.3s ease;
}

/* Full width when sidebar is hidden */
.sidebar-hidden ~ .content-wrapper {
  margin-left: 0;
  width: 100%;
}

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

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

/* Main footer - matches sidebar style */
.footer {
  margin-top: auto;
  width: 100%;
  background-color: rgba(248, 249, 250, 0.95);
  backdrop-filter: blur(10px);
  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 */
.sidebar-float-toggle {
  position: fixed;
  z-index: 1040;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

/* Desktop: top-left position */
@media (min-width: 992px) {
  .sidebar-float-toggle {
    left: 20px;
    top: 20px;
  }
}

/* Mobile: top-right position */
@media (max-width: 991px) {
  .sidebar-float-toggle {
    right: 10px;
    top: 10px;
  }
}

/* Backdrop overlay - only visible on mobile */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1025;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Only show backdrop on mobile when sidebar is visible */
@media (max-width: 991px) {
  .sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
  }
}

/* Never show backdrop on desktop */
@media (min-width: 992px) {
  .sidebar-backdrop {
    display: none;
  }
}

/* Responsive behavior - mobile adjustments */
@media (max-width: 991px) {
  /* Mobile uses overlay mode - no content shift */
  .content-wrapper {
    width: 100%;
    max-width: 100%;
    margin-left: 0 !important;
  }

  .container {
    padding: 1rem 15px;
  }

  /* Adjust sidebar margins on mobile */
  .sidebar {
    left: 8px;
    top: 8px;
    height: calc(100vh - 16px);
    width: min(280px, calc(100vw - 16px));
  }
} 