/* Documentation Sidebar Navigation */
.docs-nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.docs-nav-header {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border-light);
}

.docs-nav-title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.docs-nav-title:hover {
  color: var(--color-primary);
}

.docs-nav-tree {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Navigation Groups (Sections) */
.docs-nav-group {
  display: flex;
  flex-direction: column;
}

/* Wrapper containing toggle button + link */
.docs-nav-group-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: var(--border-radius-small);
  transition: all var(--transition-fast);
}

.docs-nav-group-toggle-wrapper:hover {
  background: var(--color-bg-hover);
}

/* Toggle button (just the arrow icon) */
.docs-nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.docs-nav-group-toggle svg {
  width: 14px;
  height: 14px;
  color: var(--color-text-secondary);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.docs-nav-group-toggle:hover svg {
  color: var(--color-text-primary);
}

.docs-nav-group-toggle[aria-expanded="true"] svg {
  transform: rotate(90deg);
}

/* Section link (the title, clickable to navigate) */
.docs-nav-group-link {
  flex: 1;
  padding: 0.5rem 0.75rem 0.5rem 0.25rem;
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
  text-decoration: none;
  border-radius: var(--border-radius-small);
  transition: all var(--transition-fast);
}

.docs-nav-group-link:hover {
  color: var(--color-primary);
}

.docs-nav-group-link.active {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

[data-theme="dark"] .docs-nav-group-link.active {
  background: rgba(33, 150, 243, 0.15);
}

.docs-nav-group-items {
  display: none;
  flex-direction: column;
  gap: 0.125rem;
  padding-left: 1.25rem;
  margin-top: 0.25rem;
}

/* Show items when expanded (controlled by JavaScript) */
.docs-nav-group-items.expanded {
  display: flex;
}

/* Navigation Links */
.docs-nav-link {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: var(--border-radius-small);
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: all var(--transition-fast);
}

.docs-nav-link:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-hover);
}

.docs-nav-link.active {
  color: var(--color-primary);
  font-weight: var(--font-weight-medium);
  background: var(--color-primary-light);
  border-left-color: var(--color-primary);
}

[data-theme="dark"] .docs-nav-link.active {
  background: rgba(33, 150, 243, 0.15);
}

/* Active trail (parent of active page) */
.docs-nav-link.active-trail {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-medium);
}

/* Nested sections */
.docs-nav-group .docs-nav-group {
  margin-left: 0.5rem;
}
