/* Bootstrap Layout Enhancements */
/* Ensure minimum full height layout */
html, body {
  min-height: 100%;
  height: auto;
}

/* Sticky navbar */
.navbar.sticky-top {
  position: sticky !important;
  top: 0 !important;
  z-index: 1020 !important;
}

/* Unified Sidebar using Bootstrap's offcanvas with responsive behavior */
@media (min-width: 992px) {
  .sidebar.sidebar-responsive {
    position: static !important;
    transform: none !important;
    visibility: visible !important;
    width: 280px !important;
    flex: 0 0 280px;
    max-width: 280px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    z-index: auto !important;
  }
  .sidebar.sidebar-responsive .offcanvas-header {
    display: none !important;
  }
  .sidebar.sidebar-responsive .offcanvas-body {
    padding: 0;
    overflow-y: visible;
  }
}
@media (max-width: 991px) {
  .sidebar.sidebar-responsive {
    width: 280px !important;
    max-width: 85vw !important;
  }
}

/* Sidebar navigation container */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  height: 100%;
}
@media (min-width: 992px) {
  .sidebar-nav {
    position: sticky;
    top: 56px; /* Height of navbar */
    max-height: calc(100vh - 4rem);
  }
}

/* Sidebar sticky positioning */
.sidebar-sticky {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
@media (min-width: 992px) {
  .sidebar-sticky {
    min-height: calc(100vh - 4rem);
  }
}

/* Sidebar content scrollable area */
.sidebar-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 0;
}

/* Sidebar footer sticky at bottom */
.sidebar-footer {
  flex-shrink: 0;
  margin-top: auto;
  background-color: inherit;
  padding-top: 0.5rem;
}

/* Page wrapper for proper layout */
body > .d-flex.flex-column.min-vh-100 {
  min-height: 100vh;
}

/* Container and row layout for proper sidebar/content flow */
body .container-fluid.flex-grow-1 {
  padding: 0;
}
body .container-fluid.flex-grow-1 > .row {
  margin: 0;
}
@media (min-width: 992px) {
  body .container-fluid.flex-grow-1 > .row {
    flex-wrap: nowrap; /* Prevent wrapping on desktop */
    height: 100%;
  }
}

/* Ensure proper scrolling behavior */
.container-fluid.flex-grow-1 {
  overflow: visible !important;
}
.container-fluid.flex-grow-1 .row {
  align-items: flex-start !important;
}
.container-fluid.flex-grow-1 main {
  align-self: flex-start !important;
}

/* Sidebar navigation links */
.sidebar-nav .nav-link {
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}
.sidebar-nav .nav-link:hover:not(.disabled) {
  background-color: rgba(255, 255, 255, 0.1);
}
.sidebar-nav .nav-link.active {
  background-color: rgba(255, 255, 255, 0.2);
  border-left: 3px solid #FFCD00;
  font-weight: 600;
}
.sidebar-nav .nav-link.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Collapsible sidebar section styling */
.sidebar-nav [data-bs-toggle=collapse] {
  cursor: pointer;
  text-decoration: none;
  padding: 0.75rem 1rem;
}
.sidebar-nav [data-bs-toggle=collapse]:hover {
  background-color: rgba(255, 255, 255, 0.1);
}
.sidebar-nav [data-bs-toggle=collapse] {
  /* Chevron rotation animation */
}
.sidebar-nav [data-bs-toggle=collapse] .fa-chevron-down {
  transition: transform 0.3s ease;
}
.sidebar-nav [data-bs-toggle=collapse][aria-expanded=true] .fa-chevron-down {
  transform: rotate(180deg);
}
.sidebar-nav [data-bs-toggle=collapse][aria-expanded=false] .fa-chevron-down {
  transform: rotate(0deg);
}

/* Indented collapsed content */
.sidebar-nav .collapse {
  transition: height 0.3s ease;
}
.sidebar-nav .collapse .nav-link {
  padding-left: 2rem;
  font-size: 0.9rem;
}

/* Sidebar section separators */
.sidebar-nav hr {
  opacity: 0.2;
}

/* Public navbar active state */
.navbar-nav .nav-link.active {
  font-weight: 600;
  border-bottom: 2px solid #FFCD00;
}

/* set max width or height*/
.navbar-brand img {
  max-height: 3rem;
  max-width: 3rem;
}

/* User dropdown menu styling */
.dropdown-menu {
  background-color: #2D2D2C;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.dropdown-item {
  color: #fff;
  transition: background-color 0.2s ease;
}
.dropdown-item:hover, .dropdown-item:focus {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.dropdown-item button {
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  padding: 0;
  color: inherit;
}

.dropdown-divider {
  border-color: rgba(255, 255, 255, 0.15);
}

/* Footer sticky at bottom */
.footer {
  margin-top: auto;
}

/* Main content area */
.main-content {
  padding: 1rem;
  flex: inherit;
  overflow-x: scroll;
}
@media (min-width: 768px) {
  .main-content {
    padding: 1.5rem;
  }
}
@media (min-width: 992px) {
  .main-content {
    padding: 2rem;
    height: calc(100vh - 4rem); /* Full viewport minus navbar */
    overflow-y: auto;
  }
}

/* Navbar brand image */
.navbar-brand img {
  transition: all 0.3s ease;
}

.navbar-brand:hover img {
  transform: scale(1.05);
}

/* Smooth transitions for responsive behavior */
.nav-link {
  transition: all 0.2s ease-in-out;
}

/* Better spacing for icons in navigation */
.nav-link i {
  min-width: 1.5rem;
  text-align: center;
}

/* Sidebar toggle button for mobile */
.navbar-toggler {
  border-color: rgba(255, 255, 255, 0.5);
}
.navbar-toggler:focus {
  box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
}

/* === Custom SBF Color Utilities === */
/* Navbar with SBF colors */
.navbar-dark.bg-sbf-dark {
  background-color: #003A5C !important;
}

.navbar-dark.bg-sbf-blue {
  background-color: #004987 !important;
}

/* Background colors */
.bg-sbf-blue-light {
  background-color: #004987 !important;
}

.bg-sbf-blue-dark {
  background-color: #003A5C !important;
}

.bg-sbf-yellow-light {
  background-color: #FFCD00 !important;
}

.bg-sbf-yellow-dark {
  background-color: #CB9700 !important;
}

.bg-sbf-grey-light {
  background-color: #424241 !important;
}

.bg-sbf-grey-dark {
  background-color: #2D2D2C !important;
}

.bg-sbf-silver {
  background-color: #EEEDE6 !important;
}

.bg-sbf-white {
  background-color: #F9F9F9 !important;
}

/* Text colors */
.text-sbf-blue-light {
  color: #004987 !important;
}

.text-sbf-blue-dark {
  color: #003A5C !important;
}

.text-sbf-yellow-light {
  color: #FFCD00 !important;
}

.text-sbf-yellow-dark {
  color: #CB9700 !important;
}

.text-sbf-grey-light {
  color: #424241 !important;
}

.text-sbf-grey-dark {
  color: #2D2D2C !important;
}

/* Border colors */
.border-sbf-blue {
  border-color: #004987 !important;
}

.border-sbf-yellow {
  border-color: #FFCD00 !important;
}

/* Buttons with SBF colors */
.btn-sbf-blue {
  background-color: #004987;
  border-color: #004987;
  color: #fff;
}
.btn-sbf-blue:hover {
  background-color: #003A5C;
  border-color: #003A5C;
  color: #fff;
}
.btn-sbf-blue:focus, .btn-sbf-blue:active {
  background-color: #003A5C;
  border-color: #003A5C;
  box-shadow: 0 0 0 0.25rem rgba(0, 73, 135, 0.5);
}

.btn-sbf-yellow {
  background-color: #FFCD00;
  border-color: #FFCD00;
  color: #2D2D2C;
}
.btn-sbf-yellow:hover {
  background-color: #CB9700;
  border-color: #CB9700;
  color: #fff;
}
.btn-sbf-yellow:focus, .btn-sbf-yellow:active {
  background-color: #CB9700;
  border-color: #CB9700;
  box-shadow: 0 0 0 0.25rem rgba(255, 205, 0, 0.5);
}

.btn-sbf-submit {
  background-color: #6bc282;
  border-color: #6bc282;
  color: #fff;
}
.btn-sbf-submit:hover {
  background-color: rgb(72.966507177, 177.033492823, 100.4784688995);
  border-color: rgb(72.966507177, 177.033492823, 100.4784688995);
  color: #fff;
}

.btn-sbf-cancel {
  background-color: #f54c3d;
  border-color: #f54c3d;
  color: #fff;
}
.btn-sbf-cancel:hover {
  background-color: rgb(242.5, 31.25, 12.5);
  border-color: rgb(242.5, 31.25, 12.5);
  color: #fff;
}

/* Alert variants with SBF colors */
.alert-sbf-blue {
  background-color: rgb(109.5, 188.1777777778, 255);
  border-color: #004987;
  color: #003A5C;
}

.alert-sbf-yellow {
  background-color: rgb(255, 240, 178.5);
  border-color: #CB9700;
  color: #2D2D2C;
}

/* Badge variants with SBF colors */
.badge-sbf-blue {
  background-color: #004987;
  color: #fff;
}

.badge-sbf-yellow {
  background-color: #FFCD00;
  color: #2D2D2C;
}

/* Table row colors */
.table-sbf-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(63, 110, 193, 0.05);
}

.table-sbf-striped tbody tr:nth-of-type(even) {
  background-color: rgba(63, 110, 193, 0.01);
}

.table-sbf-hover tbody tr:hover {
  background-color: rgba(63, 110, 193, 0.2);
}

/* Card with SBF styling */
.card-sbf-blue {
  border-color: #004987;
}
.card-sbf-blue .card-header {
  background-color: #004987;
  color: #fff;
  border-bottom: 1px solid #003A5C;
}

.card-sbf-yellow {
  border-color: #CB9700;
}
.card-sbf-yellow .card-header {
  background-color: #FFCD00;
  color: #2D2D2C;
  border-bottom: 1px solid #CB9700;
}