/* ==========================================================================
   LOOM VTT DOCS — DESIGN SYSTEM (ESTÚDIO AAA / PARADOX & WORLD OF DARKNESS)
   ========================================================================== */

:root {
  --docs-sidebar-width: 280px;
  --docs-header-height: 64px;
  --docs-bg: #000000;
  --docs-sidebar-bg: #080808;
  --docs-sidebar-border: #1a1a1a;
  --docs-accent: #ffffff;
  --docs-accent-gold: #f59e0b;
  --docs-text: #e5e5e5;
  --docs-text-muted: #737373;
  --docs-border: #1f1f1f;
  --docs-code-bg: #0a0a0a;
  --docs-active-bg: #141414;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

.docs-page {
  background: var(--docs-bg);
  color: var(--docs-text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

/* ── Top Bar ───────────────────────────────────────────────────────────── */
.docs-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--docs-header-height);
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--docs-sidebar-border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  z-index: 100;
  gap: 1.25rem;
}

.docs-hamburger {
  display: none;
  background: none;
  border: 1px solid var(--docs-border);
  color: var(--docs-text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 0;
  transition: all 0.15s;
  flex-shrink: 0;
}
.docs-hamburger:hover {
  color: #ffffff;
  border-color: #404040;
  background: rgba(255, 255, 255, 0.05);
}

.docs-topbar-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: #ffffff;
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.docs-topbar-logo img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.docs-topbar-logo .accent {
  color: #ffffff;
}

.docs-topbar-sep {
  color: #404040;
  font-size: 1rem;
  font-weight: 300;
  flex-shrink: 0;
}

.docs-topbar-badge {
  font-size: 0.625rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--docs-accent-gold);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 0;
  padding: 3px 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.docs-topbar-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: 0.5rem;
}
.docs-topbar-nav a {
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--docs-text-muted);
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: 0.1em;
  transition: color 0.15s;
}
.docs-topbar-nav a:hover {
  color: #ffffff;
}

.docs-topbar-spacer {
  flex: 1;
}

.docs-lang-toggle {
  display: flex;
  background: #0d0d0d;
  border: 1px solid var(--docs-border);
  border-radius: 0;
  overflow: hidden;
  flex-shrink: 0;
}

.docs-lang-btn {
  padding: 5px 12px;
  font-size: 0.6875rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--docs-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.08em;
  line-height: 1;
}
.docs-lang-btn.active {
  background: #ffffff;
  color: #000000;
}
.docs-lang-btn:hover:not(.active) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.docs-back-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #ffffff;
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 0;
  border: 1px solid #333333;
  background: #0d0d0d;
  transition: all 0.15s;
  flex-shrink: 0;
}
.docs-back-link:hover {
  color: #000000;
  background: #ffffff;
  border-color: #ffffff;
}

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.docs-sidebar {
  position: fixed;
  top: var(--docs-header-height);
  left: 0; bottom: 0;
  width: var(--docs-sidebar-width);
  background: var(--docs-sidebar-bg);
  border-right: 1px solid var(--docs-sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow: hidden;
}

.docs-search-wrap {
  position: relative;
  padding: 1rem;
  border-bottom: 1px solid var(--docs-border);
  flex-shrink: 0;
  background: #050505;
}

.docs-search-icon {
  position: absolute;
  left: 1.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--docs-text-muted);
  font-size: 0.75rem;
  pointer-events: none;
}

.docs-search {
  width: 100%;
  box-sizing: border-box;
  background: #000000;
  border: 1px solid var(--docs-border);
  border-radius: 0;
  color: #ffffff;
  font-size: 0.8125rem;
  padding: 8px 12px 8px 36px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  font-family: 'JetBrains Mono', monospace;
}
.docs-search:focus {
  border-color: #ffffff;
  background: #0a0a0a;
}
.docs-search::placeholder {
  color: #525252;
}

.docs-search-results {
  position: absolute;
  top: calc(100% - 0.25rem);
  left: 1rem; right: 1rem;
  background: #0a0a0a;
  border: 1px solid #333333;
  border-radius: 0;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
  max-height: 320px;
  overflow-y: auto;
  z-index: 300;
  display: none;
}
.docs-search-results.visible {
  display: block;
}

.docs-search-result-item {
  display: block;
  padding: 10px 14px;
  font-size: 0.8125rem;
  color: var(--docs-text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid var(--docs-border);
  line-height: 1.4;
}
.docs-search-result-item:last-child {
  border-bottom: none;
}
.docs-search-result-item:hover {
  background: #171717;
  color: #ffffff;
}
.docs-search-result-item strong {
  color: #ffffff;
  font-weight: 700;
}

.docs-search-result-section {
  font-size: 0.6875rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--docs-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-top: 2px;
}

.docs-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: #262626 transparent;
}
.docs-nav::-webkit-scrollbar { width: 4px; }
.docs-nav::-webkit-scrollbar-track { background: transparent; }
.docs-nav::-webkit-scrollbar-thumb { background: #262626; border-radius: 0; }

.docs-section-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 1rem 0.35rem;
  cursor: pointer;
  user-select: none;
  color: #a3a3a3;
  font-size: 0.65rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: color 0.15s;
  margin-top: 0.625rem;
}
.docs-section-header:hover {
  color: #ffffff;
}

.docs-section-icon {
  font-size: 0.75rem;
  width: 16px;
  text-align: center;
}

.docs-section-chevron {
  margin-left: auto;
  font-size: 0.5625rem;
  transition: transform 0.2s ease;
  opacity: 0.6;
}
.docs-section-header.collapsed .docs-section-chevron {
  transform: rotate(-90deg);
}

.docs-section-pages {
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.docs-page-link {
  display: block;
  padding: 6px 1rem 6px 2.25rem;
  font-size: 0.8125rem;
  color: #737373;
  text-decoration: none;
  transition: all 0.12s;
  border-left: 2px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
}
.docs-page-link:hover {
  color: #ffffff;
  background: #121212;
}
.docs-page-link.active {
  color: #ffffff;
  background: #171717;
  border-left-color: #f59e0b;
  font-weight: 600;
}

/* ── Overlay mobile ─────────────────────────────────────────────────────── */
.docs-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 40;
}
.docs-overlay.visible {
  display: block;
}

/* ── Main Layout ───────────────────────────────────────────────────────── */
.docs-main {
  margin-left: var(--docs-sidebar-width);
  padding-top: var(--docs-header-height);
  min-height: 100vh;
  background: #000000;
}

.docs-content-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 2.5rem 6rem;
}

.docs-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 55vh;
  color: var(--docs-text-muted);
  gap: 0.75rem;
  font-size: 0.875rem;
  font-family: 'JetBrains Mono', monospace;
}

/* ── Prose & Document Content ──────────────────────────────────────────── */
.docs-prose {
  line-height: 1.75;
  font-size: 0.9375rem;
  color: #a3a3a3;
  font-family: 'Inter', system-ui, sans-serif;
}

.docs-prose h1 {
  font-size: 2.25rem;
  font-weight: 900;
  color: #ffffff;
  margin: 0 0 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #262626;
  letter-spacing: -0.025em;
  line-height: 1.15;
  text-transform: uppercase;
  font-family: 'Inter', system-ui, sans-serif;
}

.docs-prose h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  margin: 2.75rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #1f1f1f;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  font-family: 'Inter', system-ui, sans-serif;
}

.docs-prose h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #f5f5f5;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.01em;
}

.docs-prose h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #e5e5e5;
  margin: 1.5rem 0 0.5rem;
}

.docs-prose h5, .docs-prose h6 {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #737373;
  margin: 1.25rem 0 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: 'JetBrains Mono', monospace;
}

.docs-prose p {
  margin: 0 0 1.25rem;
  color: #a3a3a3;
  line-height: 1.75;
}

.docs-prose a {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #525252;
  transition: text-decoration-color 0.15s, color 0.15s;
}
.docs-prose a:hover {
  color: var(--docs-accent-gold);
  text-decoration-color: var(--docs-accent-gold);
}

.docs-prose ul, .docs-prose ol {
  margin: 0.5rem 0 1.25rem;
  padding-left: 1.5rem;
  color: #a3a3a3;
}
.docs-prose li {
  margin-bottom: 0.5rem;
  line-height: 1.65;
}
.docs-prose li strong {
  color: #ffffff;
}
.docs-prose strong {
  color: #ffffff;
  font-weight: 700;
}
.docs-prose em {
  color: #d4d4d4;
}

/* ── Inline Code ───────────────────────────────────────────────────────── */
.docs-prose :not(pre) > code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.825em;
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 3px;
  padding: 0.18em 0.5em;
  color: #f59e0b; /* warm gold accent instead of purple */
}

/* ── Code Blocks (Com espaçamento generoso da borda) ─────────────────────── */
.docs-prose pre {
  margin: 1.5rem 0 2rem;
  border-radius: 4px;
  overflow-x: auto;
  border: 1px solid #262626;
  background: #0a0a0a !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.7);
  padding: 1.25rem 1.75rem !important; /* Espaço confortável e generoso da borda */
}

.docs-prose pre code {
  font-family: 'JetBrains Mono', monospace !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  color: #ededed !important;
  font-size: 0.86rem !important;
  line-height: 1.75 !important;
  display: block;
}

.docs-prose .hljs {
  padding: 0 !important;
  background: transparent !important;
  font-size: 0.86rem !important;
  line-height: 1.75 !important;
}

/* ── Tables ────────────────────────────────────────────────────────────── */
.docs-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0 2rem;
  font-size: 0.85rem;
  border-radius: 0;
  border: 1px solid var(--docs-border);
  overflow: hidden;
}
.docs-prose thead th {
  background: #0d0d0d;
  color: #ffffff;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--docs-border);
  font-size: 0.75rem;
  white-space: nowrap;
}
.docs-prose tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--docs-border);
  color: #a3a3a3;
  vertical-align: top;
  line-height: 1.55;
}
.docs-prose tbody tr:last-child td {
  border-bottom: none;
}
.docs-prose tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ── Blockquotes ───────────────────────────────────────────────────────── */
.docs-prose blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--docs-accent-gold);
  background: #0d0d0d;
  border-radius: 0;
  color: #d4d4d4;
}
.docs-prose blockquote p {
  margin: 0;
}

.docs-prose hr {
  border: none;
  border-top: 1px solid var(--docs-border);
  margin: 2.5rem 0;
}

.docs-prose img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--docs-border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  margin: 1.5rem 0;
  display: block;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .docs-content-wrap {
    padding: 2.25rem 1.5rem 4rem;
  }
}

@media (max-width: 768px) {
  .docs-hamburger {
    display: block;
  }
  .docs-topbar-badge,
  .docs-topbar-nav {
    display: none;
  }
  .docs-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
    width: min(var(--docs-sidebar-width), 85vw);
  }
  .docs-sidebar.open {
    transform: translateX(0);
  }
  .docs-main {
    margin-left: 0;
  }
  .docs-content-wrap {
    padding: 1.5rem 1rem 3.5rem;
  }
  .docs-prose h1 {
    font-size: 1.65rem;
  }
  .docs-prose h2 {
    font-size: 1.2rem;
  }
}
