/* ============================================================
   C3NTR — Help Docs Stylesheet
   Extends the marketing site design tokens from /style.css
   ============================================================ */

/* === DOCS NAVBAR OVERRIDE ==================================== */
/* Docs pages have no hero — navbar always needs the solid background */
.navbar {
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--border);
  padding-top: 14px;
  padding-bottom: 14px;
}

/* === DOCS LAYOUT ============================================ */
.docs-layout {
  display: flex;
  min-height: calc(100vh - 72px);
  margin-top: 72px;
}

/* === SIDEBAR ================================================ */
.docs-sidebar {
  position: sticky;
  top: 72px;
  width: 280px;
  min-width: 280px;
  height: calc(100vh - 72px);
  overflow-y: auto;
  padding: 32px var(--pad-x) 48px;
  background: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: var(--subtle) transparent;
  z-index: 10;
}

.docs-sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text);
  align-items: center;
  justify-content: center;
  z-index: 100;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  cursor: pointer;
}

/* Search in sidebar */
.docs-search-wrap {
  position: relative;
  margin-bottom: 28px;
}

.docs-search {
  width: 100%;
  padding: 10px 12px 10px 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}
.docs-search::placeholder { color: var(--subtle); }
.docs-search:focus { border-color: var(--gold); }

.docs-search-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--subtle);
  pointer-events: none;
}

.docs-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 340px;
  overflow-y: auto;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 50;
}
.docs-search-results.active { display: block; }

.docs-search-result {
  display: block;
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.docs-search-result:last-child { border-bottom: none; }
.docs-search-result:hover,
.docs-search-result.kb-focus { background: var(--surface-h); }
.docs-search-result-cat {
  font-size: 0.7rem;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.docs-search-result mark {
  background: var(--gold-glow);
  color: var(--gold-lt);
  border-radius: 2px;
  padding: 0 2px;
}

/* Sidebar nav */
.docs-nav-section {
  margin-bottom: 24px;
}

.docs-nav-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 8px;
  padding: 0 4px;
}
.docs-nav-label svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.docs-nav-link {
  display: block;
  padding: 6px 4px 6px 26px;
  font-size: 0.85rem;
  color: var(--muted);
  border-radius: var(--radius-xs);
  transition: color 0.15s, background 0.15s;
  line-height: 1.4;
}
.docs-nav-link:hover {
  color: var(--text);
  background: var(--surface);
}
.docs-nav-link.active {
  color: var(--gold);
  background: var(--gold-glow-sm);
  font-weight: 500;
}

/* === MAIN CONTENT =========================================== */
.docs-content {
  flex: 1;
  min-width: 0;
  max-width: 780px;
  padding: 40px clamp(24px, 5vw, 64px) 80px;
}

/* Role badges */
.docs-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: var(--pill);
  margin-bottom: 24px;
}
.docs-role-badge svg { width: 12px; height: 12px; flex-shrink: 0; }

.docs-role-badge-leader {
  color: var(--gold);
  background: rgba(184, 150, 62, 0.1);
  border: 1px solid rgba(184, 150, 62, 0.25);
}
.docs-role-badge-instructor {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.2);
}
.docs-role-badge-all {
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
}

/* Breadcrumb */
.docs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--subtle);
  margin-bottom: 24px;
}
.docs-breadcrumb a {
  color: var(--muted);
  transition: color 0.15s;
}
.docs-breadcrumb a:hover { color: var(--gold); }
.docs-breadcrumb-sep {
  font-size: 0.65rem;
  opacity: 0.5;
}

/* Page header */
.docs-page-title {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 8px;
}

.docs-reading-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--subtle);
  margin-bottom: 32px;
}
.docs-reading-time svg {
  width: 13px;
  height: 13px;
}

/* Intro paragraph */
.docs-intro {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 640px;
}

/* === CONTENT ELEMENTS ======================================= */

/* Section headings */
.docs-content h2 {
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.docs-content h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.docs-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
}

/* Body text */
.docs-content p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 16px;
  max-width: 640px;
}

.docs-content ul, .docs-content ol {
  margin-bottom: 16px;
  padding-left: 20px;
  max-width: 640px;
}
.docs-content li {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 6px;
  list-style: disc;
}
.docs-content ol li { list-style: decimal; }

.docs-content strong { color: var(--text); font-weight: 600; }
.docs-content code {
  font-size: 0.85em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
}

/* Inline links */
.docs-content a:not(.btn):not(.docs-card) {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-color: var(--gold-glow);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}
.docs-content a:not(.btn):not(.docs-card):hover {
  text-decoration-color: var(--gold);
}

/* === CALLOUT BOXES ========================================== */
.docs-callout {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  max-width: 640px;
  font-size: 0.9rem;
  line-height: 1.65;
}
.docs-callout p { margin-bottom: 0; font-size: inherit; }
.docs-callout-label {
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.docs-callout-tip {
  background: rgba(184, 150, 62, 0.08);
  border-left: 3px solid var(--gold);
}
.docs-callout-tip .docs-callout-label { color: var(--gold); }

.docs-callout-note {
  background: rgba(96, 165, 250, 0.08);
  border-left: 3px solid #60a5fa;
}
.docs-callout-note .docs-callout-label { color: #60a5fa; }

.docs-callout-warning {
  background: rgba(251, 191, 36, 0.08);
  border-left: 3px solid #fbbf24;
}
.docs-callout-warning .docs-callout-label { color: #fbbf24; }

/* === NUMBERED STEPS ========================================= */
.docs-steps {
  counter-reset: step-counter;
  margin-bottom: 32px;
  max-width: 640px;
}

.docs-step {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  counter-increment: step-counter;
}

.docs-step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold-glow);
  border: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--gold);
  margin-top: 2px;
}
.docs-step-num::before {
  content: counter(step-counter);
}

.docs-step-body {
  flex: 1;
  min-width: 0;
}
.docs-step-body p { margin-bottom: 8px; }
.docs-step-body p:last-child { margin-bottom: 0; }

/* === SCREENSHOTS ============================================ */
.docs-screenshot {
  display: block;
  max-width: 480px;
  margin: 24px 0 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.docs-screenshot-wide {
  max-width: 640px;
}

.docs-screenshot-caption {
  font-size: 0.78rem;
  color: var(--subtle);
  margin-top: -20px;
  margin-bottom: 32px;
}

/* Placeholder fallback when image file is missing */
.docs-screenshot-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 480px;
  height: 200px;
  margin: 24px 0 32px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  background: var(--surface);
  color: var(--subtle);
  font-size: 0.78rem;
  text-align: center;
  padding: 16px;
}
/* Auto-hide placeholder when the real image loads */
.docs-screenshot-wrap { position: relative; }
.docs-screenshot-wrap .docs-screenshot-placeholder {
  position: absolute;
  inset: 0;
  height: auto;
  margin: 0;
  z-index: 0;
}
.docs-screenshot-wrap .docs-screenshot {
  position: relative;
  z-index: 1;
  background: var(--bg);
}

/* === CATEGORY CARDS (landing page) ========================== */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.docs-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.docs-card:hover {
  border-color: var(--border-gold);
  background: var(--surface-h);
  transform: translateY(-2px);
}

.docs-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-xs);
  background: var(--gold-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  margin-bottom: 4px;
}
.docs-card-icon svg { width: 20px; height: 20px; }

.docs-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.docs-card-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.docs-card-count {
  font-size: 0.72rem;
  color: var(--subtle);
  margin-top: auto;
}

/* === RELATED GUIDES (page bottom) =========================== */
.docs-related {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.docs-related-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--subtle);
  margin-bottom: 12px;
}
.docs-related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.docs-related-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--pill);
  transition: border-color 0.2s, color 0.2s;
}
.docs-related-link:hover {
  border-color: var(--border-gold);
  color: var(--gold);
}
.docs-related-link svg { width: 14px; height: 14px; }

/* === CONTACT FOOTER ========================================= */
.docs-contact {
  margin-top: 40px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  max-width: 480px;
}
.docs-contact p {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 8px;
  max-width: none;
}
.docs-contact a {
  color: var(--gold) !important;
  font-weight: 500;
}

/* === POPULAR GUIDES ========================================= */
.docs-popular {
  margin-bottom: 48px;
}
.docs-popular-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--subtle);
  margin-bottom: 16px;
}
.docs-popular-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.docs-popular-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
  color: var(--muted);
  border-radius: var(--radius-xs);
  transition: background 0.15s, color 0.15s;
}
.docs-popular-link:hover {
  background: var(--surface);
  color: var(--text);
}
.docs-popular-link svg { width: 16px; height: 16px; color: var(--subtle); flex-shrink: 0; }

/* === RESPONSIVE ============================================= */
@media (max-width: 960px) {
  .docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 0 0 rgba(0,0,0,0);
    z-index: 200;
    padding-top: 88px;
  }
  .docs-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,0.5);
    border-right: 1px solid var(--border);
  }
  .docs-sidebar-toggle { display: flex; }
  .docs-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
  }
  .docs-sidebar-overlay.active { display: block; }
  .docs-content { padding: 32px 20px 80px; }
}

@media (max-width: 640px) {
  .docs-grid {
    grid-template-columns: 1fr;
  }
  .docs-page-title {
    font-size: 1.6rem;
  }
  .docs-screenshot {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .docs-sidebar { transition: none; }
  .docs-card { transition: none; }
}
