/* ───────────────────────────────────────────
   PaxAgent How-To Documentation – Shared CSS
   ─────────────────────────────────────────── */

:root {
  --accent: #2563eb;
  --accent-light: #60a5fa;
  --bg: #0f1117;
  --bg-surface: #171b26;
  --bg-card: #1e2336;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  --green: #2563eb;
  --amber: #f59e0b;
  --red: #ef4444;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --nav-bg: rgba(15, 17, 23, 0.95);
  --hero-title-from: #fff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
}

a {
  color: var(--accent-light);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── TOP NAV ── */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 58px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
}

.nav-brand .badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  gap: 6px;
  list-style: none;
}

.nav-links a {
  padding: 6px 13px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all .15s;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(99, 102, 241, .15);
  color: var(--accent-light);
  text-decoration: none;
}

.nav-search {
  position: relative;
}

.nav-search input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  padding: 7px 14px 7px 34px;
  width: 220px;
  outline: none;
  transition: border-color .2s;
}

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

.nav-search input::placeholder {
  color: var(--text-faint);
}

.nav-search .icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--text-faint);
}

/* ── HERO ── */
.hero {
  padding: 72px 28px 60px;
  text-align: center;
  background: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(99, 102, 241, .18) 0%, transparent 70%);
}

.hero h1 {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
  background: linear-gradient(135deg, var(--hero-title-from) 40%, var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 34px;
}

.hero-search {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}

.hero-search input {
  width: 100%;
  padding: 15px 20px 15px 48px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.hero-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .18);
}

.hero-search input::placeholder {
  color: var(--text-faint);
}

.hero-search .icon {
  position: absolute;
  left: 17px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--text-muted);
}

/* ── SEARCH RESULTS ── */
#search-results {
  max-width: 720px;
  margin: 20px auto 0;
  display: none;
}

.search-result-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  transition: border-color .15s;
}

.search-result-item:hover {
  border-color: var(--accent);
}

.search-result-item .cat-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  margin-top: 2px;
  flex-shrink: 0;
}

.search-result-item .title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.search-result-item .excerpt {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ── LAYOUT ── */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.content-with-sidebar {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: start;
  padding: 40px 28px 80px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ── SIDEBAR ── */
.sidebar {
  position: sticky;
  top: 72px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}

.sidebar h3 {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 2px;
}

.sidebar-nav a {
  display: block;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--text-muted);
  transition: all .15s;
  text-decoration: none;
}

.sidebar-nav a:hover {
  background: rgba(99, 102, 241, .1);
  color: var(--accent-light);
}

.sidebar-nav a.active {
  background: rgba(99, 102, 241, .15);
  color: var(--accent-light);
  font-weight: 600;
}

.sidebar-nav .sub {
  padding-left: 20px;
  font-size: 12px;
}

/* ── CATEGORY GRID (index) ── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin: 48px 0;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
  cursor: pointer;
  text-decoration: none;
  display: block;
  color: inherit;
}

.category-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.category-card .icon {
  font-size: 32px;
  margin-bottom: 14px;
  display: block;
}

.category-card h3 {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 7px;
}

.category-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.category-card .count {
  margin-top: 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-light);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── GUIDE ARTICLE ── */
.guide-section {
  margin-bottom: 60px;
  padding-top: 20px;
}

.guide-section+.guide-section {
  border-top: 1px solid var(--border);
  padding-top: 48px;
}

.guide-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.guide-header .guide-icon {
  font-size: 28px;
  margin-top: 2px;
}

.guide-header h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.guide-header .tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(99, 102, 241, .15);
  color: var(--accent-light);
  margin-top: 4px;
  display: inline-block;
}

.guide-intro {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
  max-width: 680px;
  line-height: 1.8;
}

/* ── STEPS ── */
.steps {
  counter-reset: step;
  list-style: none;
}

.steps li {
  counter-increment: step;
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  align-items: flex-start;
}

.steps li::before {
  content: counter(step);
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  min-width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 3px;
  flex-shrink: 0;
}

.steps li .step-content {
  flex: 1;
}

.steps li strong {
  display: block;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 3px;
}

.steps li p,
.steps li span {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── CALLOUTS ── */
.callout {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 9px;
  margin: 20px 0;
  font-size: 13px;
}

.callout.tip {
  background: rgba(37, 99, 235, .1);
  border-left: 3px solid var(--green);
  color: #93c5fd;
}

.callout.note {
  background: rgba(99, 102, 241, .1);
  border-left: 3px solid var(--accent);
  color: var(--accent-light);
}

.callout.warning {
  background: rgba(245, 158, 11, .1);
  border-left: 3px solid var(--amber);
  color: #fcd34d;
}

.callout .callout-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.callout p {
  margin: 0;
  line-height: 1.6;
}

/* ── SCREENSHOT PLACEHOLDER ── */
.screenshot-placeholder {
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 36px 20px;
  text-align: center;
  margin: 20px 0;
  color: var(--text-faint);
}

.screenshot-placeholder .ph-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.screenshot-placeholder p {
  font-size: 12px;
  line-height: 1.5;
}

.screenshot-placeholder strong {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.screenshot-frame {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  margin: 20px 0;
  color: var(--text-faint);
}

.screenshot-frame img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 0 auto 10px;
}

.screenshot-frame p {
  font-size: 12px;
  line-height: 1.5;
}

.screenshot-frame strong {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ── PAGE HEADER ── */
.page-hero {
  padding: 48px 28px 40px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(99, 102, 241, .08) 0%, transparent 60%);
}

.page-hero .breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 14px;
}

.page-hero .breadcrumb a {
  color: var(--text-muted);
}

.page-hero .breadcrumb a:hover {
  color: var(--accent-light);
}

.page-hero h1 {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.page-hero p {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 580px;
}

.page-hero .page-icon {
  font-size: 36px;
  margin-bottom: 12px;
  display: block;
}

/* ── INLINE CODE ── */
code {
  background: rgba(99, 102, 241, .12);
  color: var(--accent-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: "SF Mono", Consolas, monospace;
}

/* ── SECTION DIVIDER ── */
.section-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.section-title {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}

.section-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 36px;
}

/* ── POPULAR GUIDES ── */
.guide-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guide-links li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  transition: all .15s;
  text-decoration: none;
}

.guide-links li a:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, .08);
  text-decoration: none;
}

.guide-links li a .arrow {
  margin-left: auto;
  color: var(--text-faint);
  font-size: 11px;
}

/* ── FOOTER ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px;
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
}

.site-footer a {
  color: var(--text-muted);
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .content-with-sidebar {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    max-height: none;
  }

  .nav-links {
    display: none;
  }
}

@media (max-width: 600px) {
  .category-grid {
    grid-template-columns: 1fr;
  }

  .top-nav {
    padding: 0 16px;
  }

  .hero {
    padding: 48px 16px 40px;
  }
}


[data-theme="light"] {
  --accent: #1d4ed8;
  --accent-light: #2563eb;
  --bg: #ffffff;
  --bg-surface: #f8fafc;
  --bg-card: #ffffff;
  --border: rgba(0, 0, 0, 0.1);
  --text: #0f172a;
  --text-muted: #475569;
  --text-faint: #94a3b8;
  --green: #1d4ed8;
  --amber: #d97706;
  --red: #dc2626;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
  --nav-bg: rgba(255, 255, 255, 0.95);
  --hero-title-from: #000;
}

.theme-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  margin-left: 10px;
  padding: 6px;
  border-radius: 6px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: rgba(128, 128, 128, 0.2);
}

.nav-links a.back-to-site {
  color: var(--green) !important;
  font-weight: 700;
  margin-right: 12px;
}
.nav-links a.back-to-site:hover {
  background: rgba(37, 99, 235, 0.15) !important;
  color: var(--green) !important;
}

/* Fix for broken top layout and navigation bar overlap */
.hero {
  min-height: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: calc(var(--nav-height, 64px) + 60px) 28px 60px !important;
}
.page-hero {
  padding: calc(var(--nav-height, 64px) + 40px) 28px 40px !important;
}