/* ─────────────────────────────────────────────────────────────────────────────
   PyViz3D Docs — Documentation Page Styles
   ───────────────────────────────────────────────────────────────────────────── */

.page-docs {
  display: flex;
  min-height: 100vh;
}

/* ── Docs Sidebar ──────────────────────────────────────────────────────────── */

.docs-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 24px 0;
  flex-shrink: 0;
}

.docs-sidebar::-webkit-scrollbar { width: 3px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 2px; }

.docs-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
  font-weight: 800;
  font-size: 16px;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

.docs-sidebar-logo:hover {
  -webkit-text-fill-color: inherit;
  color: var(--accent);
}

.docs-nav-section {
  padding: 0 12px;
  margin-bottom: 8px;
}

.docs-nav-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 4px 8px 8px;
}

.docs-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
}

.docs-nav-link:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}

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

.docs-nav-link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.7;
}

.docs-nav-link.active svg {
  opacity: 1;
}

/* ── Docs Main Content ────────────────────────────────────────────────────── */

.docs-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.docs-header {
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(8,8,16,0.6);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.docs-header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.docs-header-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.docs-header-breadcrumb a:hover {
  color: var(--accent);
}

.docs-header-breadcrumb span {
  color: var(--text-disabled);
}

.docs-header-spacer {
  flex: 1;
}

.docs-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.docs-content {
  flex: 1;
  max-width: 800px;
  padding: 40px 32px 80px;
}

/* ── Doc Typography ──────────────────────────────────────────────────────── */

.docs-content h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 12px;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.docs-content .doc-lead {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.docs-content h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 48px 0 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.docs-content h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--accent);
}

.docs-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
}

.docs-content ul, .docs-content ol {
  padding-left: 20px;
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
}

.docs-content li {
  margin-bottom: 6px;
}

.docs-content a {
  color: var(--accent);
}

.docs-content a:hover {
  color: #33dfff;
}

.docs-content code {
  background: rgba(0, 212, 255, 0.08);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  border: 1px solid rgba(0, 212, 255, 0.15);
}

/* ── Code Block ──────────────────────────────────────────────────────────── */

.doc-code {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: #a8d8f0;
  line-height: 1.75;
  overflow-x: auto;
  margin: 16px 0 24px;
  position: relative;
}

.doc-code .cmt { color: #546e7a; }
.doc-code .kw  { color: #c792ea; }
.doc-code .fn  { color: #82aaff; }
.doc-code .str { color: #c3e88d; }
.doc-code .num { color: #f78c6c; }
.doc-code .op  { color: #89ddff; }
.doc-code .punc { color: #89ddff; }

.doc-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.doc-code-lang {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.doc-code-copy {
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  font-family: var(--font-sans);
  transition: all var(--transition-fast);
}

.doc-code-copy:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
}

/* ── Info Boxes ──────────────────────────────────────────────────────────── */

.doc-box {
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.7;
  margin: 16px 0 24px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.doc-box svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.doc-box-info {
  background: rgba(96, 165, 250, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.2);
  color: var(--info);
}

.doc-box-success {
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.2);
  color: var(--success);
}

.doc-box-warning {
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  color: var(--warning);
}

.doc-box-danger {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.2);
  color: var(--danger);
}

/* ── API Table ────────────────────────────────────────────────────────────── */

.api-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 16px 0 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.api-table th {
  background: var(--bg-tertiary);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.api-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: top;
}

.api-table tr:last-child td {
  border-bottom: none;
}

.api-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.api-method {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent);
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.api-name {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 600;
}

.api-param {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--info);
}

.api-return {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--success);
}

/* ── Feature Cards ───────────────────────────────────────────────────────── */

.feature-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 16px 0 32px;
}

.feature-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: all var(--transition-fast);
}

.feature-card:hover {
  border-color: rgba(0,212,255,0.3);
}

.feature-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  font-size: 16px;
}

.feature-card h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.feature-card p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ── Steps ───────────────────────────────────────────────────────────────── */

.doc-steps {
  counter-reset: step;
  margin: 16px 0 24px;
}

.doc-step {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  align-items: flex-start;
}

.doc-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid rgba(0,212,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.doc-step-body h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}

.doc-step-body p {
  font-size: 13px;
  margin-bottom: 8px;
}

/* ── Table of Contents ────────────────────────────────────────────────────── */

.docs-toc {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 32px;
}

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

.docs-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.docs-toc li {
  margin-bottom: 4px;
}

.docs-toc a {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  display: block;
  padding: 3px 0;
  border-left: 2px solid transparent;
  padding-left: 10px;
  transition: all var(--transition-fast);
}

.docs-toc a:hover {
  color: var(--accent);
  border-left-color: var(--accent);
}

.docs-toc .toc-h3 {
  padding-left: 22px;
  font-size: 12px;
}

/* ── AdSense in Docs ─────────────────────────────────────────────────────── */

.docs-adsense {
  text-align: center;
  padding: 24px 32px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .docs-sidebar { display: none; }
  .docs-content { padding: 24px 16px 60px; }
  .docs-header { padding: 12px 16px; }
  .feature-card-grid { grid-template-columns: 1fr; }
}
