/* /scripts page styles. Self-hosted only — no external fonts. */

.scripts-page {
    max-width: 980px;
    margin: 0 auto;
    padding: 24px 16px 64px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1f2937;
}

.scripts-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    border-radius: 14px;
    padding: 44px 36px 36px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}
.scripts-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}
.scripts-hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 10px;
    letter-spacing: -0.02em;
    position: relative;
}
.scripts-hero > p {
    color: #94a3b8;
    margin: 0 0 24px;
    font-size: 1.05rem;
    position: relative;
}
.hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    position: relative;
}
.hero-chip {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.14);
    color: #e2e8f0;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 100px;
    white-space: nowrap;
}

.api-key-notice {
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 24px 0;
    font-size: 0.95rem;
    color: #78350f;
}
.api-key-notice p { margin: 0; }
.api-key-notice code {
    background: #fffbeb;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    color: #92400e;
}
.api-key-notice a { color: #1d4ed8; }

/* ── Demo notice ─────────────────────────────────────────────────────────── */
.demo-notice {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 0 0 24px;
    font-size: 0.95rem;
    color: #1e3a8a;
}
.demo-notice p      { margin: 0; }
.demo-notice a      { color: #1d4ed8; font-weight: 600; }
.demo-notice strong { color: #1e40af; }

.scripts-jump {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 40px;
}
.jump-pill {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.83rem;
    font-weight: 600;
    text-decoration: none;
    border: 1.5px solid;
    transition: background 0.12s;
}
.jump-pill.cat-results  { color: #1d4ed8; border-color: #bfdbfe; background: #fff; }
.jump-pill.cat-results:hover  { background: #eff6ff; }
.jump-pill.cat-stats    { color: #b45309; border-color: #fde68a; background: #fff; }
.jump-pill.cat-stats:hover    { background: #fffbeb; }
.jump-pill.cat-random   { color: #065f46; border-color: #a7f3d0; background: #fff; }
.jump-pill.cat-random:hover   { background: #ecfdf5; }
.jump-pill.cat-check    { color: #6d28d9; border-color: #ddd6fe; background: #fff; }
.jump-pill.cat-check:hover    { background: #f5f3ff; }
.jump-pill.cat-account  { color: #374151; border-color: #d1d5db; background: #fff; }
.jump-pill.cat-account:hover  { background: #f9fafb; }
.jump-pill.cat-patterns { color: #374151; border-color: #d1d5db; background: #fff; }
.jump-pill.cat-patterns:hover { background: #f9fafb; }

.scripts-category {
    margin: 48px 0 24px;
    border-top: 1px solid #e5e7eb;
    padding-top: 24px;
}
.scripts-category h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    font-size: 1.35rem;
}
.scripts-category h2::before {
    content: '';
    display: block;
    width: 13px;
    height: 13px;
    border-radius: 3px;
    flex-shrink: 0;
}
#cat-results h2::before  { background: #1d4ed8; }
#cat-stats   h2::before  { background: #d97706; }
#cat-random  h2::before  { background: #059669; }
#cat-check   h2::before  { background: #7c3aed; }
#cat-account h2::before  { background: #475569; }
.scripts-category-desc { color: #4b5563; margin-top: 0; }

.script-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #e5e7eb;
    border-radius: 0 8px 8px 0;
    padding: 20px 20px 16px;
    margin: 16px 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: box-shadow 0.15s, border-left-color 0.15s;
}
.script-card:hover {
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}

/* Category accent borders */
.script-card[data-category="results"]  { border-left-color: #1d4ed8; }
.script-card[data-category="stats"]    { border-left-color: #d97706; }
.script-card[data-category="random"]   { border-left-color: #059669; }
.script-card[data-category="check"]    { border-left-color: #7c3aed; }
.script-card[data-category="account"]  { border-left-color: #475569; }
.script-card[data-category="patterns"] { border-left-color: #e5e7eb; }

.script-card-header h3 { margin: 0 0 4px; font-size: 1.05rem; }
.script-card-header p  { margin: 4px 0; color: #4b5563; }

.script-endpoint {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 8px 0 0;
    flex-wrap: wrap;
}
.script-endpoint code {
    background: #f3f4f6;
    padding: 3px 8px;
    border-radius: 0 4px 4px 0;
    font-size: 0.85rem;
    border: 1px solid #e5e7eb;
    border-left: none;
}

/* GET / POST method badges */
.method-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 4px 0 0 4px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    letter-spacing: 0.05em;
    border: 1px solid;
    white-space: nowrap;
    flex-shrink: 0;
}
.method-get  { background: #dcfce7; color: #15803d; border-color: #86efac; }
.method-post { background: #fef3c7; color: #92400e; border-color: #fde68a; }

.script-tabs { display: flex; gap: 4px; margin: 12px 0 0; }
.script-tabs button {
    padding: 6px 12px;
    border: 1px solid #e5e7eb;
    border-bottom: none;
    background: #f9fafb;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 0.9rem;
}
.script-tabs button.active { background: #1f2937; color: #fff; border-color: #1f2937; }

.script-pane pre {
    margin: 0;
    padding: 16px;
    background: #1f2937;
    color: #e5e7eb;
    border-radius: 0 6px 6px 6px;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.5;
}
.script-pane code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }

[data-api-key-token] {
    background: #fef3c7;
    color: #92400e;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 600;
}
.script-actions { margin-top: 10px; display: flex; gap: 8px; }
.script-actions button {
    padding: 5px 13px;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.83rem;
    font-weight: 500;
    color: #374151;
    transition: background 0.1s, border-color 0.1s;
}
.script-actions button:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.patterns-section {
    margin: 48px 0;
    border-top: 2px solid #e5e7eb;
    padding-top: 24px;
}


@media (max-width: 640px) {
    .scripts-hero { padding: 28px 20px 24px; border-radius: 10px; }
    .scripts-hero h1 { font-size: 1.65rem; }
    .scripts-jump { gap: 6px; }
    .jump-pill { font-size: 0.78rem; padding: 5px 12px; }
    .script-card { padding: 14px 14px 12px; }
}

.script-preview {
    margin-top: 16px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}
.script-preview h4 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 12px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    font-weight: 700;
}
.live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    flex-shrink: 0;
    animation: live-pulse 2.2s ease-in-out infinite;
}
@keyframes live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.45; transform: scale(0.85); }
}
.preview-summary {
    background: #ecfdf5;
    border-left: 3px solid #10b981;
    padding: 8px 12px;
    border-radius: 4px;
    color: #065f46;
    font-size: 0.95rem;
}
.preview-raw {
    margin-top: 8px;
    font-size: 0.85rem;
}
.preview-raw summary {
    cursor: pointer;
    color: #4b5563;
    user-select: none;
}
.preview-raw pre {
    margin: 8px 0 0;
    padding: 12px;
    background: #f9fafb;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* ── Demo panel (control strip) ─────────────────────────────────────────── */
.demo-panel {
    margin-top: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
}

.demo-panel-note {
    font-size: 0.82rem;
    color: #4b5563;
    margin: 0 0 10px;
    line-height: 1.4;
}

.demo-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
}

.demo-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.demo-label-text {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

.demo-select,
.demo-input {
    height: 34px;
    padding: 0 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    font-size: 0.85rem;
    color: #1f2937;
    outline: none;
    transition: border-color 0.12s;
}
.demo-select:focus,
.demo-input:focus { border-color: #1d4ed8; box-shadow: 0 0 0 2px rgba(29,78,216,0.12); }

.demo-select       { min-width: 140px; }
.demo-input        { min-width: 110px; }
.demo-text         { min-width: 180px; }
.demo-number       { width: 68px; }
.demo-numbers      { min-width: 200px; }
.demo-apikey       { min-width: 220px; font-family: ui-monospace, monospace; font-size: 0.8rem; }

.demo-textarea {
    width: 100%;
    min-height: 80px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    font-size: 0.83rem;
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    color: #1f2937;
    resize: vertical;
    outline: none;
    transition: border-color 0.12s;
}
.demo-textarea:focus { border-color: #1d4ed8; box-shadow: 0 0 0 2px rgba(29,78,216,0.12); }

/* When textarea is present, controls stack vertically */
.demo-controls:has(.demo-textarea) {
    flex-direction: column;
    align-items: stretch;
}
.demo-controls:has(.demo-textarea) .demo-run-btn { align-self: flex-end; }

.demo-run-btn {
    height: 34px;
    padding: 0 18px;
    background: #1d4ed8;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    transition: background 0.12s, transform 0.08s;
    align-self: flex-end;
}
.demo-run-btn:hover:not(:disabled) { background: #1e40af; transform: translateY(-1px); }
.demo-run-btn:active                { transform: translateY(0); }
.demo-run-btn:disabled              { opacity: 0.55; cursor: not-allowed; transform: none; }
.demo-run-btn.demo-exhausted        { background: #9ca3af; }

/* ── Preview section state ───────────────────────────────────────────────── */
.demo-preview-empty { display: none; }

/* ── Demo limit message ──────────────────────────────────────────────────── */
.demo-limit-msg {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    padding: 10px 14px;
    border-radius: 0 4px 4px 0;
    font-size: 0.88rem;
    color: #78350f;
}
.demo-limit-msg a { color: #92400e; font-weight: 600; }

@media (max-width: 640px) {
    .demo-controls { flex-direction: column; align-items: stretch; }
    .demo-run-btn  { width: 100%; height: 40px; }
    .demo-select, .demo-input, .demo-numbers, .demo-apikey, .demo-text { width: 100%; }
}
