/* ProjectBob.xyz — API Guide page */

.guide {
  max-width: 780px; margin: 0 auto; padding: 48px 24px 100px;
}

/* Hero */
.hero { margin-bottom: 40px; }
.hero h1 {
  font-size: 30px; font-weight: 700; color: var(--text); margin-bottom: 12px;
}
.hero .lead {
  font-size: 15px; color: var(--text-secondary); line-height: 1.7; max-width: 640px;
}

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 28px 28px 24px; margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}
.card h2 {
  font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 14px;
}
.card h3 {
  font-size: 14px; font-weight: 600; color: var(--text); margin: 20px 0 6px;
}
.card h3:first-of-type { margin-top: 12px; }
.card p {
  font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 12px;
}
.card p.muted {
  font-size: 13px; color: var(--text-muted); margin-bottom: 8px;
}
.card ul {
  padding-left: 20px; margin-bottom: 8px;
}
.card li {
  font-size: 14px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 4px;
}

/* Inline code */
.guide code {
  background: var(--accent-light); color: var(--accent); padding: 2px 6px;
  border-radius: 4px; font-size: 13px;
  font-family: var(--font-mono);
}

/* Code blocks */
.guide pre {
  background: var(--color-code-bg); color: var(--color-code-text); padding: 16px 20px; border-radius: 10px;
  overflow-x: auto; margin-bottom: 0; line-height: 1.55; font-size: 13px;
}
.guide pre code {
  background: none; color: inherit; padding: 0;
}
.code-block {
  position: relative; margin-bottom: 16px;
}
.copy-code-btn {
  position: absolute; top: 8px; right: 10px;
  padding: 4px 10px; border-radius: 5px; border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.5);
  font-size: 11px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.copy-code-btn:hover {
  background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.8);
}

/* Install line (pip) */
.card .install-line { margin-bottom: 16px; }

/* Token box */
.token-box {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px;
}
.token-box code {
  flex: 1; background: none; color: var(--text); font-size: 11.5px;
  word-break: break-all; padding: 0;
}
.copy-btn {
  padding: 5px 14px; border-radius: 6px; border: 1px solid var(--accent);
  background: transparent; color: var(--accent); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.copy-btn:hover { background: var(--accent); color: #fff; }

/* Download button */
.download-btn {
  display: inline-block; padding: 7px 18px; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 600;
  text-decoration: none; transition: background 0.2s; margin-top: 4px;
}
.download-btn:hover { background: var(--accent-hover); color: #fff; }

/* ── Live position strip ── */
.live-strip { padding: 24px; }
.live-strip h3 {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); margin: 0 0 10px;
}
.mini-map {
  width: 100%; height: 280px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border);
}
.map-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; gap: 12px;
}
.mini-map-label {
  font-size: 13px; color: var(--text-secondary); margin: 0;
  font-family: var(--font-mono);
}
.run-btn-sm { padding: 5px 16px; font-size: 12px; }

/* ── Run button + result box ── */
.run-btn {
  display: inline-block; padding: 8px 24px; border-radius: 8px; border: none;
  background: var(--color-success); color: #fff; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: background 0.2s; letter-spacing: 0.3px;
}
.run-btn:hover { background: var(--color-success-hover); }
.run-btn:disabled { background: var(--text-muted); cursor: wait; }

.result-box {
  margin-top: 12px; padding: 14px 18px; border-radius: 10px;
  font-size: 14px; line-height: 1.7; display: none;
  font-family: var(--font-mono);
}
.result-box.loading {
  display: block; background: var(--accent-light); color: var(--text-secondary);
}
.result-box.success {
  display: block; background: rgba(34,197,94,0.08); color: var(--text);
  border: 1px solid rgba(34,197,94,0.15);
}
.result-box.success a { color: var(--accent); font-weight: 600; text-decoration: none; }
.result-box.success a:hover { text-decoration: underline; }
.result-box.error {
  display: block; background: rgba(239,68,68,0.08); color: var(--color-error);
  border: 1px solid rgba(239,68,68,0.12);
}

/* ── Query Playground ── */
.playground-editor {
  display: block; width: 100%; min-height: 120px; padding: 16px 20px;
  background: var(--color-code-bg); color: var(--color-code-text); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; font-family: var(--font-mono);
  font-size: 13px; line-height: 1.55; resize: vertical; margin-bottom: 12px;
  outline: none; tab-size: 2;
}
.playground-editor:focus {
  border-color: var(--accent); box-shadow: 0 0 0 2px rgba(59,125,216,0.15);
}
.playground-result {
  margin-top: 12px; border-radius: 10px; display: none;
}
.playground-result.loading {
  display: block; padding: 14px 18px;
  background: var(--accent-light); color: var(--text-secondary);
  font-family: var(--font-mono); font-size: 13px;
}
.playground-result.success { display: block; }
.playground-result.error {
  display: block; padding: 14px 18px;
  background: rgba(239,68,68,0.08); color: var(--color-error);
  border: 1px solid rgba(239,68,68,0.12);
  font-family: var(--font-mono); font-size: 13px;
}
.pg-table-wrap {
  overflow-x: auto; border: 1px solid var(--border); border-radius: 10px;
}
.pg-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
  font-family: var(--font-mono);
}
.pg-table th {
  text-align: left; padding: 8px 10px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted);
  background: var(--bg); border-bottom: 2px solid var(--border);
  white-space: nowrap; position: sticky; top: 0;
}
.pg-table td {
  padding: 6px 10px; border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary); max-width: 200px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.pg-table tr:hover td { background: var(--accent-light); }

/* Connection detail table */
.detail-table {
  width: 100%; border-collapse: collapse; margin-top: 4px;
}
.detail-table td {
  padding: 8px 0; font-size: 14px; border-bottom: 1px solid var(--border-subtle);
}
.detail-table td:first-child { color: var(--text-muted); width: 130px; font-size: 13px; }
.detail-table td:last-child { font-weight: 500; }

/* Group label above field tables */
.card .group-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--accent);
  margin: 24px 0 8px;
}
.card .group-label:first-of-type { margin-top: 8px; }

/* Fields table */
.fields-table {
  width: 100%; border-collapse: collapse; margin-bottom: 8px;
}
.fields-table th {
  text-align: left; padding: 6px 10px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}
.fields-table td {
  padding: 7px 10px; font-size: 13px; border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
.fields-table td:first-child {
  font-family: var(--font-mono);
  color: var(--text);
}
.fields-table td:nth-child(2) { color: var(--text-muted); font-size: 12px; width: 50px; }
.fields-table td:nth-child(3) { color: var(--text-muted); font-size: 12px; width: 70px; }

/* Fair use section */
.fair-use {
  background: var(--accent-light); border-color: rgba(59,125,216,0.12);
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .guide { padding: 32px 16px 80px; }
  .card { padding: 20px 18px 18px; border-radius: 12px; }
  .hero h1 { font-size: 24px; }
  .mini-map { height: 200px; }
  .map-footer { flex-direction: column; align-items: flex-start; }
  .fields-table td:nth-child(3) { display: none; }
  .fields-table th:nth-child(3) { display: none; }
  .playground-editor { min-height: 100px; font-size: 12px; }
  .pg-table { font-size: 11px; }
}
