/* DOCS-SPECIFIC STYLES (extends portal.css) */

.docs-body { background: var(--bg); }

/* BREADCRUMB */
.breadcrumb {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text3);
}
.breadcrumb-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 2.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text2); text-decoration: none; transition: color 0.15s; }
.breadcrumb a:hover { color: var(--accent); }
.bc-sep { color: var(--text3); opacity: 0.5; }
.bc-current { color: var(--accent); }

/* MOBILE TOC TOGGLE */
.mobile-toc-toggle {
  display: none;
  position: sticky;
  top: 72px;
  z-index: 90;
  margin: 1rem auto 0;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border2);
  padding: 8px 18px;
  border-radius: 20px;
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
}

/* LAYOUT */
.docs-layout {
  max-width: 1600px;
  margin: 0 auto;
  padding: 2rem 2.5rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* SIDEBAR */
.toc {
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 0.75rem 1.25rem 1.25rem;
}
.toc-header { padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.toc-kicker {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.15em;
}
.toc-header h3 {
  font-size: 14px;
  font-weight: 600;
  margin-top: 2px;
  color: var(--text);
}
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.toc-list li { margin: 0; }
.toc-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin: 1px 0;
  font-size: 12px;
  color: var(--text2);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: all 0.15s;
}
.toc-list a:hover { background: var(--bg3); color: var(--text); }
.toc-list a.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}
.toc-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  flex-shrink: 0;
  width: 18px;
}
.toc-list a.active .toc-num { color: var(--accent); }

/* Scrollbar slim */
.toc::-webkit-scrollbar { width: 6px; }
.toc::-webkit-scrollbar-track { background: transparent; }
.toc::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* CONTENT */
.docs-content {
  min-width: 0;
}
.docs-hero {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.docs-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 6px 0 12px;
}
.docs-hero-desc {
  font-size: 15px;
  color: var(--text2);
  max-width: 760px;
  line-height: 1.7;
}

/* CHAPTERS */
.chapter {
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 90px;
}
.chapter:last-child { border-bottom: none; }
.ch-header { margin-bottom: 1rem; }
.ch-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text3);
  letter-spacing: 0.15em;
}
.chapter h2 {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 4px;
  color: var(--text);
}
.chapter h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 1.75rem 0 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.chapter h3:first-of-type { border-top: none; padding-top: 0; }
.chapter p {
  font-size: 14.5px;
  color: var(--text2);
  line-height: 1.75;
  margin-bottom: 1rem;
  max-width: 850px;
}
.chapter p strong { color: var(--text); font-weight: 600; }
.chapter p code, .chapter li code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--bg3);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.inline-link {
  color: var(--accent2);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent2);
}
.inline-link:hover { border-bottom-style: solid; }

/* TABLES */
.table-wrap {
  overflow-x: auto;
  margin: 0.75rem 0 1rem;
  border: 2px solid var(--border2);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
:root.light .table-wrap { box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--bg2);
}
.data-table thead {
  background: var(--bg3);
}
.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg3); }
.data-table td strong { color: var(--accent); }

/* VLAN PILL */
.vlan-pill {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 12px;
  border: 1px solid rgba(0,201,167,0.25);
  min-width: 28px;
  text-align: center;
}
:root.light .vlan-pill { border-color: rgba(0,137,111,0.3); }

/* BADGES */
.badge-on, .badge-off {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
}
.badge-on {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(0,201,167,0.25);
}
.badge-off {
  background: rgba(139,143,168,0.1);
  color: var(--text2);
  border: 1px solid var(--border2);
}

/* BULLET LIST */
.bullet-list {
  padding-left: 1.2rem;
  margin-bottom: 1rem;
  color: var(--text2);
  font-size: 14px;
  line-height: 1.85;
}
.bullet-list li { padding-left: 4px; }
.bullet-list strong { color: var(--text); }

/* CODE BLOCKS */
.chapter pre {
  background: #0d1117 !important;
  border: 2px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem !important;
  overflow-x: auto;
  margin: 0.5rem 0 1rem;
  font-size: 13px;
  line-height: 1.55;
  position: relative;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.chapter pre code {
  font-family: var(--mono) !important;
  color: #e8eaf0 !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  white-space: pre;
  font-size: 12.5px;
}
/* Override Prism colors — DARK theme (default) */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #6a9955 !important; font-style: italic; }
.token.punctuation { color: #a0a4b8 !important; }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol { color: #b5cea8 !important; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin { color: #ce9178 !important; }
.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string { color: #d4d4d4 !important; }
.token.keyword, .token.function-name { color: #569cd6 !important; }
.token.function { color: #4ec9b0 !important; }
.token.regex, .token.important, .token.variable { color: #d7ba7d !important; }

/* LIGHT theme — code blocks match site theme */
:root.light .chapter pre {
  background: #f6f8fa !important;
  border-color: rgba(0,0,0,0.22);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
:root.light .chapter pre code { color: #1f2328 !important; }
:root.light .token.comment,
:root.light .token.prolog,
:root.light .token.doctype,
:root.light .token.cdata { color: #6a737d !important; font-style: italic; }
:root.light .token.punctuation { color: #24292e !important; }
:root.light .token.property,
:root.light .token.tag,
:root.light .token.boolean,
:root.light .token.number,
:root.light .token.constant,
:root.light .token.symbol { color: #005cc5 !important; }
:root.light .token.selector,
:root.light .token.attr-name,
:root.light .token.string,
:root.light .token.char,
:root.light .token.builtin { color: #032f62 !important; }
:root.light .token.operator,
:root.light .token.entity,
:root.light .token.url { color: #24292e !important; }
:root.light .token.keyword,
:root.light .token.function-name { color: #d73a49 !important; }
:root.light .token.function { color: #6f42c1 !important; }
:root.light .token.regex,
:root.light .token.important,
:root.light .token.variable { color: #e36209 !important; }

/* INFO CARDS */
.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin: 0.5rem 0 1rem;
}
.info-card {
  background: var(--bg2);
  border: 2px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.info-card-title {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.info-card-host {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text2);
}
.info-card code {
  font-family: var(--mono) !important;
  font-size: 12.5px !important;
  color: var(--accent) !important;
  background: var(--bg3) !important;
  padding: 4px 8px !important;
  border-radius: 4px;
  border: 1px solid var(--border) !important;
  margin-top: 2px;
  word-break: break-all;
}

/* CALLOUT */
.callout {
  background: var(--accent2-dim);
  border: 2px solid rgba(0,152,255,0.4);
  border-left: 5px solid var(--accent2);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text);
  margin: 1rem 0;
  line-height: 1.65;
  box-shadow: 0 1px 4px rgba(0,152,255,0.08);
}
:root.light .callout { border-color: rgba(0,98,200,0.35); }
.callout strong { color: var(--accent2); }
.callout code { color: var(--accent2) !important; }

/* TEST BLOCK */
.test-block {
  background: var(--bg2);
  border: 2px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin: 0.5rem 0 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.test-block h3 {
  border-top: none !important;
  padding-top: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 8px !important;
  font-size: 12px;
  color: var(--text2) !important;
}
.test-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.9;
  color: var(--text);
}
.test-ok { color: var(--accent); margin-right: 8px; }
.test-block-fail { color: var(--accent3); margin-right: 8px; }

/* BACK TO TOP */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #001a14;
  border: none;
  cursor: pointer;
  font-size: 20px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.2s;
  z-index: 95;
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}
.back-to-top:hover { transform: translateY(-2px); }

/* NAV ACTIVE */
.nav-links a.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: rgba(0,201,167,0.25);
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .docs-layout {
    grid-template-columns: 1fr;
    padding: 1rem;
    gap: 1rem;
  }
  .mobile-toc-toggle { display: block; }
  .toc {
    position: fixed;
    top: 0;
    left: 0;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border-right: 1px solid var(--border2);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 110;
    box-shadow: 4px 0 20px rgba(0,0,0,0.3);
  }
  .toc.open { transform: translateX(0); }
  .breadcrumb-inner { padding: 0 1rem; }
  .back-to-top { bottom: 16px; right: 16px; }
}
