/* ByteBuddy Documentation Stylesheet — Matching Reference Screenshots 1-4 */
:root {
  --bg-primary: #0a0b12;
  --bg-secondary: #11121d;
  --bg-tertiary: #171827;
  --bg-hover: #1e2035;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(139, 92, 246, 0.5);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #8b5cf6;
  --accent-light: #a78bfa;
  --accent-bg: rgba(139, 92, 246, 0.12);
  --accent-glow: rgba(139, 92, 246, 0.35);
  --blue-accent: #38bdf8;
  --emerald-accent: #10b981;
  --rose-accent: #f43f5e;
  --header-height: 60px;
  --sidebar-width: 275px;
  --toc-width: 230px;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-hover: #e2e8f0;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-active: rgba(139, 92, 246, 0.6);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent-bg: rgba(139, 92, 246, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Header (Screenshots 1 & 2)
   ========================================================================== */
.docs-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(10, 11, 18, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
}

.mobile-menu-btn:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.brand-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.4);
}

.brand-name {
  font-weight: 800;
  letter-spacing: 0.02em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.top-nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.top-nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: color 150ms ease;
}

.top-nav-link:hover {
  color: var(--text-primary);
}

.invite-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  box-shadow: 0 0 14px rgba(124, 58, 237, 0.35);
  transition: all 180ms ease;
  white-space: nowrap;
}

.invite-header-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.6);
  filter: brightness(1.1);
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 12px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  min-width: 220px;
  transition: all 180ms ease;
}

.search-trigger:hover {
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text-secondary);
}

.search-placeholder {
  flex: 1;
}

.search-trigger kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-secondary);
}

.social-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.social-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 150ms ease;
}

.social-btn:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.social-btn.discord-btn:hover {
  color: #5865f2;
}

/* ==========================================================================
   Layout (3 Columns matching Screenshot 1)
   ========================================================================== */
.docs-layout {
  display: flex;
  flex: 1;
  max-width: 1540px;
  width: 100%;
  margin: 0 auto;
  position: relative;
}

/* ==========================================================================
   Left Navigation Sidebar (Screenshot 2)
   ========================================================================== */
.docs-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  border-right: 1px solid var(--border-color);
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.docs-sidebar::-webkit-scrollbar {
  width: 4px;
}
.docs-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.sidebar-nav-tree {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Top-level direct items (Introduction, FAQ, Partnership Program) */
.sidebar-direct-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 140ms ease;
}

.sidebar-direct-link:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.sidebar-direct-link.active {
  color: #60a5fa;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

/* Accordion Group Categories */
.nav-group {
  margin-bottom: 2px;
}

.nav-group-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all 140ms ease;
}

.nav-group-header:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.nav-group-header.has-active {
  color: var(--text-primary);
}

.chevron-icon {
  transition: transform 200ms ease;
  color: var(--text-muted);
}

.nav-group.open .chevron-icon {
  transform: rotate(90deg);
}

.nav-group-children {
  display: none;
  flex-direction: column;
  padding-left: 18px;
  margin: 2px 0 6px 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  gap: 2px;
}

.nav-group.open .nav-group-children {
  display: flex;
}

.nav-child-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 140ms ease;
  position: relative;
}

.nav-child-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-child-link.active {
  color: #60a5fa;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.1);
  border-left: 2px solid #38bdf8;
}

.sidebar-footer {
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 12px;
}

.lang-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms ease;
}

.theme-toggle-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

[data-theme="dark"] .sun-icon { display: none; }
[data-theme="dark"] .moon-icon { display: block; }
[data-theme="light"] .sun-icon { display: block; }
[data-theme="light"] .moon-icon { display: none; }

/* ==========================================================================
   Main Content Area (Screenshots 1, 3, 4)
   ========================================================================== */
.docs-main {
  flex: 1;
  min-width: 0;
  padding: 32px 48px 80px;
}

.content-wrapper {
  max-width: 860px;
  margin: 0 auto;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--text-secondary);
}

.breadcrumbs span.current {
  color: var(--text-secondary);
}

.page-title {
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 16px;
}

.page-lead {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 28px;
}

/* Mascot Illustration Banner (Screenshot 1) */
.mascot-banner-card {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #0f101a;
  margin-bottom: 36px;
  position: relative;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

.mascot-svg-wrap {
  width: 100%;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 60%, rgba(245, 158, 11, 0.15), rgba(139, 92, 246, 0.08) 45%, #0a0b12 80%);
}

/* Key Features Grid (Screenshot 1) */
.section-heading {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  margin: 36px 0 14px;
}

.section-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.features-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 36px;
}

@media (max-width: 900px) {
  .features-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.feature-pill-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(17, 18, 29, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  transition: all 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-pill-card:hover {
  transform: translateY(-2px);
  background: rgba(23, 24, 39, 0.9);
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 12px rgba(139, 92, 246, 0.15);
}

.feature-card-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-light);
}

/* Numbered Step Timelines (Screenshot 4) */
.steps-timeline {
  display: flex;
  flex-direction: column;
  margin: 28px 0;
  position: relative;
}

.step-item {
  display: flex;
  gap: 18px;
  position: relative;
  padding-bottom: 36px;
}

.step-item:last-child {
  padding-bottom: 12px;
}

.step-connector-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 32px;
  flex-shrink: 0;
}

.step-number-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.step-line {
  flex: 1;
  width: 2px;
  background: rgba(255, 255, 255, 0.1);
  margin-top: 6px;
}

.step-item:last-child .step-line {
  display: none;
}

.step-content {
  flex: 1;
  padding-top: 2px;
}

.step-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.step-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
}

/* Code Blocks & In-line Snippets */
.code-url-box {
  background: #090a10;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  overflow-x: auto;
}

.code-url-box code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #c084fc;
  white-space: nowrap;
}

.copy-snippet-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  transition: all 140ms ease;
}

.copy-snippet-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

code.inline-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  color: #e2e8f0;
}

/* Changelog Styles (Screenshot 3) */
.changelog-section-title {
  font-size: 24px;
  font-weight: 800;
  color: #38bdf8;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  margin: 32px 0 20px;
}

.changelog-subgroup {
  margin-bottom: 24px;
}

.changelog-subgroup-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.changelog-bullet-list {
  list-style: none;
  padding-left: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.changelog-bullet-list li {
  position: relative;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.changelog-bullet-list li::before {
  content: "•";
  position: absolute;
  left: -16px;
  color: var(--text-muted);
}

.changelog-num-list {
  padding-left: 20px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.changelog-num-list li {
  font-size: 13.5px;
  color: var(--text-secondary);
}

.changelog-num-list strong {
  color: #e2e8f0;
}

/* Callout Alert Boxes */
.callout-box {
  border-radius: 10px;
  padding: 16px 18px;
  margin: 20px 0;
  display: flex;
  gap: 14px;
  font-size: 13.5px;
  line-height: 1.6;
}

.callout-box.info {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #e0f2fe;
}

.callout-box.warning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fef3c7;
}

/* Commands Catalog Table */
.commands-table-wrapper {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  margin: 20px 0;
}

.commands-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.commands-table th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.commands-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.commands-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Article Footer */
.article-footer {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.footer-meta {
  color: var(--text-muted);
  font-size: 12.5px;
  margin-bottom: 24px;
}

.page-navigation-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-nav-card {
  flex: 1;
  padding: 16px 20px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 180ms ease;
}

.page-nav-card:hover {
  border-color: var(--border-active);
  background: var(--bg-tertiary);
  transform: translateY(-2px);
}

.page-nav-direction {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.page-nav-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-light);
}

/* ==========================================================================
   Right Table of Contents Sidebar (Screenshot 1)
   ========================================================================== */
.docs-toc {
  width: var(--toc-width);
  min-width: var(--toc-width);
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  padding: 32px 16px;
}

.toc-sticky-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.toc-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 2px;
}

.toc-item a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 140ms ease;
  display: block;
}

.toc-item a:hover {
  color: var(--text-primary);
}

.toc-item.active a {
  color: #38bdf8;
  font-weight: 600;
}

.toc-community-links {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toc-comm-link {
  color: var(--text-muted);
  font-size: 12.5px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color 140ms ease;
}

.toc-comm-link:hover {
  color: var(--text-primary);
}

/* ==========================================================================
   Search Modal (Ctrl + K)
   ========================================================================== */
.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}

.search-modal-box {
  width: 100%;
  max-width: 620px;
  background: #11121d;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 20px rgba(139, 92, 246, 0.15);
  overflow: hidden;
  animation: modalScale 160ms ease-out;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.search-input-row input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 16px;
  outline: none;
  font-family: inherit;
}

.search-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
}

.search-results-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 10px;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 14px;
  transition: all 120ms ease;
  cursor: pointer;
}

.search-result-item:hover,
.search-result-item.selected {
  background: rgba(139, 92, 246, 0.15);
  color: #fff;
}

.search-result-title {
  font-weight: 600;
}

.search-result-category {
  font-size: 11.5px;
  color: var(--text-muted);
}

.search-empty-state {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.search-modal-footer {
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  color: var(--text-muted);
}

.search-modal-footer kbd {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--text-secondary);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1200px) {
  .docs-toc {
    display: none;
  }
}

@media (max-width: 860px) {
  .mobile-menu-btn {
    display: block;
  }
  .top-nav-links {
    display: none;
  }
  .docs-sidebar {
    position: fixed;
    top: var(--header-height);
    left: -100%;
    z-index: 200;
    background: var(--bg-primary);
    transition: left 240ms ease;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  }
  .docs-sidebar.open {
    left: 0;
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--header-height);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 150;
  }
  .sidebar-overlay.active {
    display: block;
  }
  .docs-main {
    padding: 24px 20px 60px;
  }
}
