/* API Documentation page: two-column layout with sticky sidebar */

.api-docs-layout {
  display: flex;
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  align-items: flex-start;
}

.api-docs-sidebar {
  flex-shrink: 0;
  width: 260px;
  position: sticky;
  top: 5rem;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.75rem;
  padding: 1rem 0;
}

.api-docs-sidebar nav {
  padding: 0 0.5rem;
}

.api-docs-sidebar .nav-section {
  margin-bottom: 0.25rem;
}

.api-docs-sidebar .nav-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  background: none;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  text-align: left;
  font-size: 0.9375rem;
  transition: background 0.15s, color 0.15s;
}

.api-docs-sidebar .nav-section-title:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.api-docs-sidebar .nav-section-title .chevron {
  flex-shrink: 0;
  transition: transform 0.2s;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
}

.api-docs-sidebar .nav-section.expanded .nav-section-title .chevron {
  transform: rotate(90deg);
}

.api-docs-sidebar .nav-section-links {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease-out;
}

.api-docs-sidebar .nav-section.expanded .nav-section-links {
  max-height: 2000px;
  transition: max-height 0.4s ease-in;
}

.api-docs-sidebar .nav-link {
  display: block;
  padding: 0.375rem 0.75rem 0.375rem 1.25rem;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  border-radius: 0.375rem;
  transition: background 0.15s, color 0.15s;
  border-left: 2px solid transparent;
}

.api-docs-sidebar .nav-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.api-docs-sidebar .nav-link.active {
  color: #a5b4fc;
  border-left-color: #a5b4fc;
  background: rgba(165, 180, 252, 0.12);
}

.api-docs-sidebar .nav-link-single {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  border-radius: 0.5rem;
  transition: background 0.15s, color 0.15s;
  border-left: 2px solid transparent;
}

.api-docs-sidebar .nav-link-single:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.api-docs-sidebar .nav-link-single.active {
  color: #a5b4fc;
  border-left-color: #a5b4fc;
  background: rgba(165, 180, 252, 0.12);
}

.api-docs-main {
  flex: 1;
  min-width: 0;
}

.api-docs-main .doc-section {
  scroll-margin-top: 5.5rem;
}

/* Pro badge next to nav links (e.g. YouTube API docs) */
.api-docs-sidebar .nav-link.nav-link-with-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.api-docs-sidebar .badge-pro {
  flex-shrink: 0;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
  color: white;
}

@media (max-width: 1023px) {
  .api-docs-layout {
    flex-direction: column;
  }

  .api-docs-sidebar {
    position: static;
    width: 100%;
    max-height: none;
  }

  .api-docs-sidebar .nav-section.expanded .nav-section-links {
    max-height: 1500px;
  }
}
