/* Developer API reference pages (/developer/<slug>).
   The visual language matches the hand-written meme page so every endpoint
   reads as part of the same reference, rather than a generated stub. */

:root {
    --accent:      #a50f12;
    --accent-dim:  rgba(165, 15, 18,0.15);
    --accent-glow: rgba(165, 15, 18,0.35);
    --surface:     rgba(255,255,255,0.04);
    --surface-2:   rgba(255,255,255,0.07);
    --border:      rgba(255,255,255,0.08);
    --border-2:    rgba(255,255,255,0.14);
    --text:        #e8e8f0;
    --text-muted:  rgba(232,232,240,0.55);
    --green:       #3f9e63;
    --code-bg:     #0e1013;
}

body { background: #08090b; color: var(--text); font-family: 'Poppins', sans-serif; }

/* ── Hero ── */
.dev-hero {
    padding: 7rem 1.5rem 4rem;
    text-align: center;
    background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(165, 15, 18,0.18) 0%, transparent 70%);
}
.dev-hero-badge {
    display: inline-flex; align-items: center; gap: .45rem;
    background: var(--accent-dim); border: 1px solid var(--accent-glow);
    border-radius: 999px; padding: .3rem .9rem;
    font-size: .75rem; font-weight: 600; color: #c23a3d;
    margin-bottom: 1.5rem; letter-spacing: .04em; text-transform: uppercase;
}
.dev-hero-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); }
.dev-back {
    display: block; color: var(--text-muted); text-decoration: none;
    font-size: .9rem; margin-bottom: .75rem; transition: color .15s;
}
.dev-back:hover { color: var(--text); }
.dev-hero h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.7rem, 5vw, 3.4rem);
    font-weight: 900; line-height: 1.1;
    background: linear-gradient(135deg, #fff 0%, #c23a3d 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; margin-bottom: 1rem;
    /* API names are two or three words; balancing stops a lone word wrapping
       onto its own line on a phone. */
    text-wrap: balance;
}
.dev-hero p { font-size: 1.1rem; color: var(--text-muted); max-width: 560px; margin: 0 auto 2rem; line-height: 1.7; }
.dev-hero-stats { display: flex; justify-content: center; gap: 2.5rem; flex-wrap: wrap; margin-top: 2.5rem; }
.dev-stat { text-align: center; }
.dev-stat-val { font-family: 'Orbitron', sans-serif; font-size: 1.6rem; font-weight: 700; color: var(--accent); }
.dev-stat-label { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }

/* ── Layout ── */
/* Not inside the shared .main-container wrapper, so as a direct flex child of
   body this needs an explicit width:100% — cross-axis stretch alone does not
   reliably cap it to the viewport with wide code blocks below. */
.dev-wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 1.5rem 6rem; min-width: 0; box-sizing: border-box; }

/* ── Sections ── */
.dev-section { margin-bottom: 4rem; }
.dev-section-title {
    font-family: 'Orbitron', sans-serif; font-size: 1.1rem; font-weight: 700;
    color: #fff; letter-spacing: .05em; text-transform: uppercase;
    display: flex; align-items: center; gap: .6rem; margin-bottom: 1.25rem;
}
.dev-section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Cards ── */
.dev-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.5rem; }

/* ── Base URL strip ── */
.base-url-strip {
    background: var(--accent-dim); border: 1px solid var(--accent-glow);
    border-radius: 10px; padding: 1rem 1.25rem;
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.base-url-label { font-size: .7rem; font-weight: 700; color: #c23a3d; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.base-url-val { font-family: 'JetBrains Mono', monospace; font-size: .9rem; color: #fff; word-break: break-all; }

/* ── Endpoint block ── */
.endpoint-block {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; overflow: hidden; margin-bottom: 1.25rem;
}
.endpoint-head {
    display: flex; align-items: center; gap: .6rem;
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.method-badge {
    font-family: 'JetBrains Mono', monospace; font-size: .7rem; font-weight: 600;
    padding: .25rem .6rem; border-radius: 6px; text-transform: uppercase;
    background: rgba(34,197,94,0.15); color: #3f9e63; border: 1px solid rgba(34,197,94,0.3);
    white-space: nowrap;
}
.endpoint-path { font-family: 'JetBrains Mono', monospace; font-size: .92rem; color: #e2e8f0; word-break: break-all; }
.endpoint-path .param { color: #b98b2e; }
.endpoint-desc { font-size: .82rem; color: var(--text-muted); margin-left: auto; }
.endpoint-body { padding: 1.25rem; }
.endpoint-body p { font-size: .88rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 1rem; }
.no-params { font-style: italic; }

/* ── Params table ── */
/* 4 columns will not fit a phone; the wrapperless table scrolls in place. */
.param-table { width: 100%; border-collapse: collapse; font-size: .83rem; margin-bottom: 1.25rem; }
.param-table th { text-align: left; padding: .5rem .75rem; color: var(--text-muted); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border); }
.param-table td { padding: .55rem .75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.param-table tr:last-child td { border-bottom: none; }
.param-name { font-family: 'JetBrains Mono', monospace; color: #b98b2e; white-space: nowrap; }
.param-type { font-family: 'JetBrains Mono', monospace; color: #c23a3d; font-size: .78rem; }
.param-desc { font-size: .82rem; color: var(--text-muted); }
.param-opt  { font-size: .7rem; color: var(--text-muted); background: var(--surface-2); border-radius: 4px; padding: .1rem .4rem; white-space: nowrap; }
.param-req  { font-size: .7rem; color: #c23a3d; background: rgba(248,113,113,.1); border-radius: 4px; padding: .1rem .4rem; white-space: nowrap; }

/* ── Code blocks ── */
/* Nine language tabs never fit a phone as a fixed row; scrolling the strip
   horizontally, not wrapping it, is the standard tab pattern. */
.code-tabs { display: flex; gap: .25rem; padding: .6rem .75rem 0; overflow-x: auto; }
.code-tab {
    font-family: 'JetBrains Mono', monospace; font-size: .72rem; font-weight: 600;
    padding: .35rem .8rem; border-radius: 6px 6px 0 0; cursor: pointer;
    color: var(--text-muted); background: transparent; border: none;
    transition: color .15s, background .15s; flex-shrink: 0;
}
.code-tab.active { background: var(--code-bg); color: #fff; }
.code-tab:hover:not(.active) { color: var(--text); }
.code-block-wrap { position: relative; }
.code-block {
    background: var(--code-bg); border-radius: 0 8px 8px 8px;
    padding: 1.1rem 1.25rem; overflow-x: auto;
    font-family: 'JetBrains Mono', monospace; font-size: .8rem; line-height: 1.65;
    color: #cdd6f4; white-space: pre; margin: 0;
}
.code-block.top-flush { border-radius: 8px; }
.code-copy {
    position: absolute; top: .5rem; right: .5rem; z-index: 1;
    background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 6px;
    padding: .3rem .6rem; cursor: pointer; font-size: .7rem; color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace; transition: color .15s, background .15s;
}
.code-copy:hover { color: #fff; background: var(--surface); }
.code-copy.copied { color: var(--green); }
.samples { margin-top: 1.25rem; }

/* Syntax colours */
.kw  { color: #cba6f7; }
.str { color: #a6e3a1; }
.num { color: #fab387; }
.cmt { color: #6c7086; font-style: italic; }
.fn  { color: #89b4fa; }
.key { color: #f38ba8; }
.val { color: #a6e3a1; }

.response-label { font-size: .72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: .4rem; }

/* ── Other APIs grid ── */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .6rem; }
.cat-chip {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; padding: .55rem .75rem;
    display: flex; align-items: center; gap: .5rem;
    font-size: .82rem; color: var(--text); text-decoration: none;
    transition: border-color .15s, background .15s;
}
.cat-chip:hover { border-color: var(--accent-glow); background: var(--accent-dim); }

/* ── Playground ── */
.playground-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.5rem; }
.playground-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: .25rem; }
.playground-card p  { font-size: .84rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.playground-controls { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.playground-input {
    background: var(--surface-2); border: 1px solid var(--border-2);
    border-radius: 8px; padding: .55rem .85rem; color: #fff;
    font-family: 'JetBrains Mono', monospace; font-size: .85rem;
    flex: 1 1 300px; min-width: 0;
}
.playground-input:focus { outline: 2px solid var(--accent-glow); outline-offset: 1px; }
.playground-btn {
    background: var(--accent); border: none; border-radius: 8px;
    padding: .55rem 1.4rem; color: #fff; font-family: 'Poppins', sans-serif;
    font-size: .85rem; font-weight: 600; cursor: pointer; white-space: nowrap;
    transition: opacity .15s;
}
.playground-btn:hover { opacity: .85; }
.playground-btn:disabled { opacity: .5; cursor: not-allowed; }
.playground-out {
    border-radius: 8px; max-height: 420px; overflow: auto;
    white-space: pre-wrap; word-break: break-word; color: var(--text-muted);
}
.playground-out.ok    { color: #cdd6f4; }
.playground-out.error { color: #c23a3d; }

/* ── Responsive ── */
@media (max-width: 640px) {
    .dev-hero { padding: 5rem 1.25rem 3rem; }
    .dev-hero p { font-size: 1rem; }
    .dev-hero-stats { gap: 1.5rem; }
    .dev-wrap { padding: 0 1rem 4rem; }
    .dev-section { margin-bottom: 3rem; }
    .endpoint-head { flex-direction: column; align-items: flex-start; }
    .endpoint-desc { margin-left: 0; }
    .cat-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    /* Stack the parameter table into labelled rows — 4 columns of prose is
       unreadable at 360px, and a sideways-scrolling table hides the
       description, which is the column that matters most. */
    .param-table thead { display: none; }
    .param-table, .param-table tbody, .param-table tr, .param-table td { display: block; width: 100%; }
    .param-table tr { border-bottom: 1px solid var(--border); padding: .6rem 0; }
    .param-table tr:last-child { border-bottom: none; }
    .param-table td { border-bottom: none; padding: .15rem 0; }
    .param-table .param-name { font-size: .9rem; }
}

@media (prefers-reduced-motion: reduce) {
    .code-tab, .code-copy, .cat-chip, .playground-btn, .dev-back { transition: none; }
}

/* Phones: the code tabs and copy button were 26px tall — too small to hit with a thumb. */
@media (max-width: 768px) {
    .code-tab { min-height: 40px; padding: .5rem .9rem; }
    .code-copy { min-height: 36px; min-width: 56px; padding: .4rem .75rem; }
    /* The copy button sat on the first line of the sample. */
    .code-block-wrap .code-block { padding-top: 3rem; }
}
