/* ============================================
   Modern Sidebar Styling
   ============================================ */

:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --secondary: #8b5cf6;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --border-radius: 0.75rem;
}

/* ============================================
   Sidebar Wrapper
   ============================================ */
.sidebar-wrapper {
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  width: 160px;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Sidebar Logo
   ============================================ */
.sidebar-wrapper .logo-wrapper {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-wrapper .logo-wrapper a {
  flex: 1;
  display: flex;
  align-items: center;
}

.sidebar-wrapper .logo-wrapper a img {
  max-height: 40px;
  width: auto;
}

/* ============================================
   Sidebar Main Navigation
   ============================================ */
.sidebar-wrapper .sidebar-main {
  position: relative;
  height: calc(100% - 100px);
  overflow-y: auto;
}

.sidebar-wrapper .sidebar-main .sidebar-links {
  list-style: none;
  padding: 1rem 0;
  margin: 0;
}

/* Sidebar Menu Items */
.sidebar-wrapper .sidebar-links .sidebar-list {
  position: relative;
  margin: 0;
}

.sidebar-wrapper .sidebar-links .sidebar-list > a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--gray-700);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

.sidebar-wrapper .sidebar-links .sidebar-list > a:hover {
  background: var(--gray-100);
  color: var(--primary);
  padding-left: 1.25rem;
}

.sidebar-wrapper .sidebar-links .sidebar-list > a.active,
.sidebar-wrapper .sidebar-links .sidebar-list > a.sidebar-link.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.1) 0%, transparent 100%);
  color: var(--primary);
  border-left: 3px solid var(--primary);
  padding-left: calc(1rem - 3px);
}

/* Icons in sidebar */
.sidebar-wrapper .sidebar-links svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  flex-shrink: 0;
}

.sidebar-wrapper .sidebar-links span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-wrapper.close_icon .sidebar-links span {
  display: none;
}

/* Section Titles */
.sidebar-wrapper .sidebar-main-title {
  padding: 1.5rem 1rem 0.75rem 1rem;
  margin: 0;
  color: var(--gray-500);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-wrapper.close_icon .sidebar-main-title {
  display: none;
}

/* ============================================
   Sidebar Submenus
   ============================================ */
.sidebar-wrapper .sidebar-submenu {
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  background: var(--gray-50);
  display: none;
}

.sidebar-wrapper .sidebar-list.open > .sidebar-submenu {
  display: block;
}

.sidebar-wrapper .sidebar-submenu li {
  margin: 0;
}

.sidebar-wrapper .sidebar-submenu li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  color: var(--gray-600);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 400;
  transition: all 0.2s ease;
  position: relative;
}

.sidebar-wrapper .sidebar-submenu li a:hover {
  color: var(--primary);
  padding-left: 2.75rem;
  background: rgba(99, 102, 241, 0.05);
}

.sidebar-wrapper .sidebar-submenu li a.active {
  color: var(--primary);
  font-weight: 500;
  background: rgba(99, 102, 241, 0.1);
}

.sidebar-wrapper .sidebar-submenu li a::before {
  content: '';
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  background: currentColor;
  border-radius: 50%;
  opacity: 0;
  transition: all 0.2s ease;
}

.sidebar-wrapper .sidebar-submenu li a:hover::before,
.sidebar-wrapper .sidebar-submenu li a.active::before {
  opacity: 1;
}

/* ============================================
   Sidebar Arrows (Scroll indicators)
   ============================================ */
.sidebar-wrapper .left-arrow,
.sidebar-wrapper .right-arrow {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary);
  color: var(--white);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
}

.sidebar-wrapper .left-arrow:hover,
.sidebar-wrapper .right-arrow:hover {
  background: var(--primary-dark);
  transform: translateY(-50%) scale(1.1);
}

.sidebar-wrapper .left-arrow {
  left: 0;
}

.sidebar-wrapper .right-arrow {
  right: 0;
}

/* ============================================
   Page Header Adjustments
   ============================================ */
.page-header {
  transition: all 0.3s ease;
}

.sidebar-wrapper.close_icon ~ .page-header {
  margin-left: 0;
}

/* ============================================
   Page Body Wrapper
   ============================================ */
.page-body-wrapper {
  transition: all 0.3s ease;
  margin-left: 160px;
  padding-left: 0;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1200px) {
  .sidebar-wrapper {
    width: 160px;
  }

  .page-body-wrapper {
    margin-left: 160px;
  }
}

@media (max-width: 768px) {
  .sidebar-wrapper {
    width: 160px;
    position: fixed;
    left: -160px;
    z-index: 200;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
  }

  .sidebar-wrapper.active {
    left: 0;
  }

  .page-body-wrapper {
    margin-left: 0;
  }

  .sidebar-wrapper .sidebar-main-title {
    display: block;
  }
}

/* ============================================
   Scrollbar Styling
   ============================================ */
.sidebar-wrapper {
  scrollbar-width: thin;
  scrollbar-color: var(--gray-300) transparent;
}

.sidebar-wrapper::-webkit-scrollbar {
  width: 6px;
}

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

.sidebar-wrapper::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}

.sidebar-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}
