/* ===============================================
   CAVESYNC THEME - Sidebar & Navigation Layout
   Essential layout styles extracted from legacy theme
   =============================================== */

/* Wrapper & Page Layout */
.wrapper {
  display: flex;
  align-items: stretch;
  flex: 1 1 auto;
  width: 100%;
  min-height: 100vh;
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.content-wrapper {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
}

.content {
  padding: 1rem;
  width: 100%;
}

@media (min-width: 992px) {
  .content {
    margin-right: auto;
    margin-left: auto;
    padding: 1.9rem 1.875rem;
  }
}

@media (min-width: 1200px) {
  .content {
    padding-top: 2.5rem;
    padding-bottom: 0.625rem;
  }
}

/* Left Sidebar */
.left-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 250px;
  z-index: 1030;
  background-color: #31343d;
  transition: left 0.3s ease-in-out;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.sidebar-dark {
  background-color: #31343d;
}

.sidebar {
  position: relative;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden !important;
}

.sidebar-with-footer {
  padding-bottom: 60px;
}

/* Sidebar scrollbar styling */
.sidebar-left {
  height: calc(100vh - 76px);
  overflow-y: auto;
  overflow-x: hidden !important;
}

/* Hide all scrollbars (vertical and horizontal) */
.left-sidebar::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.sidebar-left::-webkit-scrollbar {
  width: 0px !important;
  height: 0px !important;
  background: transparent !important;
  display: none !important;
}

.left-sidebar,
.sidebar,
.sidebar-left {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

/* App Brand */
.app-brand {
  position: relative;
  display: block;
  border-bottom: 1px solid rgba(229, 233, 242, 0.25);
  padding-bottom: 1rem;
}

.app-brand a {
  display: flex;
  flex-direction: row;
  align-items: center;
  height: 76px;
  line-height: 76px;
  width: 250px;
  padding-left: 1.56rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

.app-brand .brand-name {
  color: #ffffff;
  font-size: 1.25rem;
  margin-left: 0.31rem;
}

/* Sidebar Navigation */
.sidebar .nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar .sidebar-inner {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar .sidebar-inner > li {
  position: relative;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.sidebar .sidebar-inner > li > a {
  display: flex;
  align-items: center;
  padding: 0.9375rem 1.56rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 0.875rem;
  width: 100% !important;
}

.sidebar .sidebar-inner > li > a:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.05);
}

/* Active sidebar item - full width highlight */
.sidebar .sidebar-inner > li.active {
  background-color: #17a2b8 !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.sidebar .sidebar-inner > li.active > a {
  position: relative;
  color: #ffffff !important;
  background-color: transparent !important;
  font-weight: 500;
  width: 100% !important;
  padding-left: 1.56rem !important;
  padding-right: 1.56rem !important;
}

.sidebar .sidebar-inner > li > a i {
  float: left;
  margin-right: 0.94rem;
  width: 20px;
  font-size: 1.125rem;
  text-align: center;
}

.sidebar .nav-text {
  flex: 1;
}

/* Section Title - Admin section styling */
.sidebar .sidebar-inner .section-title,
.sidebar .section-title,
.sidebar-inner .section-title,
.section-title {
  padding: 1.25rem 1.56rem 0.625rem !important;
  padding-left: 2.5rem !important;
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: 0.9rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  font-weight: 700 !important;
}

/* Alternative class names for section titles */
.sidebar .sidebar-inner .sidebar-category-title,
.sidebar .sidebar-category-title,
.sidebar-category-title {
  padding: 1.25rem 1.56rem 0.625rem !important;
  padding-left: 2.5rem !important;
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: 0.9rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  font-weight: 700 !important;
}

/* Sidebar Icon Link */
.sidenav-item-link {
  cursor: pointer;
}

/* Main Header */
.main-header {
  position: relative;
  background-color: #ffffff;
  border-bottom: 1px solid #e5e9f2;
  z-index: 1020;
  transition: all 0.3s ease;
}

.main-header .navbar {
  padding: 0.5rem 1rem;
  min-height: 60px;
}

.navbar-right {
  margin-left: auto;
}

.navbar-right .nav {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* User Menu Dropdown */
.user-menu .dropdown-toggle {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  background: none;
  border: none;
  color: #31343d;
  cursor: pointer;
  text-decoration: none;
}

.user-menu .user-image {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.user-menu .dropdown-menu {
  min-width: 250px;
  margin-top: 0.5rem;
}

.user-menu .dropdown-header {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #e5e9f2;
  background-color: #f8f9fa;
}

.user-menu .dropdown-header .img-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-right: 0.75rem;
}

.user-menu .dropdown-header .d-inline-block {
  display: flex;
  flex-direction: column;
}

.user-menu .dropdown-header small {
  color: #6c757d;
  font-size: 0.75rem;
}

.user-menu .dropdown-menu li {
  list-style: none;
}

.user-menu .dropdown-menu li a {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: #31343d;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.user-menu .dropdown-menu li a:hover {
  background-color: #f8f9fa;
}

.user-menu .dropdown-menu li a i {
  margin-right: 0.75rem;
  width: 20px;
  text-align: center;
}

.user-menu .dropdown-footer {
  border-top: 1px solid #e5e9f2;
  margin-top: 0.5rem;
}

/* Body Classes */
body.sidebar-fixed .left-sidebar {
  position: fixed;
}

body.navbar-fixed .main-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 250px;
  z-index: 1020;
}

body.navbar-fixed .page-wrapper {
  padding-top: 60px;
}

/* Responsive Sidebar */
@media (max-width: 991px) {
  .left-sidebar {
    left: -250px;
  }

  body.navbar-fixed .main-header {
    left: 0;
  }

  .sidebar-open .left-sidebar {
    left: 0;
  }
}

@media (min-width: 992px) {
  .page-wrapper {
    margin-left: 250px;
  }
}
