@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── Variables ──────────────────────────────────────────── */
:root {
  --bg:        #0d0d10;
  --surface:   #131316;
  --surface-2: #191920;
  --surface-3: #1e1e26;

  --border:        rgba(255,255,255,.07);
  --border-strong: rgba(255,255,255,.12);

  --accent:      #CC252A;
  --accent-dim:  rgba(204,37,42,.09);
  --accent-text: #f87171;

  --text:   #f1f1f3;
  --text-2: #9f9fa6;
  --text-3: #4f4f58;

  --success: #22c55e;
  --danger:  #ef4444;
  --warning: #eab308;
  --tip:     #a855f7;

  --code-bg: #0e0e12;

  --font:      'Inter', system-ui, sans-serif;
  --mono:      'JetBrains Mono', 'Fira Code', monospace;
  --sidebar-w: 256px;
  --toc-w:     216px;
  --radius:    8px;
  --radius-sm: 5px;
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.14); }

/* ─── Sidebar ────────────────────────────────────────────── */
#sidebar {
  position: fixed;
  left: 0; top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 60;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 18px 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  transition: background .15s;
}
.sidebar-logo:hover { background: var(--surface-2); }

.sidebar-logo img {
  width: 30px; height: 30px;
  object-fit: contain;
  border-radius: 7px;
  flex-shrink: 0;
}

.logo-name    { font-size: .875rem; font-weight: 700; color: var(--text); display: block; letter-spacing: -.2px; }
.logo-version { font-size: .64rem; color: var(--text-3); display: block; margin-top: 1px; }

.sidebar-nav { padding: 8px 0 16px; flex: 1; overflow-y: auto; }

.nav-group { margin-bottom: 2px; }
.nav-group-label {
  font-size: .59rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.3px;
  /* texto a 18px del borde del sidebar */
  color: var(--text-3); padding: 12px 18px 5px;
}

.nav-link {
  display: flex;
  align-items: center;
  /* margin 6px cada lado → fondo del pill arranca a 6px */
  /* padding 12px izq → texto a 6+12 = 18px (igual que label) */
  padding: 6px 12px;
  margin: 0 6px 1px;
  font-size: .84rem; font-weight: 400;
  color: var(--text-2);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color .12s, background .12s;
}
.nav-link:hover        { color: var(--text); background: var(--surface-2); }
.nav-link.current-page { color: var(--text); }
.nav-link.active       {
  color: var(--accent-text);
  background: var(--accent-dim);
  font-weight: 500;
}

/* ─── Sidebar social footer ──────────────────────────────── */
.sidebar-socials {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.sidebar-social-link {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  text-decoration: none;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color .12s, background .12s;
}
.sidebar-social-link:hover { color: var(--text-2); background: var(--surface-2); }
.sidebar-social-link svg   { width: 16px; height: 16px; display: block; }

.sidebar-views {
  margin-left: auto;
  display: flex; align-items: center; gap: 4px;
  font-size: .72rem; color: var(--text-3);
  font-family: var(--mono);
}
.sidebar-views svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ─── Main content area ──────────────────────────────────── */
#main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Right TOC ─────────────────────────────────────────── */
#toc {
  position: fixed;
  right: 0; top: 0;
  width: var(--toc-w);
  height: 100vh;
  overflow-y: auto;
  padding: 32px 16px 24px;
  border-left: 1px solid var(--border);
  display: none;
  background: var(--bg);
  flex-shrink: 0;
}
@media (min-width: 1360px) {
  #toc  { display: block; }
  #main { margin-right: var(--toc-w); }
}

.toc-label {
  font-size: .59rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.3px;
  color: var(--text-3); margin-bottom: 10px; padding-left: 8px;
}
.toc-nav { display: flex; flex-direction: column; gap: 1px; }
.toc-nav a {
  display: block;
  font-size: .78rem; color: var(--text-3);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  line-height: 1.5;
  transition: color .12s, background .12s;
}
.toc-nav a:hover  { color: var(--text-2); background: var(--surface); }
.toc-nav a.active { color: var(--accent-text); background: var(--accent-dim); font-weight: 500; }

/* ─── Page header ────────────────────────────────────────── */
.page-header {
  padding: 52px max(48px, calc(50% - 360px)) 40px;
  border-bottom: 1px solid var(--border);
}

.breadcrumb {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: .72rem; color: var(--text-3);
  margin-bottom: 20px; flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-3); text-decoration: none; transition: color .12s; }
.breadcrumb a:hover { color: var(--text-2); }
.breadcrumb-sep { opacity: .4; }
.breadcrumb-current { color: var(--text-2); }

.page-header h1 {
  font-size: 2rem; font-weight: 700;
  color: var(--text); letter-spacing: -.5px; line-height: 1.2;
  margin-bottom: 14px;
  text-align: center;
}
.page-header p {
  font-size: .97rem; color: var(--text-2);
  line-height: 1.85; margin: 0;
  text-align: center;
}

/* ─── Content ────────────────────────────────────────────── */
.content {
  padding: 48px max(48px, calc(50% - 360px)) 64px;
  flex: 1;
}

/* ─── Sections & Headings ───────────────────────────────── */
section { margin-bottom: 56px; }

h2 {
  font-size: 1.1rem; font-weight: 600;
  color: var(--text); letter-spacing: -.2px;
  margin-bottom: 22px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 72px;
}

h3 {
  font-size: .95rem; font-weight: 600;
  color: var(--text); margin: 28px 0 11px;
  scroll-margin-top: 72px;
}
h3:first-child { margin-top: 0; }

h4 {
  font-size: .7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-3); margin: 22px 0 9px;
}

p { color: var(--text-2); margin-bottom: 14px; line-height: 1.85; }
p:last-child { margin-bottom: 0; }
strong  { color: var(--text); font-weight: 600; }
a       { color: var(--accent-text); text-decoration: none; transition: color .12s; }
a:hover { color: #fca5a5; text-decoration: underline; }
ul, ol  { padding-left: 1.5em; color: var(--text-2); }
li      { margin-bottom: 5px; line-height: 1.8; }

/* ─── Inline code ────────────────────────────────────────── */
code {
  font-family: var(--mono); font-size: .8em;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 4px; padding: 2px 5px;
  color: #e2e8f0;
}

/* Inline code inside table cells — sin cuadrito, solo colores Java */
td > code, th > code {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  font-size: .85em;
  border-radius: 0;
}

/* ─── Code blocks — highlight.js renders inside ──────────── */
pre {
  background: var(--code-bg) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  padding: 0 !important;  /* highlight.js adds its own */
}

pre code {
  display: block;
  font-family: var(--mono) !important;
  font-size: .83rem !important;
  line-height: 1.7;
  padding: 20px 22px !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  overflow-x: auto;
  color: inherit;
}

/* ─── Tables ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin-bottom: 20px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .855rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

thead th {
  background: var(--surface-2);
  padding: 10px 16px;
  text-align: left;
  font-size: .68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .9px;
  color: var(--text-3);
  border-bottom: 1px solid var(--border-strong);
}

tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface); }
tbody td { padding: 10px 16px; color: var(--text-2); vertical-align: top; }
tbody td:first-child { color: var(--text); font-weight: 500; }

/* ─── Asides (callouts) ──────────────────────────────────── */
.aside {
  padding: 14px 18px;
  border-left: 3px solid;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 20px;
}
.aside-title {
  font-size: .69rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .9px;
  margin-bottom: 6px;
}
.aside p { margin: 0; font-size: .875rem; line-height: 1.7; }
.aside a { font-weight: 500; }

.aside-note    { border-color: var(--accent); background: rgba(204,37,42,.06); }
.aside-note    .aside-title { color: var(--accent-text); }
.aside-note    p { color: #fca5a5; }
.aside-note    a { color: var(--accent-text); }

.aside-tip     { border-color: var(--tip); background: rgba(168,85,247,.06); }
.aside-tip     .aside-title { color: #c084fc; }
.aside-tip     p { color: #d8b4fe; }

.aside-caution { border-color: var(--warning); background: rgba(234,179,8,.06); }
.aside-caution .aside-title { color: #fbbf24; }
.aside-caution p { color: #fde68a; }
.aside-caution a { color: #fbbf24; }

.aside-danger  { border-color: var(--danger); background: rgba(239,68,68,.06); }
.aside-danger  .aside-title { color: #fca5a5; }
.aside-danger  p { color: #fecaca; }

/* ─── Command blocks ─────────────────────────────────────── */
.cmd {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden; margin-bottom: 22px;
  transition: border-color .15s;
}
.cmd:hover { border-color: var(--border-strong); }

.cmd-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 9px 16px;
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.cmd-title {
  font-family: var(--mono); font-size: .81rem;
  font-weight: 500; color: var(--text);
}

.badge {
  font-size: .62rem; font-weight: 600;
  letter-spacing: .3px; padding: 2px 8px;
  border-radius: 99px; white-space: nowrap;
  font-family: var(--font);
}
.badge-mod  { background: var(--accent-dim); color: var(--accent-text); border: 1px solid rgba(204,37,42,.22); }
.badge-perm { background: rgba(234,179,8,.08); color: #fbbf24; border: 1px solid rgba(234,179,8,.18); }

.cmd-body       { padding: 14px 16px; background: var(--code-bg); }
.cmd-body .desc { font-size: .875rem; margin-bottom: 10px; color: var(--text-2); }
.cmd-body pre   { margin-bottom: 0; }

/* ─── Steps ─────────────────────────────────────────────── */
.steps { list-style: none; counter-reset: step; padding: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 30px 50px;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 1px;
  width: 30px; height: 30px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  font-size: .74rem; font-weight: 700;
  color: var(--accent-text);
  display: flex; align-items: center; justify-content: center;
}
.steps li::after {
  content: '';
  position: absolute; left: 14px; top: 31px; bottom: 0;
  width: 1px; background: var(--border);
}
.steps li:last-child::after { display: none; }
.step-title { font-size: .92rem; font-weight: 600; color: var(--text); line-height: 30px; margin-bottom: 4px; }
.steps li p { font-size: .875rem; }

/* ─── Feature grid ──────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px; margin-bottom: 26px;
}
.feature {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  background: var(--surface);
  transition: border-color .15s, background .15s;
}
.feature:hover { border-color: var(--border-strong); background: var(--surface-2); }
.feature-title { font-size: .875rem; font-weight: 600; color: var(--text); margin-bottom: 7px; }
.feature-desc  { font-size: .81rem; color: var(--text-2); line-height: 1.65; margin: 0; }
.feature .mod-badge { display: block; margin-top: 10px; }

/* ─── Debug pages ───────────────────────────────────────── */
.debug-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px; margin-bottom: 16px;
}
.debug-page {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  background: var(--surface);
  transition: border-color .15s;
}
.debug-page:hover { border-color: var(--border-strong); }
.dp-num   { font-size: .61rem; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--accent-text); margin-bottom: 3px; }
.dp-title { font-size: .875rem; font-weight: 600; color: var(--text); margin-bottom: 7px; }
.debug-page ul { list-style: none; padding: 0; }
.debug-page ul li { font-size: .77rem; color: var(--text-2); padding: 2px 0; line-height: 1.5; }
.debug-page ul li::before { content: '–'; color: var(--text-3); margin-right: 6px; }

/* ─── Config blocks ─────────────────────────────────────── */
.config-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden; margin-bottom: 16px;
}
.config-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  font-family: var(--mono); font-size: .77rem;
  color: var(--text-2);
}
.config-header strong { color: var(--text); font-weight: 500; }
.config-block pre { border: none; border-radius: 0; margin: 0; }

/* ─── Inline badges ─────────────────────────────────────── */
.mod-badge {
  display: inline-block; font-size: .61rem;
  font-weight: 600; letter-spacing: .3px;
  padding: 1px 7px; border-radius: 99px;
  background: var(--accent-dim);
  color: var(--accent-text);
  border: 1px solid rgba(204,37,42,.22);
  font-family: var(--font);
}

.tag {
  display: inline-block; font-size: .61rem; font-weight: 600;
  padding: 1px 6px; border-radius: 99px;
  vertical-align: middle; margin-left: 3px;
}
.tag-op { background: rgba(234,179,8,.08); color: #fbbf24; border: 1px solid rgba(234,179,8,.18); }

.rk { font-family: var(--mono); color: var(--text); font-size: .82rem; font-weight: 500; }

/* ─── Quick links ───────────────────────────────────────── */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 8px; margin-top: 12px;
}
.quick-link {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-decoration: none;
  background: var(--surface);
  display: block;
  transition: border-color .15s, background .15s;
}
.quick-link:hover {
  border-color: rgba(204,37,42,.35);
  background: var(--surface-2);
  text-decoration: none;
}
.ql-label { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .9px; color: var(--text-3); display: block; margin-bottom: 5px; }
.ql-title { font-size: .9rem; font-weight: 600; color: var(--text); display: block; }
.ql-desc  { font-size: .79rem; color: var(--text-2); display: block; margin-top: 3px; }

/* ─── HR ────────────────────────────────────────────────── */
hr { border: none; border-top: 1px solid var(--border); margin: 36px 0; }



/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  #sidebar { display: none; }
  #main    { margin-left: 0; }
  .page-header { padding-left: 22px; padding-right: 22px; }
  .content { padding-left: 22px; padding-right: 22px; }
}
