/* Sidebar Component Styles */
.toc-sidebar {
  width: 280px;
  height: 100vh;
  background: #fafbfc;
  overflow-y: auto;
  z-index: 100;
  flex-shrink: 0;
}

.toc-back-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  margin: 0;
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: #5f6368;
  font-size: 0.9rem;
  border-bottom: 1px solid #e8eaed;
}

.toc-back-button:hover {
  background: #f0f2f5;
  color: #1976d2;
}

.toc-back-button svg {
  flex-shrink: 0;
}

.toc-header {
  padding: 25px 20px;
  background: #f8f9fa;
}

.toc-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: #2c3e50;
}

.toc-subtitle {
  font-size: 0.9rem;
  color: #6c757d;
}

.toc-list {
  list-style: none;
  padding: 10px 0;
}

.toc-item {
  padding: 14px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  border-radius: 8px;
  margin: 2px 8px;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  position: relative;
  z-index: 10;
}

.toc-item:hover {
  background: #f0f2f5;
}

.toc-item.active {
  background: #e8f4f8;
  color: #1976d2;
  font-weight: 500;
}

.toc-number {
  display: inline-block;
  width: 24px;
  height: 24px;
  background: #e9ecef;
  color: #6c757d;
  border-radius: 6px;
  text-align: center;
  line-height: 24px;
  font-size: 0.75rem;
  margin-right: 12px;
  font-weight: 500;
}

.toc-item.active .toc-number {
  background: #1976d2;
  color: white;
}

/* Nested list styles */
.toc-nested-list {
  list-style: none;
  padding: 8px 0 0 0;
  margin: 8px 0 0 36px;
  border-left: 2px solid #e8eaed;
}

.toc-nested-item {
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  border-radius: 6px;
  margin: 1px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #5f6368;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  position: relative;
  z-index: 10;
}

.toc-nested-item:hover {
  background: #f0f2f5;
  color: #1976d2;
}

.toc-nested-item.active {
  background: #e3f2fd !important;
  color: #1976d2 !important;
  font-weight: 600 !important;
}

.toc-nested-number {
  display: inline-block;
  width: 32px;
  height: 20px;
  background: #f1f3f4;
  color: #5f6368;
  border-radius: 4px;
  text-align: center;
  line-height: 20px;
  font-size: 0.7rem;
  margin-right: 8px;
  font-weight: 500;
  flex-shrink: 0;
}

.toc-nested-item.active .toc-nested-number {
  background: #1976d2;
  color: white;
}

@media (max-width: 768px) {
  .toc-sidebar {
    width: 250px;
  }

  .toc-nested-list {
    margin-left: 24px;
  }

  .toc-nested-item {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}
