/* Sidebar CSS - Dedicated styles for sidebar functionality */
@charset "UTF-8";

/* Sidebar Root Variables */
:root {
  --sidebar-width: 250px;
  --sidebar-width-mobile: 200px;
  --sidebar-left-margin: 1rem;
  --sidebar-header-height: 75px; /* Header height to prevent overlap */
  --sidebar-background: #ffffff;
  --sidebar-text-color: #334155;
  --sidebar-text-muted: #64748b;
  --sidebar-hover-bg: rgba(232, 239, 248, 0.69);
  --sidebar-active-bg: #e8eff8b0;
  --sidebar-border-radius: 8px;
  --sidebar-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  --sidebar-hover-shadow: rgba(0, 0, 0, 0.15) 0px 15px 25px, rgba(0, 0, 0, 0.05) 0px 5px 10px;
  --sidebar-active-shadow: rgba(0, 0, 0, 0.15) 0px 12px 25px, rgba(0, 0, 0, 0.05) 0px 5px 10px;
  --sidebar-transition: all 0.3s ease;
}

/* Main Sidebar Container */
.sidebar {
  width: var(--sidebar-width);
  height: calc(100vh);
  margin-left: var(--sidebar-left-margin);
  background-color: var(--sidebar-background);
  box-shadow: var(--sidebar-shadow);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: fixed;
  top: var(--sidebar-header-height);
  left: 0;
  z-index: 1000;
  overflow-y: auto;
  transition: var(--sidebar-transition);
}

/* Sidebar Navigation */
.sidebar nav {
  position: relative;
  height: 100%;
}

.sidebar nav.mt-3 {
  margin-top: 1rem !important;
}

.sidebar nav.d-flex {
  display: flex !important;
}

.sidebar nav.gap-2 {
  gap: 0.5rem !important;
}

.sidebar nav.flex-column {
  flex-direction: column !important;
}

/* Sidebar Items */
.sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--sidebar-border-radius);
  padding: 10px 15px;
  text-decoration: none;
  color: var(--sidebar-text-color);
  font-size: 16px;
  transition: var(--sidebar-transition);
  cursor: pointer;
}

.sidebar-item:hover {
  box-shadow: var(--sidebar-hover-shadow);
  text-decoration: none;
}

.sidebar-item.active {
  background-color: var(--sidebar-active-bg);
  color: var(--sidebar-text-color);
  box-shadow: var(--sidebar-active-shadow);
}

/* Sidebar Item Icons */
.sidebar-item i {
  font-size: 18px;
  margin-right: 10px;
  color: var(--sidebar-text-muted);
}

.sidebar-item i.bi {
  vertical-align: middle;
}

/* Sidebar Item Text */
.sidebar-item span {
  flex-grow: 1;
  font-weight: 500;
}

/* Sidebar Item Chevron */
.sidebar-item .chevron {
  font-size: 14px;
  color: #94a3b8;
}

/* Sidebar Divider */
.sidebar hr {
  margin: 1rem 0;
  border: none;
  border-top: 1px solid #e2e8f0;
  opacity: 0.6;
}

/* Responsive Sidebar */
@media (max-width: 768px) {
  .sidebar {
    width: var(--sidebar-width-mobile);
    height: calc(100vh - var(--sidebar-header-height));
    top: var(--sidebar-header-height);
    transform: translateX(-100%);
  }
  
  .sidebar.show {
    transform: translateX(0);
  }
  
  .sidebar-item {
    font-size: 14px;
    padding: 8px 12px;
  }
  
  .sidebar-item i {
    font-size: 16px;
    margin-right: 8px;
  }
}

/* Sidebar Toggle Button */
#sidebarshow {
  display: none;
}

@media screen and (max-width: 992px) {
  #sidebarshow {
    display: inline;
  }
  
  #sidebartoggle {
    display: none;
  }
}

/* Main Content Adjustment for Sidebar */
.main-content {
  margin-left: var(--sidebar-width) !important;
  padding: 24px !important;
  padding-top: calc(var(--sidebar-header-height)) !important;
  min-height: 100vh;
  transition: var(--sidebar-transition);
}

@media (max-width: 768px) {
  .main-content {
    margin-left: 0 !important;
    padding: 16px !important;
    padding-top: calc(var(--sidebar-header-height) + 16px) !important;
  }
}

/* Header Adjustment for Sidebar - Removed to prevent conflicts with existing header styles */

/* Footer Adjustment for Sidebar */
.footer {
  margin-left: var(--sidebar-width);
  transition: var(--sidebar-transition);
}

@media (max-width: 768px) {
  .footer {
    margin-left: 0;
  }
}

/* Sidebar Animation Classes */
.sidebar.slide-in {
  transform: translateX(0);
}

.sidebar.slide-out {
  transform: translateX(-100%);
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: var(--sidebar-header-height);
  left: 0;
  width: 100%;
  height: calc(100vh - var(--sidebar-header-height));
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.sidebar-overlay.show {
  display: block;
}

/* Sidebar Item States */
.sidebar-item:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.sidebar-item:active {
  transform: scale(0.98);
}

/* Sidebar Scrollbar Styling */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Sidebar Loading State */
.sidebar.loading {
  opacity: 0.7;
  pointer-events: none;
}

.sidebar.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #e2e8f0;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: sidebar-spin 1s linear infinite;
}

@keyframes sidebar-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
