/* Developer Documentation Styles
   Supplements Tailwind utilities for states and components that are
   cleaner in CSS (active nav, code tabs, syntax colouring). */

/* ── Sidebar ──────────────────────────────────────────────────── */
.gc-docs-sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  width: 260px;
  flex-shrink: 0;
  background: #ffffff;
  overflow-y: auto;
  z-index: 40;
  border-right: 1px solid #e2e8f0; /* slate-200 */
}

/* Wrapper that holds sidebar + main side-by-side */
.gc-docs-layout {
  display: flex;
  align-items: flex-start;
  max-width: 80rem; /* 1280px — matches consumer dashboard visual weight */
  margin-left: auto;
  margin-right: auto;
}

.gc-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  color: #475569; /* slate-600 */
  text-decoration: none;
  transition:
    background 0.15s,
    color 0.15s;
  border-left: 2px solid transparent;
}
.gc-sidebar-link:hover {
  background: #f1f5f9; /* slate-100 */
  color: #0f172a; /* slate-900 */
}
.gc-sidebar-link-active {
  background: #f1f5f9; /* slate-100 */
  color: var(--gc-blue, #1a56db);
  border-left-color: var(--gc-blue, #1a56db);
  font-weight: 600;
}
.gc-sidebar-link-disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

.gc-method-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(13, 148, 136, 0.12); /* teal tint */
  color: #0d9488; /* gc-teal */
}

/* ── Main layout ──────────────────────────────────────────────── */
.gc-docs-main {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
}

/* ── Code blocks ──────────────────────────────────────────────── */
.gc-code-block {
  background: #1e293b; /* slate-800 */
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.8125rem;
  line-height: 1.65;
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.gc-code-block code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* ── Language tabs ─────────────────────────────────────────────── */
.gc-lang-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e2e8f0; /* slate-200 */
  margin-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.gc-lang-tab {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b; /* slate-500 */
  cursor: pointer;
  border-bottom: 2px solid transparent;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  white-space: nowrap;
  transition:
    color 0.15s,
    border-color 0.15s;
}
.gc-lang-tab:hover {
  color: #334155; /* slate-700 */
}
.gc-lang-tab-active {
  color: #0f172a; /* slate-900 */
  border-bottom-color: var(--gc-blue, #1a56db);
}
.gc-lang-panel {
  display: none;
}
.gc-lang-panel-active {
  display: block;
}

/* ── Schema / parameter tables ─────────────────────────────────── */
.gc-param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.gc-param-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  color: #475569;
  border-bottom: 2px solid #e2e8f0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.gc-param-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: top;
}
.gc-param-table tr:last-child td {
  border-bottom: none;
}
.gc-param-table code {
  background: #f1f5f9;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  color: #0f172a;
}

/* ── API explorer ──────────────────────────────────────────────── */
.gc-explorer-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  overflow: hidden;
}
.gc-explorer-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
}
.gc-explorer-body {
  padding: 1rem;
}
.gc-explorer-response {
  background: #1e293b;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-top: 0.75rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.8125rem;
  color: #e2e8f0;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Public preview badge ──────────────────────────────────────── */
.gc-preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* ── Browsable API overrides ──────────────────────────────────── */
.gc-browsable-response {
  background: #1e293b;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.8125rem;
  line-height: 1.65;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Markdown description rendered by DRF */
.gc-description h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 1.5rem 0 0.75rem;
  color: #0f172a;
}
.gc-description h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
  color: #1e293b;
}
.gc-description p {
  margin: 0.5rem 0;
  color: #475569;
  line-height: 1.7;
}
.gc-description table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
}
.gc-description th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  border-bottom: 2px solid #e2e8f0;
  font-size: 0.8125rem;
}
.gc-description td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.8125rem;
}
.gc-description code {
  background: #f1f5f9;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  font-size: 0.8125rem;
}
.gc-description pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 0.75rem 0;
}
.gc-description pre code {
  background: none;
  color: inherit;
  padding: 0;
}
.gc-description blockquote {
  border-left: 3px solid var(--gc-teal);
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  background: #f0fdfa;
  border-radius: 0 0.375rem 0.375rem 0;
}
.gc-description blockquote p {
  color: #134e4a;
}

/* ── Copy-to-clipboard button on code blocks ───────────────── */
.gc-code-wrapper {
  position: relative;
}
.gc-code-copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  border-radius: 0.375rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1; /* slate-300 */
  cursor: pointer;
  opacity: 0;
  transition:
    opacity 0.15s,
    background 0.15s,
    color 0.15s;
}
.gc-code-wrapper:hover .gc-code-copy,
.gc-code-copy:focus-visible {
  opacity: 1;
}
.gc-code-copy:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #f1f5f9; /* slate-100 */
}
.gc-code-copy-copied,
.gc-code-copy-copied:hover {
  color: #34d399; /* emerald-400 */
  opacity: 1;
}

/* ── Search modal ─────────────────────────────────────────────── */
.gc-search-result {
  transition:
    background 0.1s,
    color 0.1s;
}
.gc-search-result:hover {
  background: #f8fafc; /* slate-50 */
}
.gc-search-result-active {
  background: #eff6ff; /* blue-50 */
}
.gc-search-result-active .text-slate-900 {
  color: var(--gc-blue, #1a56db);
}
.gc-search-result:last-child {
  border-bottom: none;
}

/* ── On-this-page TOC (right rail) ─────────────────────────────── */
.gc-toc-link {
  display: block;
  padding: 0.3rem 0.6rem;
  border-left: 2px solid transparent;
  font-size: 0.8125rem;
  line-height: 1.3;
  color: #64748b; /* slate-500 */
  text-decoration: none;
  transition:
    color 0.15s,
    border-color 0.15s,
    background 0.15s;
}
.gc-toc-link:hover {
  color: #0f172a; /* slate-900 */
}
.gc-toc-link-child {
  padding-left: 1.4rem;
  font-size: 0.75rem;
  color: #94a3b8; /* slate-400 */
}
.gc-toc-link-active {
  color: var(--gc-blue, #1a56db);
  border-left-color: var(--gc-blue, #1a56db);
  background: #f1f5f9; /* slate-100 */
  font-weight: 600;
}

/* ── Mermaid responsive ───────────────────────────────────────── */
.mermaid {
  width: 100%;
  text-align: center;
}
.mermaid svg {
  max-width: 100% !important;
  height: auto !important;
  display: inline-block;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .gc-docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .gc-docs-sidebar.gc-sidebar-open {
    transform: translateX(0);
  }
}
