/* =========================================================
   Taking Prophets Docs — Global Stylesheet
   ========================================================= */

/* --- CSS Variables --- */
:root {
  --bg: #000000;
  --bg-elev: #121212;
  --bg-elev2: #1a1a1a;
  --text: #ffffff;
  --text-secondary: #d1d5db;
  --muted: #9ca3af;
  --accent: #4f8cff;
  --accent-hover: #7fb0ff;
  --border: #1f2937;
  --border-light: #2d3748;
  --card-bg: #121212;
  --link: #4f8cff;
  --link-hover: #7fb0ff;
  --content-max: 860px;
  --sidebar-w: 260px;
  --toc-w: 220px;
  --header-h: 56px;
  /* Callout colours */
  --info-bg: rgba(59, 130, 246, 0.08);
  --info-border: rgba(59, 130, 246, 0.4);
  --info-text: #93c5fd;
  --tip-bg: rgba(16, 185, 129, 0.08);
  --tip-border: rgba(16, 185, 129, 0.4);
  --tip-text: #6ee7b7;
  --warn-bg: rgba(245, 158, 11, 0.08);
  --warn-border: rgba(245, 158, 11, 0.4);
  --warn-text: #fcd34d;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Ubuntu, Cantarell, "Noto Sans", "Helvetica Neue", Arial, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
img { max-width: 100%; display: block; }
hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

/* --- Utility --- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,1px,1px); white-space: nowrap; border: 0;
}

/* =========================================================
   LAYOUT — Header
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
}

.site-header .header-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1400px; width: 100%; margin: 0 auto;
}

.site-header .brand img { height: 32px; width: auto; }

.hamburger-btn {
  display: none;
  background: none; border: none; color: var(--text); cursor: pointer;
  padding: 8px; line-height: 1;
}
.hamburger-btn svg { width: 24px; height: 24px; }

/* =========================================================
   LAYOUT — 3-Column Grid
   ========================================================= */
.site-body {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - var(--header-h));
}

/* =========================================================
   SIDEBAR
   ========================================================= */
.sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 20px 16px 40px 24px;
  border-right: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar .logo { display: none; }

.nav-section { margin-bottom: 8px; }

.nav-section-title {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
  padding: 16px 8px 6px; margin: 0;
}

.nav-group { margin: 0 0 2px; }

.nav-group-title {
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  padding: 6px 8px; margin: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  border-radius: 6px; transition: background 0.15s;
  user-select: none;
}
.nav-group-title:hover { background: var(--bg-elev); }

.nav-group-title .chevron {
  width: 16px; height: 16px; transition: transform 0.2s;
  color: var(--muted); flex-shrink: 0;
}
.nav-group.collapsed .chevron { transform: rotate(-90deg); }
.nav-group.collapsed .nav-list { display: none; }

.nav-list {
  list-style: none; margin: 0; padding: 0 0 0 12px;
  border-left: 1px solid var(--border);
}

.nav-list li a {
  display: block; padding: 5px 10px; margin: 1px 0;
  border-radius: 6px; color: var(--muted);
  font-size: 13px; line-height: 1.5;
  transition: color 0.15s, background 0.15s;
}
.nav-list li a:hover { color: var(--text); background: var(--bg-elev); text-decoration: none; }
.nav-list li a.active {
  color: var(--accent); background: rgba(79, 140, 255, 0.08);
  font-weight: 500;
}

/* Sub-items (partner sub-nav) */
.nav-list .nav-list { padding-left: 10px; border-left: 1px solid var(--border); }

/* =========================================================
   MAIN CONTENT
   ========================================================= */
.content {
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
  padding: 32px 40px 80px;
}

.content h1 {
  font-size: 2.25rem; font-weight: 700;
  margin: 0 0 8px; line-height: 1.25;
  letter-spacing: -0.02em;
}

.content .subtitle {
  font-size: 1.1rem; color: var(--muted);
  margin: 0 0 28px; line-height: 1.6;
}

.content h2 {
  font-size: 1.45rem; font-weight: 600;
  margin: 40px 0 16px; padding-top: 24px;
  border-top: 1px solid var(--border);
  letter-spacing: -0.01em;
}

.content h2:first-of-type { border-top: none; padding-top: 0; }

.content h3 {
  font-size: 1.15rem; font-weight: 600;
  margin: 28px 0 12px;
}

.content h4 {
  font-size: 1rem; font-weight: 600;
  margin: 20px 0 8px;
}

.content p {
  color: var(--text-secondary);
  margin: 0 0 16px;
}

.content ul, .content ol {
  color: var(--text-secondary);
  padding-left: 24px; margin: 0 0 16px;
}

.content li { margin-bottom: 6px; }
.content li::marker { color: var(--muted); }

.content strong { color: var(--text); font-weight: 600; }

.content blockquote {
  margin: 16px 0; padding: 12px 16px;
  border-left: 3px solid var(--accent);
  background: var(--info-bg);
  border-radius: 8px; color: var(--text-secondary);
}

.content code {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", "Segoe UI Mono",
    Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px; border-radius: 4px;
  color: var(--accent-hover);
}

.content pre {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  overflow-x: auto;
  margin: 0 0 16px;
}

.content pre code {
  background: none; padding: 0; border-radius: 0;
  color: var(--text-secondary); font-size: 0.85rem;
}

/* Images in content */
.content img {
  border-radius: 8px; margin: 16px 0;
  border: 1px solid var(--border);
}

/* Tables */
.content table {
  width: 100%; border-collapse: collapse; margin: 16px 0;
  font-size: 0.9rem;
}
.content th, .content td {
  padding: 10px 14px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.content th {
  font-weight: 600; color: var(--text);
  background: var(--bg-elev);
}
.content td { color: var(--text-secondary); }

/* Setting documentation pattern */
.setting { margin-bottom: 12px; }
.setting-name { font-weight: 600; color: var(--text); }
.setting-type { color: var(--muted); font-size: 0.9em; }
.setting-default { color: var(--accent-hover); font-size: 0.9em; }

/* =========================================================
   CALLOUT BOXES
   ========================================================= */
.callout {
  margin: 20px 0; padding: 14px 18px;
  border-radius: 8px; border-left: 4px solid;
  font-size: 0.95rem; line-height: 1.6;
}
.callout p { margin: 0; }
.callout p + p { margin-top: 8px; }
.callout-title {
  font-weight: 600; font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 6px; display: flex; align-items: center; gap: 6px;
}

.callout-info, .callout-note {
  background: var(--info-bg); border-color: var(--info-border);
}
.callout-info .callout-title, .callout-note .callout-title { color: var(--info-text); }
.callout-info p, .callout-note p { color: #bfdbfe; }

.callout-tip {
  background: var(--tip-bg); border-color: var(--tip-border);
}
.callout-tip .callout-title { color: var(--tip-text); }
.callout-tip p { color: #a7f3d0; }

.callout-warning, .callout-warn {
  background: var(--warn-bg); border-color: var(--warn-border);
}
.callout-warning .callout-title, .callout-warn .callout-title { color: var(--warn-text); }
.callout-warning p, .callout-warn p { color: #fde68a; }

/* =========================================================
   TABLE OF CONTENTS (right column)
   ========================================================= */
.toc-aside {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 32px 24px 40px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.toc { padding: 0; }

.toc-title {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px;
}

.toc ul {
  list-style: none; margin: 0; padding: 0 0 0 12px;
  border-left: 1px solid var(--border);
}

.toc li { margin: 0; }

.toc a {
  display: block; padding: 4px 8px;
  color: var(--muted); font-size: 13px; line-height: 1.5;
  border-radius: 4px;
  transition: color 0.15s;
}
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.active { color: var(--accent); }

/* =========================================================
   PREV / NEXT NAVIGATION
   ========================================================= */
.page-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.page-nav a {
  display: flex; flex-direction: column;
  padding: 16px 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.2s, background 0.2s;
  text-decoration: none;
}
.page-nav a:hover {
  border-color: var(--accent);
  background: var(--bg-elev2);
  text-decoration: none;
}

.page-nav .nav-label {
  font-size: 12px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.page-nav .nav-title {
  font-size: 0.95rem; font-weight: 500; color: var(--text);
}

.page-nav .prev { grid-column: 1; }
.page-nav .next { grid-column: 2; text-align: right; }

/* Only prev */
.page-nav a:only-child.prev { grid-column: 1; }
.page-nav a:only-child.next { grid-column: 2; }

/* =========================================================
   HOMEPAGE
   ========================================================= */
body.home .site-body {
  grid-template-columns: 1fr;
}
body.home .sidebar,
body.home .toc-aside { display: none; }

body.home .content {
  max-width: 1000px; padding-top: 60px; padding-bottom: 80px;
}

.home-hero {
  text-align: center; margin-bottom: 32px;
}
.home-hero img {
  width: 100px; height: auto; margin: 0 auto;
  filter: drop-shadow(0 0 30px rgba(79, 140, 255, 0.15));
}

.home-title {
  text-align: center;
  font-size: 2.5rem; font-weight: 700;
  margin: 0 0 12px;
  letter-spacing: -0.03em;
}

.home-subtitle {
  text-align: center;
  font-size: 1.15rem; color: var(--muted);
  margin: 0 0 48px;
  max-width: 600px; margin-left: auto; margin-right: auto;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 12px;
}

.card {
  display: flex; flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-decoration: none; color: inherit;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  background: var(--bg-elev2);
  text-decoration: none;
}

.card-icon {
  font-size: 1.5rem; margin-bottom: 12px;
}

.card h3 {
  font-size: 1rem; font-weight: 600;
  margin: 0 0 8px; color: var(--text);
}

.card p {
  font-size: 0.9rem; color: var(--muted);
  margin: 0; line-height: 1.5;
}

/* Card grid for overview pages */
.indicator-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px; margin: 20px 0;
}

.indicator-card {
  display: block;
  padding: 16px 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.indicator-card:hover {
  border-color: var(--accent);
  background: var(--bg-elev2);
  text-decoration: none;
}
.indicator-card h4 { margin: 0 0 4px; font-size: 0.95rem; color: var(--text); }
.indicator-card p { margin: 0; font-size: 0.85rem; color: var(--muted); }

/* =========================================================
   FEATURE IMAGES
   ========================================================= */
.feature-img {
  width: 60%; max-width: 560px; height: auto;
  display: block; margin: 12px auto;
}

.install-whop {
  width: 50%; max-width: 560px; height: auto;
  display: block; margin: 8px auto;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  color: var(--muted); font-size: 0.85rem;
}
.site-footer .footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1400px; margin: 0 auto;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

/* =========================================================
   MOBILE OVERLAY SIDEBAR
   ========================================================= */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
}
.sidebar-overlay.open { display: block; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1100px) {
  .site-body {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }
  .toc-aside { display: none; }
}

@media (max-width: 768px) {
  .hamburger-btn { display: block; }

  .site-body { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 280px; z-index: 300;
    background: var(--bg);
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    padding-top: 16px;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar .logo { display: block; margin: 0 8px 12px; }
  .sidebar .logo img { height: 32px; }

  .sidebar-overlay.open { display: block; }

  .content { padding: 24px 20px 60px; }
  .content h1 { font-size: 1.75rem; }

  .home-title { font-size: 1.75rem; }

  .cards-grid { grid-template-columns: 1fr; }
  .indicator-grid { grid-template-columns: 1fr; }

  .page-nav { grid-template-columns: 1fr; }
  .page-nav .next { text-align: left; grid-column: 1; }

  .feature-img, .install-whop { width: 100%; max-width: 100%; }
}

/* =========================================================
   TIER BADGES
   ========================================================= */
.badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 3px;
  line-height: 1.4;
  vertical-align: middle;
  margin-left: 6px;
  white-space: nowrap;
}

.badge-premium {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-partner {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-free {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Page-level badge (above title) */
.page-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.page-badge-premium {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.page-badge-partner {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.page-badge-free {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* =========================================================
   SIDEBAR SEARCH
   ========================================================= */
.sidebar-search {
  position: relative;
  padding: 8px 8px 12px;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
}

.search-input-wrap input {
  width: 100%;
  padding: 8px 10px 8px 32px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}

.search-input-wrap input::placeholder {
  color: var(--muted);
}

.search-input-wrap input:focus {
  border-color: var(--accent);
}

.search-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 8px;
  right: 8px;
  background: var(--bg-elev2);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.search-results.open {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  color: var(--text-secondary);
  font-size: 13px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.search-result-item:hover {
  background: rgba(79, 140, 255, 0.08);
  color: var(--text);
  text-decoration: none;
}

.search-no-results {
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* =========================================================
   SMOOTH SCROLL
   ========================================================= */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
