﻿/* ==========================================================================
   GuardianAI Docs — Curvance / GitBook-style Documentation Portal CSS
   ========================================================================== */

:root {
  --docs-bg: #080b09;
  --docs-sidebar-bg: #0c100d;
  --docs-card-bg: #101512;
  --docs-card-hover: #151d18;
  --docs-border: rgba(237, 242, 238, 0.08);
  --docs-border-focus: rgba(61, 255, 126, 0.4);
  --docs-text: #e2e8f0;
  --docs-muted: #94a3b8;
  --docs-faint: #64748b;
  --docs-accent: #3dff7e;
  --docs-accent-dim: rgba(61, 255, 126, 0.12);
  --docs-coral: #ff4d5e;
  --docs-coral-dim: rgba(255, 77, 94, 0.12);
  --docs-cyan: #38bdf8;
  --docs-cyan-dim: rgba(56, 189, 248, 0.12);
  --docs-code-bg: #060907;
}

/* HARD OVERRIDE: Global style.css section padding reset */
body.docs-page section,
body.docs-page .docs-section {
  padding: 0 !important;
  margin: 0 0 36px 0 !important;
  scroll-margin-top: 80px;
}

body.docs-page {
  background: var(--docs-bg) !important;
  color: var(--docs-text);
  font-family: var(--font-body, 'Inter', -apple-system, sans-serif);
  line-height: 1.6;
}

/* Header */
.docs-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 16, 13, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--docs-border);
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 24px;
}

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

.docs-brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.docs-badge {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--docs-accent-dim);
  color: var(--docs-accent);
  border: 1px solid rgba(61, 255, 126, 0.25);
  font-weight: 600;
}

.docs-search-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--docs-card-bg);
  border: 1px solid var(--docs-border);
  color: var(--docs-muted);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 260px;
}

.docs-search-btn:hover {
  border-color: var(--docs-border-focus);
  color: var(--docs-text);
}

.docs-search-key {
  margin-left: auto;
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--docs-border);
}

.docs-top-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.88rem;
  color: var(--docs-muted);
}

.docs-top-links a:hover {
  color: var(--docs-accent);
}

/* Layout container */
.docs-layout {
  display: flex;
  max-width: 1600px;
  margin: 0 auto;
  min-height: calc(100vh - 60px);
}

/* Left Sidebar */
.docs-sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 20px 14px 40px 20px;
  border-right: 1px solid var(--docs-border);
  background: var(--docs-sidebar-bg);
}

.docs-nav-group {
  margin-bottom: 20px;
}

.docs-nav-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--docs-faint);
  margin-bottom: 6px;
  padding-left: 8px;
}

.docs-nav-links {
  list-style: none;
}

.docs-nav-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.84rem;
  color: var(--docs-muted);
  transition: all 0.12s ease;
}

.docs-nav-links a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
}

.docs-nav-links a.active {
  color: var(--docs-accent);
  background: var(--docs-accent-dim);
  font-weight: 600;
}

/* Main Content */
.docs-content {
  flex: 1;
  min-width: 0;
  padding: 28px 40px 60px 40px;
  max-width: 900px;
}

.docs-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--docs-faint);
  margin-bottom: 16px;
}

.docs-breadcrumbs a:hover {
  color: var(--docs-text);
}

.docs-section {
  border-bottom: 1px solid rgba(237, 242, 238, 0.05);
  padding-bottom: 28px !important;
}

.docs-section:last-of-type {
  border-bottom: none;
}

.docs-section h1 {
  font-family: var(--font-display, sans-serif);
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  margin-top: 0;
  margin-bottom: 10px;
  line-height: 1.25;
}

.docs-section h2 {
  font-family: var(--font-display, sans-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  margin-top: 0;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--docs-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.docs-section h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #f1f5f9;
  margin-top: 16px;
  margin-bottom: 8px;
}

.docs-section p {
  margin-bottom: 12px;
  color: #cbd5e1;
  font-size: 0.94rem;
}

.docs-lead {
  font-size: 1.05rem !important;
  color: #94a3b8 !important;
  line-height: 1.65;
  margin-bottom: 16px !important;
}

/* Callouts / Alerts */
.docs-callout {
  padding: 12px 16px;
  border-radius: 6px;
  margin: 14px 0;
  border-left: 3px solid var(--docs-accent);
  background: var(--docs-card-bg);
  font-size: 0.9rem;
}

.docs-callout.tip {
  border-left-color: var(--docs-accent);
  background: rgba(61, 255, 126, 0.05);
}

.docs-callout.warning {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.05);
}

.docs-callout.coral {
  border-left-color: var(--docs-coral);
  background: var(--docs-coral-dim);
}

.docs-callout-title {
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Code Blocks & Tabs */
.docs-code-box {
  background: var(--docs-code-bg);
  border: 1px solid var(--docs-border);
  border-radius: 6px;
  margin: 14px 0;
  overflow: hidden;
}

.docs-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--docs-border);
  padding: 5px 12px;
}

.docs-tabs {
  display: flex;
  gap: 4px;
}

.docs-tab {
  background: none;
  border: none;
  color: var(--docs-muted);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.docs-tab.active {
  color: var(--docs-accent);
  background: var(--docs-accent-dim);
}

.docs-copy-btn {
  background: none;
  border: 1px solid var(--docs-border);
  color: var(--docs-muted);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.15s;
}

.docs-copy-btn:hover {
  color: #fff;
  border-color: var(--docs-border-focus);
}

.docs-code-block {
  padding: 12px 16px;
  margin: 0;
  overflow-x: auto;
  font-family: var(--font-mono, monospace);
  font-size: 0.82rem;
  line-height: 1.5;
  color: #e2e8f0;
}

/* Grid Cards */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.docs-card {
  background: var(--docs-card-bg);
  border: 1px solid var(--docs-border);
  border-radius: 6px;
  padding: 14px;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.docs-card:hover {
  border-color: var(--docs-border-focus);
  background: var(--docs-card-hover);
  transform: translateY(-1px);
}

.docs-card-icon {
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.docs-card h4 {
  color: #fff;
  font-size: 0.94rem;
  margin-bottom: 4px;
}

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

/* Tables */
.docs-table-wrap {
  overflow-x: auto;
  margin: 14px 0;
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.docs-table th {
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  padding: 8px 12px;
  border-bottom: 1px solid var(--docs-border);
  font-weight: 600;
}

.docs-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--docs-border);
  color: #cbd5e1;
}

.docs-table code {
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 4px;
  border-radius: 4px;
  color: var(--docs-accent);
}

/* Right TOC */
.docs-toc {
  width: 230px;
  flex-shrink: 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 24px 20px 40px 14px;
  display: block;
}

.docs-toc-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--docs-faint);
  margin-bottom: 8px;
}

.docs-toc-list {
  list-style: none;
  border-left: 1px solid var(--docs-border);
}

.docs-toc-list a {
  display: block;
  padding: 4px 0 4px 10px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 0.78rem;
  color: var(--docs-muted);
  transition: all 0.12s;
}

.docs-toc-list a:hover {
  color: #fff;
}

.docs-toc-list a.active {
  color: var(--docs-accent);
  border-left-color: var(--docs-accent);
  font-weight: 600;
}

/* Search Modal */
.docs-search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
}

.docs-search-modal-backdrop.open {
  display: flex;
}

.docs-search-dialog {
  background: #0d1310;
  border: 1px solid var(--docs-border-focus);
  border-radius: 10px;
  width: 100%;
  max-width: 620px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  overflow: hidden;
}

.docs-search-input-wrap {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--docs-border);
  gap: 10px;
}

.docs-search-input {
  width: 100%;
  background: none;
  border: none;
  color: #fff;
  font-size: 0.96rem;
  outline: none;
  font-family: inherit;
}

.docs-search-results {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
  list-style: none;
}

.docs-search-item a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--docs-text);
  text-decoration: none;
  transition: all 0.1s;
}

.docs-search-item a:hover,
.docs-search-item a.selected {
  background: var(--docs-accent-dim);
  color: var(--docs-accent);
}

.docs-search-item h5 {
  font-size: 0.88rem;
  margin-bottom: 2px;
}

.docs-search-item p {
  font-size: 0.76rem;
  color: var(--docs-muted);
  margin: 0;
}

/* Mobile responsive */
/* Mobile Navigation Toggle */
#docs-sidebar-toggle {
  display: none;
  padding: 4px 8px;
  font-size: 1.2rem;
  background: transparent;
  border: 1px solid var(--docs-border);
  color: var(--docs-muted);
  border-radius: 6px;
  cursor: pointer;
}
#docs-sidebar-toggle:hover {
  color: #fff;
  border-color: var(--docs-border-focus);
}
@media (max-width: 1100px) {
  .docs-toc { display: none; }
}

@media (max-width: 800px) {
  #docs-sidebar-toggle { display: inline-flex; }
  .docs-sidebar {
    position: fixed;
    left: -100%;
    top: 60px;
    bottom: 0;
    z-index: 90;
    transition: left 0.25s ease;
  }
  .docs-sidebar.open {
    left: 0;
  }
  .docs-content {
    padding: 16px;
  }
  .docs-search-btn {
    width: auto;
    padding: 6px 10px;
  }
}