/* ============================================
   Sidebar Navigation Component
   ============================================ */

/* Details/Summary for Mobile Collapsible Navigation */
.sidebar-details {
  border: none;
  padding-bottom: 2rem;
  border-bottom: 1px solid #D9D9D9; /* Divider on mobile */
  margin-bottom: 2rem;
}

.sidebar-summary {
  display: block;
  padding: 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 1.125rem; /* 18px */
  font-weight: 600;
  color: #1E1E1E;
  background-color: #F5F5F5;
  border-radius: 0.5rem;
  cursor: pointer;
  list-style: none;
  transition: background-color 0.2s ease;
}

.sidebar-details[open] .sidebar-summary {
  margin-bottom: 1rem;
}

.sidebar-summary:hover {
  background-color: #EBEBEB;
}

/* Remove default marker */
.sidebar-summary::-webkit-details-marker {
  display: none;
}

/* Add custom chevron indicator */
.sidebar-summary::before {
  content: '';
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  margin-right: 0.5rem;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%231E1E1E' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transform: rotate(-90deg);
  transition: transform 0.2s ease;
}

/* Rotate chevron when open */
.sidebar-details[open] .sidebar-summary::before {
  transform: rotate(0deg);
}

/* Sidebar Container */
.sidebar-nav {
  display: flex;
  flex-direction: column;
}

.sidebar-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem; /* 8px gap between items */
}

.sidebar-nav-item {
  margin: 0;
}

/* Navigation Pill Styling */
.sidebar-nav-link {
  display: flex;
  align-items: center;
  padding: 0.5rem; /* 8px padding */
  font-family: 'Inter', sans-serif;
  font-size: 1rem; /* 16px */
  font-weight: 400;
  line-height: 1.4;
  color: #1E1E1E;
  text-decoration: none;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 0.5rem; /* 8px border-radius */
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  cursor: pointer;
  width: 100%;
}

/* Hover State */
.sidebar-nav-link:hover {
  background-color: #DDEEFF; /* Light blue background */
  color: #1E1E1E;
  text-decoration: none;
  border-color: transparent;
}

/* Active/Selected State */
.sidebar-nav-link.active {
  color: #1E1E1E;
  font-weight: 600;
  background-color: #CCE5FF;
  border-color: transparent;
}

.sidebar-nav-link.active:hover {
  background-color: #CCE5FF; /* Slightly darker on hover when active */
}

/* Focus State (Accessibility) */
.sidebar-nav-link:focus {
  outline: 2px solid #3366CC;
  outline-offset: 2px;
}

.sidebar-nav-link:focus:not(:focus-visible) {
  outline: none;
}

/* Focus Visible (Modern browsers) */
.sidebar-nav-link:focus-visible {
  outline: 2px solid #3366CC;
  outline-offset: 2px;
}

/* Parent Item with Children */
.sidebar-nav-parent {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Nested List (Children) */
.sidebar-nav-nested {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1rem; /* Indent child items */
  gap: 0.5rem;
  display: flex;
  flex-direction: column;
}

/* Child items inherit all styles from .sidebar-nav-link */

/* Tablet and Desktop */
@media (min-width: 992px) {
  /* Always show navigation on desktop, hide summary */
  .sidebar-summary {
    display: none; /* Hide the summary toggle on desktop */
  }

  /* Ensure nav is always visible on desktop, regardless of open state */
  .sidebar-details .sidebar-nav {
    display: flex;
  }

  .sidebar-details {
    border-bottom: none; /* Remove divider on desktop */
    padding-bottom: 0;
    margin-bottom: 0;
  }

  .sidebar-nav-link {
    padding: 0.5rem 1rem; /* More horizontal padding on desktop */
  }
}
