/* ============================================================
   BLINK DOCUMENTATION STYLES
   Uses design tokens from tokens.css
   ============================================================ */

/* Override custom cursor from base.css (docs has no cursor-dot JS) */
body { cursor: auto; }
button, a { cursor: pointer; }

/* ── Layout ────────────────────────────────────────────────── */

.docs-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  min-height: calc(100vh - 80px);
  padding-top: 80px;
}

.docs-sidebar {
  position: sticky;
  top: 80px;
  height: calc(100vh - 80px);
  overflow-y: auto;
  border-right: 1px solid var(--border-subtle);
  padding: var(--space-6) var(--space-4);
  background: var(--bg-surface);
}

.docs-content {
  max-width: 860px;
  padding: var(--space-8) var(--space-6);
  overflow-x: hidden;
}

.docs-section {
  margin-bottom: var(--space-12);
  scroll-margin-top: 100px;
}


/* ── Sidebar Navigation ────────────────────────────────────── */

.docs-nav-title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.docs-nav-link {
  display: block;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0;
  transition: all 0.2s;
}

.docs-nav-link:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.03);
}

.docs-nav-link--active {
  color: var(--text-primary);
  font-weight: 600;
  border-left-color: var(--brand-black);
}


/* ── Section Headers ───────────────────────────────────────── */

.docs-section__title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.docs-subsection__title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
}

.docs-text {
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}


/* ── Code Blocks ───────────────────────────────────────────── */

.docs-code {
  position: relative;
  background: var(--bg-dark, #1a1a1a);
  color: #e5e5e5;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin-bottom: var(--space-4);
  line-height: 1.6;
}

.docs-code__copy {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  transition: all 0.2s;
}

.docs-code__copy:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.docs-code__copy--copied {
  color: #22c55e;
}

.docs-code__lang {
  position: absolute;
  top: var(--space-2);
  left: var(--space-3);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.3);
}

/* Inline code */
.docs-text code,
.docs-inline-code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: var(--bg-alt, #f0ece4);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}


/* ── Tier Badges ───────────────────────────────────────────── */

.tier-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  vertical-align: middle;
  margin-left: var(--space-2);
}

.tier-badge--starter {
  background: #dcfce7;
  color: #166534;
}

.tier-badge--pro {
  background: #fef3c7;
  color: #92400e;
}

.tier-badge--enterprise {
  background: var(--bg-dark, #1a1a1a);
  color: white;
}


/* ── Method Badges (API Reference) ─────────────────────────── */

.method-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  margin-right: var(--space-2);
  text-transform: uppercase;
}

.method-badge--get {
  background: #dcfce7;
  color: #166534;
}

.method-badge--post {
  background: #dbeafe;
  color: #1e40af;
}

.method-badge--delete {
  background: #fee2e2;
  color: #991b1b;
}


/* ── API Endpoint Cards ────────────────────────────────────── */

.docs-endpoint {
  background: var(--bg-surface, #faf8f4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.docs-endpoint__path {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
}

.docs-endpoint__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-2);
}


/* ── Tables ────────────────────────────────────────────────── */

.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-6);
  font-size: var(--text-sm);
}

.docs-table th {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  padding: var(--space-3);
  border-bottom: 2px solid var(--border-subtle);
  color: var(--text-muted);
}

.docs-table td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.docs-table tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.02);
}

.docs-table code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: var(--bg-alt, #f0ece4);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}


/* ── Troubleshooting (Collapsible Details) ─────────────────── */

.docs-details {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
  overflow: hidden;
}

.docs-details summary {
  padding: var(--space-4);
  cursor: pointer;
  font-weight: 600;
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.docs-details summary::marker,
.docs-details summary::-webkit-details-marker {
  display: none;
}

.docs-details[open] summary {
  border-bottom: 1px solid var(--border-subtle);
}

.docs-details__content {
  padding: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}


/* ── Feature Cards ─────────────────────────────────────────── */

.docs-feature {
  padding: var(--space-5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}

.docs-feature__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.docs-feature__title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-base);
}

.docs-feature__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}


/* ── Notes ─────────────────────────────────────────────────── */

.docs-note {
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

.docs-note--info {
  background: #dbeafe;
  border-left-color: #3b82f6;
}


/* ── Divider ───────────────────────────────────────────────── */

.docs-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-8) 0;
}


/* ── Mobile Sidebar Toggle & Overlay ───────────────────────── */

.docs-sidebar-toggle {
  display: none;
  position: fixed;
  bottom: var(--space-4);
  right: var(--space-4);
  z-index: 100;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand-black);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  align-items: center;
  justify-content: center;
}

.docs-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 98;
}


/* ── Responsive: Tablet & Below (max-width 1024px) ─────────── */

@media (max-width: 1024px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: fixed;
    left: -300px;
    top: 0;
    bottom: 0;
    width: 280px;
    z-index: 99;
    transition: transform 0.3s;
    background: var(--bg-base);
  }

  .docs-sidebar--open {
    transform: translateX(300px);
  }

  .docs-sidebar-toggle {
    display: flex;
  }

  .docs-content {
    padding: var(--space-6) var(--space-4);
  }
}


/* ── Responsive: Mobile (max-width 640px) ──────────────────── */

@media (max-width: 640px) {
  .docs-table {
    font-size: var(--text-xs);
  }

  .docs-code {
    font-size: var(--text-xs);
    padding: var(--space-3);
  }
}
