/* Simplified & Cleaner Navigation Styles - Wider with Collapsible Parts */

/* Sidebar - Wider to prevent text wrapping */
.sidebar {
  width: 320px !important; /* Wider from 220px */
  padding: 15px !important;
  font-size: 0.7rem !important; /* 3 sizes smaller */
}

.sidebar h3 {
  font-size: 0.75rem !important; /* Smaller */
  margin-bottom: 15px !important;
  padding-bottom: 8px !important;
  border-bottom: 2px solid #667eea !important;
  color: #667eea !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

/* Part sections - Collapsible */
.sidebar .part {
  margin-bottom: 12px !important;
  padding-bottom: 0 !important;
  border-bottom: 1px solid #e0e0e0 !important;
}

.sidebar .part:last-child {
  border-bottom: none !important;
}

/* Part header - Clickable to toggle */
.part-header {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 5px;
  border-radius: 4px;
  transition: background-color 0.2s;
  margin-bottom: 8px;
}

.part-header:hover {
  background-color: #f8f9fa;
}

/* Part info wrapper */
.part-info {
  flex: 1;
}

/* Part number badge - Smaller */
.sidebar .part-number {
  padding: 2px 8px !important;
  font-size: 0.6rem !important; /* Smaller */
  margin-bottom: 4px !important;
  border-radius: 8px !important;
  display: inline-block;
}

/* Part title - Compact */
.sidebar .part-title {
  font-size: 0.7rem !important; /* Smaller */
  margin-bottom: 0 !important;
  line-height: 1.3 !important;
  color: #555 !important;
  font-weight: 600 !important;
}

/* Toggle icon */
.part-toggle {
  font-size: 0.9rem;
  color: #667eea;
  transition: transform 0.3s;
  margin-left: 5px;
}

.part-toggle.collapsed {
  transform: rotate(-90deg);
}

/* Chapters list - Collapsible */
.part-chapters {
  max-height: 1000px;
  overflow: hidden;
  transition: max-height 0.3s ease-out, opacity 0.3s;
  opacity: 1;
  margin-bottom: 10px;
}

.part-chapters.collapsed {
  max-height: 0;
  opacity: 0;
}

/* Chapter links - Simplified */
.sidebar a {
  padding: 6px 8px !important;
  font-size: 0.7rem !important; /* Smaller */
  border-radius: 4px !important;
  margin-bottom: 4px !important;
  display: flex !important;
  align-items: center;
}

.sidebar .chapter-badge {
  padding: 2px 6px !important;
  font-size: 0.65rem !important; /* Smaller */
  min-width: 32px !important;
  margin-right: 8px !important;
  border-radius: 3px !important;
  flex-shrink: 0;
}

.sidebar .chapter-text {
  font-size: 0.7rem !important; /* Smaller */
  line-height: 1.3 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Adjust main content to match wider sidebar */
.main-content {
  margin-left: 320px !important;
}

/* Toggle button */
.toggle-sidebar {
  left: 8px !important;
  padding: 8px 12px !important;
  font-size: 0.85rem !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .sidebar {
    width: 280px !important;
  }

  .main-content {
    margin-left: 0 !important;
  }

  .sidebar .chapter-text {
    white-space: normal;
  }
}

/* Remove unnecessary spacing */
.sidebar ul {
  margin-top: 0 !important;
  list-style: none;
  padding-left: 0;
}

.sidebar li {
  margin-bottom: 3px !important;
}

/* Hover effects - subtle */
.sidebar a:hover {
  transform: translateX(2px) !important;
}

/* Active state - clearer */
.sidebar a.active {
  font-weight: 600 !important;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2) !important;
}

/* Scrollbar styling for sidebar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
}

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

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