/* ==========================================================================
   ProHunt Documentation — Shared Stylesheet
   Matches the main site design tokens. Supports sidebar docs layout and
   full-width docs home layout.
   ========================================================================== */

/* --- Variables ------------------------------------------------------------ */
:root {
  --bg-dark: #0a1208;
  --bg-card: #111d0f;
  --bg-card-hover: #1a2b16;
  --accent: #4caf50;
  --accent-glow: rgba(76, 175, 80, 0.12);
  --amber: #f59e0b;
  --text: #d4ddd0;
  --text-muted: #7a9172;
  --border: #1e3a1a;
  --white: #ffffff;
  --red: #ef5350;
  --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;
}

/* --- Reset ---------------------------------------------------------------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* --- Top Bar ------------------------------------------------------------- */
.docs-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-height);
  background: rgba(10, 18, 8, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
}

.topbar-logo {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--white);
  text-decoration: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}
.topbar-logo .logo-accent { color: var(--accent); }
.topbar-logo .topbar-separator { color: var(--border); margin: 0 10px; font-weight: 300; font-size: 1.3rem; line-height: 1; }
.topbar-logo .topbar-section { color: var(--text-muted); font-weight: 500; font-size: 0.95rem; }

.topbar-search-wrap {
  flex: 1;
  max-width: 420px;
  position: relative;
}
.topbar-search {
  width: 100%;
  padding: 7px 14px 7px 34px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.topbar-search:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
.topbar-search::placeholder { color: var(--text-muted); }
.topbar-search-icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 13px;
  line-height: 1;
}

/* Search results dropdown (shared) */
.search-results {
  position: absolute;
  top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 380px;
  overflow-y: auto;
  z-index: 300;
  display: none;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.search-results.visible { display: block; }
.search-result-item {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: background 0.15s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover, .search-result-item:focus { background: var(--bg-card-hover); outline: none; }
.search-result-title { color: var(--white); font-size: 0.875rem; font-weight: 600; }
.search-result-desc { color: var(--text-muted); font-size: 0.78rem; margin-top: 3px; line-height: 1.4; }
.search-result-cat {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  margin-top: 4px;
}
.search-no-results { padding: 20px 16px; color: var(--text-muted); font-size: 0.875rem; text-align: center; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}
.topbar-site-link {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 5px;
  transition: color 0.2s, background 0.2s;
}
.topbar-site-link:hover { color: var(--accent); background: var(--accent-glow); }

.topbar-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text);
  font-size: 16px;
  padding: 6px 8px;
  border-radius: 5px;
  line-height: 1;
  transition: border-color 0.2s;
}
.topbar-menu-btn:hover { border-color: var(--accent); }

/* --- Sidebar Layout ------------------------------------------------------ */
.docs-layout {
  display: flex;
  padding-top: var(--topbar-height);
  min-height: 100vh;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 185;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }

/* --- Sidebar ------------------------------------------------------------- */
.docs-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: fixed;
  top: var(--topbar-height); left: 0; bottom: 0;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 12px 0 60px;
  background: rgba(10, 18, 8, 0.97);
  z-index: 190;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-home-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  transition: color 0.2s;
}
.sidebar-home-link:hover { color: var(--accent); }

.sidebar-category { margin-bottom: 1px; }

.sidebar-cat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 18px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  transition: color 0.2s, background 0.15s;
  text-align: left;
  border-radius: 0;
}
.sidebar-cat-btn:hover { color: var(--text); background: rgba(255,255,255,0.02); }
.sidebar-cat-btn.active { color: var(--accent); }
.sidebar-cat-icon { margin-right: 7px; font-size: 0.85rem; }
.sidebar-cat-chevron {
  font-style: normal;
  font-size: 9px;
  color: var(--border);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.sidebar-category.open .sidebar-cat-chevron { transform: rotate(90deg); color: var(--text-muted); }

.sidebar-pages { display: none; padding: 2px 0 6px; }
.sidebar-category.open .sidebar-pages { display: block; }

.sidebar-page-link {
  display: block;
  padding: 6px 18px 6px 40px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.84rem;
  transition: color 0.15s, background 0.15s;
  position: relative;
}
.sidebar-page-link::before {
  content: '';
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.15s;
}
.sidebar-page-link:hover { color: var(--text); }
.sidebar-page-link:hover::before { background: var(--text-muted); }
.sidebar-page-link.active {
  color: var(--accent);
  background: var(--accent-glow);
  font-weight: 500;
}
.sidebar-page-link.active::before { background: var(--accent); }

.sidebar-coming-soon {
  display: flex;
  align-items: center;
  padding: 6px 18px 6px 40px;
  color: var(--border);
  font-size: 0.78rem;
  gap: 8px;
}
.coming-soon-badge {
  font-size: 0.62rem;
  background: rgba(76,175,80,0.08);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border: 1px solid rgba(76,175,80,0.2);
}

/* --- Main Content -------------------------------------------------------- */
.docs-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  padding: 44px 52px 100px;
}

.docs-article { max-width: var(--content-max); }

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
  font-size: 0.78rem;
}
.breadcrumbs a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { color: var(--border); user-select: none; }
.breadcrumbs .current { color: var(--text); }

/* Article typography */
.docs-article h1 {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 10px;
}
.article-meta {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.docs-article h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
  margin: 44px 0 12px;
  scroll-margin-top: 80px;
}
.docs-article h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white);
  margin: 28px 0 8px;
  scroll-margin-top: 80px;
}
.docs-article h4 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  margin: 20px 0 6px;
}
.docs-article p { margin-bottom: 16px; line-height: 1.8; }
.docs-article a { color: var(--accent); text-decoration: none; }
.docs-article a:hover { text-decoration: underline; }
.docs-article ul, .docs-article ol { margin: 8px 0 20px 24px; line-height: 1.8; }
.docs-article li { margin-bottom: 5px; }
.docs-article li:last-child { margin-bottom: 0; }
.docs-article strong { color: var(--white); font-weight: 600; }
.docs-article em { font-style: italic; color: var(--text); }
.docs-article hr { border: none; border-top: 1px solid var(--border); margin: 36px 0; }

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 0.83em;
  background: rgba(76,175,80,0.08);
  border: 1px solid rgba(76,175,80,0.2);
  border-radius: 4px;
  padding: 2px 6px;
  color: #a5d6a7;
  white-space: nowrap;
}
pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  margin: 16px 0 24px;
}
pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.75;
  white-space: pre;
}

/* Tables */
.docs-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 0.88rem;
  overflow-x: auto;
  display: block;
}
.docs-article th {
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.docs-article td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
}
.docs-article tr:last-child td { border-bottom: none; }
.docs-article tr:hover td { background: rgba(255,255,255,0.01); }

/* Callout boxes */
.callout {
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 20px 0 24px;
  border-left: 3px solid;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.callout-icon { font-size: 1rem; flex-shrink: 0; margin-top: 2px; }
.callout-body { flex: 1; min-width: 0; }
.callout-body p { margin-bottom: 0; font-size: 0.9rem; }
.callout-body p + p { margin-top: 6px; }
.callout-title { font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px; }
.callout.note { background: rgba(76,175,80,0.07); border-color: var(--accent); }
.callout.note .callout-title { color: var(--accent); }
.callout.tip { background: rgba(245,158,11,0.07); border-color: var(--amber); }
.callout.tip .callout-title { color: var(--amber); }
.callout.warning { background: rgba(239,83,80,0.07); border-color: var(--red); }
.callout.warning .callout-title { color: var(--red); }

/* Numbered steps */
.steps { margin: 20px 0 28px; padding: 0; list-style: none; counter-reset: step-counter; }
.steps > li {
  counter-increment: step-counter;
  position: relative;
  padding: 0 0 28px 52px;
}
.steps > li:not(:last-child) {
  border-left: 2px solid var(--border);
  margin-left: 14px;
}
.steps > li:last-child { padding-left: 52px; margin-left: 14px; }
.steps > li::before {
  content: counter(step-counter);
  position: absolute;
  left: -14px;
  top: 0;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: #0a1208;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  flex-shrink: 0;
  line-height: 1;
}
.steps > li h4 { margin-top: 2px; font-size: 0.95rem; color: var(--white); }
.steps > li p { margin-top: 6px; font-size: 0.88rem; }

/* Badges */
.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  vertical-align: middle;
  line-height: 1.6;
}
.badge-pro { background: rgba(245,158,11,0.12); color: var(--amber); border: 1px solid rgba(245,158,11,0.3); }
.badge-free { background: rgba(76,175,80,0.12); color: var(--accent); border: 1px solid rgba(76,175,80,0.3); }
.badge-new { background: rgba(100,149,237,0.12); color: #90b4f0; border: 1px solid rgba(100,149,237,0.3); }

/* Feature comparison row */
.feature-row-inline {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.feature-row-inline:last-child { border-bottom: none; }
.feature-check { color: var(--accent); font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.feature-cross { color: var(--border); font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

/* --- Pagination ---------------------------------------------------------- */
.docs-pagination {
  display: flex;
  gap: 16px;
  margin-top: 72px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.pagination-link {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
  flex: 1;
  min-width: 0;
}
.pagination-link:hover { border-color: var(--accent); background: var(--accent-glow); }
.pagination-link.next { text-align: right; }
.pagination-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.pagination-title { color: var(--white); font-weight: 600; font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- Docs Home Layout ---------------------------------------------------- */
.docs-home-layout { padding-top: var(--topbar-height); min-height: 100vh; }

.docs-home-hero {
  text-align: center;
  padding: 72px 24px 52px;
  max-width: 680px;
  margin: 0 auto;
}
.docs-home-hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.04em;
  margin-bottom: 14px;
  line-height: 1.15;
}
.docs-home-hero h1 span { color: var(--accent); }
.docs-home-hero > p { color: var(--text-muted); font-size: 1.05rem; margin-bottom: 36px; line-height: 1.6; }

.home-search-wrap { max-width: 540px; margin: 0 auto; position: relative; }
.home-search {
  width: 100%;
  padding: 14px 20px 14px 46px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.home-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.home-search::placeholder { color: var(--text-muted); }
.home-search-icon {
  position: absolute;
  left: 15px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 18px;
  pointer-events: none;
  line-height: 1;
}

/* Start here cards */
.docs-start-here {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  max-width: 960px;
  margin: 0 auto 60px;
  padding: 0 24px;
}
.start-card {
  display: block;
  padding: 22px 20px;
  background: linear-gradient(135deg, rgba(76,175,80,0.08) 0%, rgba(76,175,80,0.04) 100%);
  border: 1px solid rgba(76,175,80,0.25);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}
.start-card:hover { border-color: var(--accent); transform: translateY(-2px); background: rgba(76,175,80,0.12); }
.start-icon { font-size: 1.6rem; margin-bottom: 10px; }
.start-title { font-weight: 700; font-size: 0.95rem; color: var(--white); margin-bottom: 5px; }
.start-desc { color: var(--text-muted); font-size: 0.8rem; line-height: 1.45; }

/* Categories section */
.docs-categories-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 80px;
}
.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 48px;
}
.category-card {
  display: block;
  padding: 18px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.category-card:not(.cat-soon):hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}
.category-card.cat-soon { cursor: default; opacity: 0.45; }
.cat-icon { font-size: 1.35rem; margin-bottom: 8px; display: block; }
.cat-title {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--white);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cat-desc { color: var(--text-muted); font-size: 0.77rem; line-height: 1.4; }
.cat-soon-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* --- In-article screenshots ---------------------------------------------- */
.docs-screenshot {
  margin: 32px auto;
  text-align: center;
}
.docs-screenshot img {
  max-width: 360px;
  width: 100%;
  border-radius: 18px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.45), 0 1px 4px rgba(0,0,0,0.3);
  display: block;
  margin: 0 auto;
}
.docs-screenshot figcaption {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
  .docs-sidebar {
    left: calc(-1 * var(--sidebar-width));
    transition: left 0.25s cubic-bezier(0.4,0,0.2,1);
    box-shadow: none;
  }
  .docs-sidebar.open {
    left: 0;
    box-shadow: 4px 0 32px rgba(0,0,0,0.4);
  }
  .docs-main { margin-left: 0; padding: 32px 28px 80px; }
  .topbar-menu-btn { display: flex; align-items: center; justify-content: center; }
  .topbar-search-wrap { max-width: 220px; }
  .docs-home-hero h1 { font-size: 1.8rem; }
}

@media (max-width: 640px) {
  .topbar-site-link { display: none; }
  .topbar-search-wrap { max-width: 150px; }
  .docs-main { padding: 24px 16px 60px; }
  .docs-article h1 { font-size: 1.5rem; }
  .docs-pagination { flex-direction: column; }
  .categories-grid { grid-template-columns: 1fr 1fr; }
  .docs-start-here { grid-template-columns: 1fr; }
  .docs-home-hero { padding: 48px 20px 36px; }
}
