/* ============ Documentation Styles ============ */

/* Doc card grid (hub page) */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 80px;
}
.doc-card {
  display: flex;
  flex-direction: column;
  padding: 36px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  text-decoration: none;
  color: inherit;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.doc-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--grad-1);
  opacity: 0; transition: opacity 0.3s;
}
.doc-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-hi);
  background: var(--surface-hi);
  box-shadow: 0 20px 60px rgba(124, 58, 237, 0.2);
}
.doc-card:hover::before { opacity: 1; }

.doc-icon {
  width: 60px; height: 60px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid var(--border-hi);
  display: grid; place-items: center;
  margin-bottom: 24px;
  color: var(--primary-2);
}
.doc-icon svg { width: 30px; height: 30px; }

.doc-card-body { flex: 1; display: flex; flex-direction: column; }
.doc-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px; font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.doc-card p { color: var(--text-dim); font-size: 15px; line-height: 1.6; margin-bottom: 20px; }

.doc-topics {
  list-style: none; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 24px;
}
.doc-topics li {
  font-size: 12px;
  padding: 5px 12px;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-dim);
}

.doc-cta {
  margin-top: auto;
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--accent-2);
  font-size: 15px; font-weight: 600;
  transition: gap 0.2s;
}
.doc-card:hover .doc-cta { gap: 12px; }

/* Quick links */
.docs-quick { margin-bottom: 40px; }
.docs-quick h2 {
  font-size: 24px;
  margin-bottom: 24px;
  background: none;
  -webkit-text-fill-color: initial;
  color: var(--text);
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.quick-link {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 14px; font-weight: 500;
  transition: all 0.2s;
}
.quick-link:hover {
  border-color: var(--border-hi);
  color: var(--text);
  transform: translateY(-2px);
}
.quick-link svg { flex-shrink: 0; color: var(--primary-2); }

/* ============ Documentation Content Layout ============ */
.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  align-items: start;
}

/* Sidebar */
.docs-sidebar {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hi) transparent;
}
.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 4px; }

.sidebar-section { margin-bottom: 28px; }
.sidebar-section h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-bottom: 12px;
  padding-left: 12px;
}
.sidebar-section a {
  display: block;
  padding: 8px 12px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  border-radius: 8px;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}
.sidebar-section a:hover {
  color: var(--text);
  background: rgba(124, 58, 237, 0.08);
}
.sidebar-section a.active {
  color: var(--accent-2);
  border-left-color: var(--primary);
  background: rgba(124, 58, 237, 0.1);
  font-weight: 500;
}
.sidebar-back {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  margin-bottom: 20px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.15s;
}
.sidebar-back:hover { color: var(--text); background: rgba(124, 58, 237, 0.08); }
.sidebar-back svg { flex-shrink: 0; }

/* Content area */
.docs-content {
  min-width: 0;
  padding-bottom: 80px;
}

/* Prose enhancements for docs */
.docs-content .prose h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  background: none;
  -webkit-text-fill-color: initial;
  margin-top: 56px;
  margin-bottom: 20px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  scroll-margin-top: 100px;
}
.docs-content .prose h2:first-child { margin-top: 0; border-top: none; padding-top: 0; }

.docs-content .prose h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 21px;
  font-weight: 700;
  color: var(--text);
  margin-top: 40px;
  margin-bottom: 14px;
  scroll-margin-top: 100px;
}

.docs-content .prose h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-top: 28px;
  margin-bottom: 10px;
}

/* Code blocks */
.docs-content pre {
  background: var(--surface-hi);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 20px 0;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.65;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  color: var(--accent-2);
  scrollbar-width: thin;
  scrollbar-color: var(--border-hi) transparent;
}
.docs-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* Tables */
.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}
.docs-content th {
  text-align: left;
  padding: 12px 16px;
  background: var(--surface-hi);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}
.docs-content th:first-child { border-radius: 8px 0 0 0; }
.docs-content th:last-child { border-radius: 0 8px 0 0; }
.docs-content td {
  padding: 12px 16px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  vertical-align: top;
}
.docs-content tr:hover td { background: rgba(124, 58, 237, 0.04); }

/* Blockquotes / tips */
.docs-content blockquote {
  margin: 20px 0;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(6, 182, 212, 0.06));
  border-left: 3px solid var(--primary);
  border-radius: 0 12px 12px 0;
  font-size: 15px;
  color: var(--text-dim);
}
.docs-content blockquote strong { color: var(--accent-2); }

/* Endpoint badges */
.endpoint {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px;
  background: var(--surface-hi);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 14px;
  margin: 12px 0;
}
.method {
  font-weight: 700;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}
.method-get { background: rgba(16, 185, 129, 0.2); color: var(--green); }
.method-post { background: rgba(124, 58, 237, 0.2); color: var(--primary-2); }
.method-patch { background: rgba(234, 179, 8, 0.2); color: #eab308; }
.method-delete { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.endpoint-path { color: var(--text); }

/* Nav active */
.nav-links a.active { color: var(--text) !important; }

/* Responsive */
@media (max-width: 960px) {
  .docs-grid { grid-template-columns: 1fr; max-width: 600px; margin-left: auto; margin-right: auto; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar {
    position: static;
    max-height: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 24px;
    margin-bottom: 24px;
  }
}
@media (max-width: 640px) {
  .quick-grid { grid-template-columns: 1fr; }
}
