/* ========================================
   Minimal Sidebar CSS - Bootstrap 4 Compatible
   Uses Bootstrap 4 List Group component
   ======================================== */

/* === CSS Variables === */
:root {
  --navbar-height: 64px;
  --sidebar-width: 240px;
}

/* === Base Body Padding === */
body {
  padding-top: var(--navbar-height);
}

/* === Fixed Navbar Height === */
#navbar,
.navbar {
  height: var(--navbar-height);
  min-height: var(--navbar-height);
}

/* === Main Content Offset === */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: calc(100vh - var(--navbar-height));
  padding: 1.5rem;
}

/* === Bootstrap 4 List Group Active State === */
/* Blue highlight for active navigation items */
.list-group-item.active {
  background-color: #E6F0FF;
  border-color: #E6F0FF;
  color: #0066FF;
  font-weight: 600;
}

/* === List Group Item Hover === */
.list-group-item-action:hover {
  background-color: #F3F4F6;
  color: #111827;
}

/* === Icon Alignment === */
.list-group-item i {
  width: 20px;
  text-align: center;
  opacity: 0.8;
}

.list-group-item:hover i,
.list-group-item.active i {
  opacity: 1;
}

/* === Responsive - Mobile (Modern Full-Screen Drawer) === */
@media (max-width: 767.98px) {
  #sidebar,
  .sidebar {
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1060;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
  }

  #sidebar.show,
  .sidebar.show {
    transform: translateX(0);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  }

  /* Add top padding to sidebar-nav for mobile header */
  #sidebar-nav {
    padding-top: 64px;
  }

  .main-content {
    margin-left: 0;
  }

  body {
    padding-top: 56px;
  }

  #navbar,
  .navbar {
    height: 56px;
    min-height: 56px;
  }
}

/* === Medium Screens === */
@media (min-width: 768px) and (max-width: 991px) {
  :root {
    --sidebar-width: 220px;
  }
}

/* === Large Screens === */
@media (min-width: 1400px) {
  :root {
    --sidebar-width: 260px;
  }
}

/* ========================================
   Sidebar Mobile Header - Modern Full-Screen Drawer
   ======================================== */

.sidebar-mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 10;
}

.sidebar-mobile-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.sidebar-brand-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  letter-spacing: -0.01em;
}

.sidebar-close-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 0.5rem;
  color: #6b7280;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-close-btn:hover {
  background: #f3f4f6;
  color: #111827;
}

.sidebar-close-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.sidebar-close-btn i {
  font-size: 1.25rem;
}

/* Backdrop z-index adjustment */
.sidebar-backdrop {
  z-index: 1055;
}

/* ========================================
   Unified Navigation - Accordion Style
   Mobile-first approach for drawer navigation
   ======================================== */

.unified-nav-accordion {
  padding: 1rem 0.75rem 0.5rem 0.75rem; /* Increased top padding for visual separation */
}

/* === Section Container === */
.nav-section {
  margin-bottom: 0.5rem;
}

/* === Section Header (Main Navigation) === */
.nav-section-header {
  display: flex;
  align-items: center;
  padding: 0.875rem 1rem;
  color: #111827;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: background-color 0.15s ease, color 0.15s ease;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-section-header:hover {
  background-color: #f3f4f6;
  color: #111827;
  text-decoration: none;
}

.nav-section-header:focus {
  outline: none;
}

.nav-section-header i:first-child {
  width: 24px;
  margin-right: 0.75rem;
  font-size: 1.125rem;
  opacity: 0.9;
}

/* VIP Badge Mini */
.vip-badge-mini {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  border-radius: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Section Chevron */
.section-chevron {
  font-size: 0.875rem;
  opacity: 0.6;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Rotate chevron when expanded */
.nav-section-header[aria-expanded="true"] .section-chevron {
  transform: rotate(180deg);
}

/* === Active Section === */
.nav-section.active .nav-section-header {
  background-color: #E6F0FF;
  color: #0066FF;
}

.nav-section.active .nav-section-header i {
  opacity: 1;
}

/* === Section Body (Sub-menu) === */
.nav-section-body {
  padding: 0.25rem 0 0.5rem 0;
}

.nav-section-body .nav-link {
  display: flex;
  align-items: center;
  padding: 0.625rem 1rem 0.625rem 3rem; /* Left indent for hierarchy */
  color: #6b7280;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
  text-decoration: none;
}

.nav-section-body .nav-link:hover {
  background-color: #f3f4f6;
  color: #111827;
  transform: translateX(2px);
}

.nav-section-body .nav-link.active {
  background-color: #E6F0FF;
  color: #0066FF;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.1);
}

.nav-section-body .nav-link i {
  width: 20px;
  margin-right: 0.75rem;
  opacity: 0.75;
  font-size: 0.875rem;
}

.nav-section-body .nav-link:hover i,
.nav-section-body .nav-link.active i {
  opacity: 1;
}

/* === Standalone Links (Community, Union) === */
.nav-section-standalone {
  padding: 0.5rem 0;
  border-top: 1px solid #e5e7eb;
  margin-top: 0.5rem;
}

.nav-link-standalone {
  display: flex;
  align-items: center;
  padding: 0.875rem 1rem;
  color: #111827;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: background-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
  margin-bottom: 0.25rem;
}

.nav-link-standalone:hover {
  background-color: #f3f4f6;
  color: #111827;
  text-decoration: none;
}

.nav-link-standalone i:first-child {
  width: 24px;
  margin-right: 0.75rem;
  font-size: 1.125rem;
  opacity: 0.9;
}

.nav-link-standalone:hover i:first-child {
  opacity: 1;
}

/* === Collapse Animation === */
.nav-section .collapse {
  transition: height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-section .collapsing {
  transition: height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Mobile-specific adjustments === */
@media (max-width: 767.98px) {
  .unified-nav-accordion {
    padding: 1rem 0.5rem 0.5rem 0.5rem; /* Keep top padding for visual separation from header */
  }

  .nav-section-header {
    padding: 1rem;
  }

  .nav-section-body .nav-link {
    padding: 0.75rem 1rem 0.75rem 3.25rem;
  }
}
