/* ==========================================================================
   Multiplayer API — site design system
   Dark enterprise theme. Single shared stylesheet for every public page.
   Loaded via <link rel="stylesheet" href="/assets/site.css"> from
   src/partials/head.php — do not reintroduce per-page <style> blocks.
   ========================================================================== */

:root {
    /* Surfaces */
    --bg: #0a0d13;
    --bg-2: #0d1119;
    --surface: #11151e;
    --surface-2: #161b26;
    --surface-3: #1b2130;

    /* Borders */
    --border: rgba(148, 163, 184, 0.12);
    --border-strong: rgba(148, 163, 184, 0.24);

    /* Text */
    --text: #e7eaf0;
    --text-2: #98a2b3;
    --text-3: #667085;

    /* Accent (single brand color — indigo) */
    --accent: #4f46e5;
    --accent-hover: #6366f1;
    --accent-text: #a5b4fc;
    --accent-soft: rgba(99, 102, 241, 0.12);
    --accent-border: rgba(99, 102, 241, 0.35);

    /* Status */
    --success: #34d399;
    --success-soft: rgba(52, 211, 153, 0.10);
    --success-border: rgba(52, 211, 153, 0.28);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, 0.10);
    --warn-border: rgba(251, 191, 36, 0.28);
    --danger: #f87171;

    /* Code blocks */
    --code-bg: #0e1420;
    --code-text: #dbe2ee;
    --code-comment: #64748b;
    --code-keyword: #7dd3fc;
    --code-string: #f0a988;
    --code-number: #a7d3a9;
    --code-type: #5eead4;
    --code-function: #e5c07b;
}

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
    color-scheme: dark;
}

/* --------------------------------------------------------------------------
   Page background (replaces the old animated rainbow .animated-bg)
   -------------------------------------------------------------------------- */
.site-bg {
    background-color: var(--bg);
    background-image:
        radial-gradient(1100px 480px at 50% -8%, rgba(99, 102, 241, 0.10), transparent 60%),
        radial-gradient(900px 420px at 85% 110%, rgba(56, 189, 248, 0.05), transparent 60%);
    background-attachment: fixed;
    color: var(--text);
}

/* --------------------------------------------------------------------------
   Surfaces (replaces .glass-effect — flat matte card, no blur)
   -------------------------------------------------------------------------- */
.surface {
    background: var(--surface);
    border: 1px solid var(--border);
}

.surface-2 {
    background: var(--surface-2);
    border: 1px solid var(--border);
}

/* Card hover (replaces .floating-card) */
.lift {
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.lift:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

/* Section header band inside doc cards (replaces colored gradient bands) */
.band {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

/* Icon tile (replaces the per-brand gradient circles/squares) */
.icon-tile {
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
}

.icon-tile i,
.icon-tile svg {
    color: var(--accent-text) !important;
}

/* Neutral icon tile for non-brand contexts */
.icon-tile-neutral {
    background: var(--surface-3);
    border: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn-primary {
    background: var(--accent);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.15s ease, border-color 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: rgba(255, 255, 255, 0.14);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-strong);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover {
    background: var(--surface-2);
    border-color: rgba(148, 163, 184, 0.4);
}

/* Nav links in the shared header */
.nav-link {
    color: var(--text-2);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: color 0.15s ease, background 0.15s ease;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

/* Headline accent (replaces gradient text) */
.text-accent {
    color: var(--accent-text);
}

/* Big stats number (replaces gradient-clipped numbers) */
.stats-number {
    color: var(--accent-text);
}

/* --------------------------------------------------------------------------
   Code blocks / Prism overrides
   -------------------------------------------------------------------------- */
pre {
    background: var(--code-bg);
    color: var(--code-text);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Andale Mono', monospace;
    font-size: 0.85em;
    line-height: 1.5;
    tab-size: 4;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    max-height: 100vh;
    border: 1px solid var(--border);
}

pre code {
    background: transparent;
    padding: 0;
    margin: 0;
    white-space: pre;
    word-break: normal;
    word-wrap: normal;
}

pre code.language-json {
    white-space: pre-wrap;
    word-break: break-word;
    display: block;
    overflow-x: auto;
}

pre::-webkit-scrollbar {
    height: 8px;
}

pre::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
}

pre::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

pre::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* Prism token colors — uniform across every doc page */
.token { background: none !important; }

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata { color: var(--code-comment) !important; }

.token.keyword,
.token.operator,
.token.boolean,
.token.selector { color: var(--code-keyword) !important; }

.token.string,
.token.attr-value,
.token.char,
.token.builtin { color: var(--code-string) !important; }

.token.number,
.token.constant,
.token.symbol { color: var(--code-number) !important; }

.token.class-name,
.token.type-definition { color: var(--code-type) !important; }

.token.function,
.token.maybe-class-name { color: var(--code-function) !important; }

/* Responsive API tables (used on index + api docs) */
@media (max-width: 768px) {
    .grid.grid-cols-12 {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .grid.grid-cols-12 > div {
        grid-column: 1 / -1;
        padding: 0.5rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .grid.grid-cols-12 > div:last-child {
        border-bottom: none;
    }

    pre {
        padding: 0.75rem;
        font-size: 0.8em;
        margin: 0.75rem -0.5rem;
        border-radius: 0;
    }

    .font-mono, code, pre {
        word-break: break-word;
        white-space: pre-wrap;
        word-wrap: break-word;
    }

    .space-y-4 > div {
        margin-bottom: 1rem;
    }

    button, .btn-primary, .btn-secondary {
        min-height: 44px;
        padding: 0.5rem 1rem;
    }
}

/* --------------------------------------------------------------------------
   Scrollbars
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.refreshing {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fa-spinner.fa-spin {
    animation: spin 1s linear infinite;
}

/* --------------------------------------------------------------------------
   FAQ accordion
   -------------------------------------------------------------------------- */
details summary::-webkit-details-marker {
    display: none;
}

details[open] .faq-chevron {
    transform: rotate(180deg);
}

/* --------------------------------------------------------------------------
   Server pages
   -------------------------------------------------------------------------- */
.server-card {
    background: var(--surface);
    border: 1px solid var(--border);
    transition: border-color 0.2s ease;
}

.server-card:hover {
    border-color: var(--border-strong);
}

.region-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 0.75rem;
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
}

.region-icon i {
    color: var(--accent-text) !important;
}

.server-item {
    background: var(--surface-2);
    border: 1px solid var(--border);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.server-item:hover {
    background: var(--surface-3);
    border-color: var(--accent-border);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background: var(--success-soft);
    border: 1px solid var(--success-border);
    color: var(--success);
}

.status-planning {
    background: var(--warn-soft);
    border: 1px solid var(--warn-border);
    color: var(--warn);
}

.server-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* City page uses the same .status-active token with larger padding */
.status-active.status-hero {
    padding: 8px 24px;
    font-size: 14px;
}

/* --------------------------------------------------------------------------
   Cabinet
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .mobile-table {
        display: none;
    }

    .mobile-cards {
        display: block;
    }

    .api-key-card {
        background: var(--surface-2);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 16px;
        margin-bottom: 12px;
        transition: border-color 0.2s ease;
    }

    .api-key-card:hover {
        border-color: var(--border-strong);
    }
}

@media (min-width: 769px) {
    .mobile-table {
        display: table;
    }

    .mobile-cards {
        display: none;
    }
}

.copy-btn {
    background: var(--surface-3);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.copy-btn:hover {
    background: rgba(148, 163, 184, 0.18);
    border-color: var(--border-strong);
}

.copy-btn.copied {
    background: var(--success-soft);
    border-color: var(--success-border);
    color: var(--success);
}

/* Dark dropdowns */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2398a2b3'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

select option {
    background: var(--surface-2);
    color: var(--text);
    padding: 8px 12px;
}
