/* ProFish Documentation — shared design system
   Same token names/values as the marketing site's inline <style> (index.html)
   so docs pages and the homepage always look like one product. */
:root {
  --bg-dark: #060d1b;
  --bg-card: #0c1829;
  --bg-card-hover: #111f36;
  --accent: #00cc99;
  --accent-glow: rgba(0, 204, 153, 0.12);
  --blue: #0080ff;
  --blue-glow: rgba(0, 128, 255, 0.12);
  --text: #e0e6ed;
  --text-muted: #7a8da6;
  --border: #1a2d4a;
  --white: #ffffff;
  --red: #ef5350;
  --gradient: linear-gradient(135deg, #00cc99 0%, #0080ff 100%);

  --sidebar-width: 264px;
  --topbar-height: 60px;
  --content-max: 780px;
  --radius: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.6;
}
a { color: inherit; }
img { max-width: 100%; display: block; }

/* ── Topbar ─────────────────────────────────────────── */
.docs-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--topbar-height);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  background: rgba(6, 13, 27, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
#topbar-menu-btn {
  display: none;
  background: none; border: none; color: var(--white);
  font-size: 1.4rem; cursor: pointer; padding: 4px 8px;
}
.topbar-logo {
  display: flex; align-items: center; gap: 8px;
  color: var(--white); text-decoration: none;
  font-weight: 800; font-size: 1.05rem; white-space: nowrap;
}
.topbar-logo span.accent { color: var(--accent); }
.topbar-logo .sep { color: var(--border); font-weight: 400; }
.topbar-logo .section-label { color: var(--text-muted); font-weight: 600; font-size: 0.95rem; }
.topbar-search-wrap { flex: 1; max-width: 420px; position: relative; }
#topbar-search {
  width: 100%; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 100px; padding: 9px 16px 9px 36px; color: var(--text);
  font-family: var(--font); font-size: 0.9rem; outline: none;
}
#topbar-search:focus { border-color: var(--accent); }
.topbar-search-wrap::before {
  content: "\1F50D"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 0.85rem; opacity: 0.6; pointer-events: none;
}
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  max-height: 360px; overflow-y: auto; display: none; z-index: 300;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.search-results.open { display: block; }
.search-result-item { display: block; padding: 12px 16px; text-decoration: none; border-bottom: 1px solid var(--border); }
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-card-hover); }
.search-result-item .srt { color: var(--white); font-weight: 600; font-size: 0.9rem; }
.search-result-item .srd { color: var(--text-muted); font-size: 0.8rem; margin-top: 2px; }
.search-empty { padding: 16px; color: var(--text-muted); font-size: 0.85rem; }
.topbar-right { margin-left: auto; white-space: nowrap; }
.topbar-right a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.topbar-right a:hover { color: var(--accent); }

/* ── Layout ─────────────────────────────────────────── */
.docs-layout { display: flex; padding-top: var(--topbar-height); min-height: 100vh; }
#sidebar-overlay {
  display: none; position: fixed; inset: 0; top: var(--topbar-height);
  background: rgba(0,0,0,0.6); z-index: 149;
}
#sidebar-overlay.open { display: block; }

.docs-sidebar {
  position: fixed; top: var(--topbar-height); left: 0; bottom: 0;
  width: var(--sidebar-width); overflow-y: auto;
  background: var(--bg-card); border-right: 1px solid var(--border);
  padding: 20px 0 60px; z-index: 150;
  transition: left 0.25s ease;
}
.sidebar-home-link {
  display: block; padding: 0 20px 16px; color: var(--text-muted);
  text-decoration: none; font-size: 0.85rem; font-weight: 600;
  border-bottom: 1px solid var(--border); margin-bottom: 8px;
}
.sidebar-home-link:hover { color: var(--accent); }
.sidebar-cat { border-bottom: 1px solid rgba(26,45,74,0.5); }
.sidebar-cat-btn {
  width: 100%; display: flex; align-items: center; gap: 10px;
  background: none; border: none; color: var(--text); font-family: var(--font);
  font-size: 0.88rem; font-weight: 600; text-align: left; cursor: pointer;
  padding: 10px 20px;
}
.sidebar-cat-btn:hover { color: var(--white); }
.sidebar-cat-btn .icon { font-size: 1rem; }
.sidebar-cat-btn .chev { margin-left: auto; font-size: 0.7rem; color: var(--text-muted); transition: transform 0.2s; }
.sidebar-cat.open .chev { transform: rotate(90deg); }
.sidebar-cat-pages { display: none; padding: 0 0 8px 44px; }
.sidebar-cat.open .sidebar-cat-pages { display: block; }
.sidebar-cat-pages a {
  display: block; padding: 6px 8px; color: var(--text-muted); text-decoration: none;
  font-size: 0.85rem; border-radius: 6px;
}
.sidebar-cat-pages a:hover { color: var(--white); background: var(--bg-card-hover); }
.sidebar-cat-pages a.active { color: var(--accent); font-weight: 600; background: var(--accent-glow); }

.docs-main { flex: 1; margin-left: var(--sidebar-width); min-width: 0; }
.docs-article { max-width: var(--content-max); margin: 0 auto; padding: 44px 32px 100px; }

/* ── Breadcrumbs ────────────────────────────────────── */
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 24px; }
.breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { opacity: 0.5; }
.breadcrumbs .current { color: var(--text); }

/* ── Article ────────────────────────────────────────── */
article h1 { font-size: 1.9rem; font-weight: 800; color: var(--white); margin-bottom: 12px; line-height: 1.2; }
.article-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-muted); font-size: 0.8rem; margin-bottom: 28px; }
article .lead { font-size: 1.08rem; color: var(--text); margin-bottom: 28px; }
article h2 { font-size: 1.3rem; font-weight: 700; color: var(--white); margin: 40px 0 14px; }
article h3 { font-size: 1.05rem; font-weight: 600; color: var(--white); margin: 24px 0 10px; }
article h4 { font-size: 0.92rem; font-weight: 600; color: var(--white); margin-bottom: 4px; }
article p { color: var(--text); margin-bottom: 14px; line-height: 1.8; }
article ul, article ol { margin: 0 0 16px 22px; color: var(--text); }
article li { margin-bottom: 8px; line-height: 1.7; }
article strong { color: var(--white); }
article a { color: var(--accent); text-decoration: none; }
article a:hover { text-decoration: underline; }

article table { width: 100%; border-collapse: collapse; margin: 8px 0 24px; font-size: 0.88rem; }
article th, article td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
article th { color: var(--white); font-weight: 700; background: var(--bg-card); }
article td { color: var(--text-muted); }
article tr:last-child td { border-bottom: none; }

/* ── Callouts ───────────────────────────────────────── */
.callout { border-left: 3px solid var(--accent); background: var(--bg-card); border-radius: 0 var(--radius) var(--radius) 0; padding: 14px 18px; margin: 20px 0; }
.callout-title { font-weight: 700; font-size: 0.85rem; margin-bottom: 4px; color: var(--white); }
.callout p:last-child { margin-bottom: 0; }
.callout.note { border-color: var(--blue); }
.callout.note .callout-title { color: var(--blue); }
.callout.tip { border-color: var(--accent); }
.callout.tip .callout-title { color: var(--accent); }
.callout.warning { border-color: var(--red); }
.callout.warning .callout-title { color: var(--red); }

/* ── Badges ─────────────────────────────────────────── */
.badge {
  display: inline-block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.4px; padding: 2px 9px; border-radius: 100px; vertical-align: middle;
}
.badge-free { background: rgba(0,204,153,0.15); color: var(--accent); }
.badge-pro { background: rgba(0,128,255,0.18); color: var(--blue); }
.badge-new { background: rgba(255,201,64,0.18); color: #ffc940; }
.badge-soon { background: rgba(122,141,166,0.2); color: var(--text-muted); }

/* ── Steps ──────────────────────────────────────────── */
ol.steps { list-style: none; margin: 20px 0; counter-reset: step-counter; }
ol.steps > li {
  counter-increment: step-counter; position: relative;
  padding: 2px 0 22px 40px; margin: 0;
}
ol.steps > li::before {
  content: counter(step-counter); position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 50%; background: var(--gradient);
  color: var(--white); font-weight: 700; font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
}
ol.steps > li:not(:last-child)::after {
  content: ""; position: absolute; left: 13px; top: 26px; bottom: 0;
  width: 2px; background: var(--border);
}
ol.steps h4 { margin-bottom: 4px; }
ol.steps p { margin-bottom: 0; }

/* ── Comparison table variant ───────────────────────── */
.comp-table .profish-col { background: var(--accent-glow); }
.comp-table th.profish-col, .comp-table td.profish-col { color: var(--white); font-weight: 600; }

/* ── FAQ dl pattern (embedded mini-FAQ on content pages) ── */
dl.faq-list dt { font-weight: 700; color: var(--white); margin-top: 18px; font-size: 0.98rem; }
dl.faq-list dd { color: var(--text-muted); margin: 6px 0 0; }

/* ── Key Facts (scannable quick-answer block, machine-extractable summary) ── */
.key-facts {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 22px; margin: 20px 0 28px;
}
.key-facts-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--accent); margin-bottom: 10px; }
.key-facts dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.key-facts dt { color: var(--text-muted); font-size: 0.88rem; font-weight: 500; }
.key-facts dd { color: var(--white); font-size: 0.88rem; font-weight: 600; margin: 0; }
@media (max-width: 640px) {
  .key-facts dl { grid-template-columns: 1fr; gap: 2px 0; }
  .key-facts dd { margin-bottom: 8px; }
}

/* ── Related / pagination ───────────────────────────── */
.related-links { list-style: none; margin: 0; }
.related-links li { margin-bottom: 8px; }
.related-links a { color: var(--accent); text-decoration: none; font-size: 0.95rem; }
.related-links a:hover { text-decoration: underline; }

.docs-pagination { display: flex; gap: 16px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
.pagination-link {
  flex: 1; display: block; padding: 14px 18px; border: 1px solid var(--border);
  border-radius: var(--radius); text-decoration: none; transition: border-color 0.2s;
}
.pagination-link:hover { border-color: var(--accent); }
.pagination-link .dir { color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; }
.pagination-link .title { color: var(--white); font-weight: 600; font-size: 0.92rem; margin-top: 2px; }
.pagination-link.next { text-align: right; }

/* ── Docs home ──────────────────────────────────────── */
.docs-home-layout { padding-top: var(--topbar-height); }
.docs-hero { padding: 64px 24px 40px; text-align: center; max-width: 720px; margin: 0 auto; }
.docs-hero h1 { font-size: 2.1rem; font-weight: 800; color: var(--white); margin-bottom: 12px; }
.docs-hero p { color: var(--text-muted); font-size: 1.05rem; }
.docs-home-search { max-width: 520px; margin: 28px auto 0; position: relative; }
.docs-home-search input {
  width: 100%; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 100px; padding: 14px 20px 14px 44px; color: var(--text);
  font-family: var(--font); font-size: 0.95rem; outline: none;
}
.docs-home-search input:focus { border-color: var(--accent); }
.docs-home-search::before {
  content: "\1F50D"; position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  opacity: 0.6;
}
.docs-section { max-width: 1100px; margin: 0 auto; padding: 40px 24px; }
.docs-section h2 { font-size: 1.4rem; font-weight: 800; color: var(--white); margin-bottom: 20px; }
.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.category-card, .start-card {
  display: block; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px; text-decoration: none; transition: transform 0.2s, border-color 0.2s;
}
.category-card:hover, .start-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.start-card { background: linear-gradient(160deg, var(--accent-glow), var(--bg-card) 60%); }
.category-card .cc-icon, .start-card .cc-icon { font-size: 1.6rem; margin-bottom: 10px; }
.category-card .cc-title, .start-card .cc-title { color: var(--white); font-weight: 700; font-size: 0.98rem; margin-bottom: 4px; }
.category-card .cc-desc, .start-card .cc-desc { color: var(--text-muted); font-size: 0.85rem; }
.docs-footer-cta {
  max-width: 1100px; margin: 20px auto 60px; padding: 28px 24px;
  border-top: 1px solid var(--border); text-align: center;
}
.docs-footer-cta p { color: var(--text-muted); margin-bottom: 12px; }
.docs-footer-cta .links a { color: var(--accent); text-decoration: none; margin: 0 8px; font-size: 0.9rem; }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 900px) {
  #topbar-menu-btn { display: block; }
  .docs-sidebar { left: -264px; box-shadow: 0 0 40px rgba(0,0,0,0.5); }
  .docs-sidebar.open { left: 0; }
  .docs-main { margin-left: 0; }
  .topbar-search-wrap { display: none; }
}
@media (max-width: 640px) {
  .docs-article { padding: 32px 20px 70px; }
  article h1 { font-size: 1.55rem; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .docs-pagination { flex-direction: column; }
  .pagination-link.next { text-align: left; }
}
