@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400;500&display=swap');

/* ─── Tokens ─────────────────────────────────────────────── */
:root {
    --bg:          #060810;
    --bg-2:        #0d0f1a;
    --bg-3:        #111422;
    --surface:     rgba(18, 21, 38, 0.85);
    --border:      rgba(255, 255, 255, 0.06);
    --border-hover:rgba(255, 255, 255, 0.13);
    --accent:      #6366f1;
    --accent-2:    #0ea5e9;
    --accent-glow: rgba(99, 102, 241, 0.35);
    --green:       #22d3a5;
    --red:         #f87171;
    --yellow:      #fbbf24;
    --text-1:      #f0f2ff;
    --text-2:      #8b92b8;
    --text-3:      #555c85;
    --code-bg:     #0b0e1c;
    --sidebar-w:   268px;
    --radius:      14px;
    --radius-sm:   8px;
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

/* ─── Custom Scrollbars ──────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.35);
    border-radius: 99px;
    transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.65);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.35) transparent;
}

body {
    font-family: 'Geist', 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text-1);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated background gradient */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -20%;
    width: 60%;
    height: 80%;
    background: radial-gradient(ellipse, rgba(99,102,241,0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -30%;
    right: -10%;
    width: 50%;
    height: 70%;
    background: radial-gradient(ellipse, rgba(14,165,233,0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ─── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: 2rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.25rem; margin: 2.5rem 0 1rem; color: var(--text-1); }
h4 { font-size: 1rem; margin: 1.5rem 0 0.5rem; color: var(--text-1); }
p  { color: var(--text-2); font-size: 1.05rem; margin-bottom: 1.25rem; max-width: 780px; }

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
    font-family: 'Geist Mono', monospace;
    font-size: 0.875em;
    background: rgba(255,255,255,0.06);
    padding: 0.15em 0.45em;
    border-radius: 5px;
    color: #a5b4fc;
}

pre {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    position: relative;
}

pre code {
    background: transparent;
    padding: 0;
    color: #c4ccf4;
    font-size: 0.875rem;
    line-height: 1.9;
}

ul { color: var(--text-2); padding-left: 1.5rem; }
ul li { margin-bottom: 0.35rem; }

/* ─── Sidebar ─────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: rgba(8, 10, 22, 0.95);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.75rem 1.25rem;
    z-index: 200;
    overflow-y: auto;
    backdrop-filter: blur(20px);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-1);
}

.logo-text span {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.version-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 99px;
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.3);
    color: #a5b4fc;
}

/* Nav Groups */
.nav-group { margin-bottom: 1.75rem; }

.nav-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-3);
    display: block;
    margin-bottom: 0.5rem;
    padding-left: 0.75rem;
}

.sidebar nav ul { list-style: none; padding: 0; }
.sidebar nav ul li { margin-bottom: 2px; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-2);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    text-decoration: none;
}

.nav-icon { font-size: 0.85rem; }

.nav-link:hover {
    color: var(--text-1);
    background: rgba(255,255,255,0.04);
    text-decoration: none;
}

.nav-link.active {
    color: var(--text-1);
    background: rgba(99,102,241,0.12);
    border-left: 2px solid var(--accent);
}

/* Sidebar footer */
.sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-2);
}

.dot {
    width: 7px; height: 7px;
    border-radius: 50%;
}

.dot.online {
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ─── Main Content ───────────────────────────────────────── */
.content {
    margin-left: var(--sidebar-w);
    padding: 5rem 6rem;
    max-width: 1100px;
    position: relative;
    z-index: 1;
}

section {
    margin-bottom: 7rem;
    scroll-margin-top: 3rem;
    animation: fadeUp 0.5s ease both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.section-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 0.6rem;
}

/* ─── Hero Section ───────────────────────────────────────── */
.hero-section { padding-top: 1rem; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 1rem;
    border-radius: 99px;
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.25);
    color: #a5b4fc;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin-bottom: 1.25rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-sub {
    font-size: 1.15rem;
    color: var(--text-2);
    max-width: 620px;
    margin-bottom: 2.5rem;
}

.hero-urls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 3.5rem;
}

.url-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.25rem;
    max-width: 640px;
}

.url-chip code {
    background: transparent;
    padding: 0;
    color: #c4ccf4;
    font-size: 0.9rem;
}

.chip-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(74,222,128,0.12);
    border: 1px solid rgba(74,222,128,0.25);
    color: #4ade80;
    white-space: nowrap;
}

.chip-label.ws {
    background: rgba(99,102,241,0.12);
    border-color: rgba(99,102,241,0.3);
    color: #a5b4fc;
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.35rem;
    transition: border-color 0.25s, transform 0.25s;
}

.feature-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
}

.feature-icon { font-size: 1.5rem; margin-bottom: 0.6rem; }
.feature-card h4 { color: var(--text-1); margin: 0 0 0.4rem; font-size: 0.95rem; }
.feature-card p  { font-size: 0.85rem; margin: 0; line-height: 1.5; }

/* ─── Steps ──────────────────────────────────────────────── */
.step-list { display: flex; flex-direction: column; gap: 2rem; margin-top: 1.5rem; }

.step {
    display: flex;
    gap: 1.5rem;
}

.step-num {
    flex-shrink: 0;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.35);
    color: #a5b4fc;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.step-body { flex: 1; }
.step-body h4 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.step-body p  { margin: 0 0 0.75rem; }

/* ─── Endpoint Header ────────────────────────────────────── */
.endpoint-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.25rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.route-path {
    background: transparent;
    padding: 0;
    color: var(--accent-2);
    font-size: 1rem;
}

.alias-tag {
    font-size: 0.78rem;
    color: var(--text-3);
    margin-left: auto;
}

/* ─── Badges ─────────────────────────────────────────────── */
.badge {
    flex-shrink: 0;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.55rem;
    border-radius: 5px;
}

.badge.get {
    background: rgba(34,211,165,0.12);
    border: 1px solid rgba(34,211,165,0.3);
    color: var(--green);
}

.badge.ws {
    background: rgba(99,102,241,0.12);
    border: 1px solid rgba(99,102,241,0.3);
    color: #a5b4fc;
}

/* ─── Inline code block ──────────────────────────────────── */
.code-block {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.25rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.code-block code {
    background: transparent;
    padding: 0;
    color: #c4ccf4;
    font-size: 0.9rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-btn {
    flex-shrink: 0;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 0.78rem;
    padding: 0.25rem 0.65rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.copy-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-1);
}

/* ─── Tables ─────────────────────────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
    font-size: 0.9rem;
}

thead th {
    background: rgba(255,255,255,0.03);
    padding: 0.85rem 1rem;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-2);
    border-bottom: 1px solid var(--border);
}

tbody td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-2);
    vertical-align: top;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255,255,255,0.015); }

.required {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 99px;
    background: rgba(251,191,36,0.1);
    border: 1px solid rgba(251,191,36,0.25);
    color: var(--yellow);
    font-weight: 600;
}

/* ─── Auth ───────────────────────────────────────────────── */
.auth-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.auth-card h4 { margin-top: 0; margin-bottom: 0.75rem; font-size: 0.95rem; }
.auth-card pre { margin: 0; }

/* ─── Info Boxes ─────────────────────────────────────────── */
.info-box {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    background: rgba(14,165,233,0.07);
    border: 1px solid rgba(14,165,233,0.2);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    margin: 1.5rem 0;
}

.info-box.warning {
    background: rgba(251,191,36,0.07);
    border-color: rgba(251,191,36,0.25);
}

.info-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 2px; }
.info-box p { margin: 0; font-size: 0.9rem; }

/* ─── Response Type Card ─────────────────────────────────── */
.response-type-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    color: var(--text-2);
    margin: 1.5rem 0;
}

.resp-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-3);
}

/* ─── Event Cards ────────────────────────────────────────── */
.event-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
    transition: border-color 0.25s;
}

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

.event-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.event-badge {
    flex-shrink: 0;
    font-family: 'Geist Mono', monospace;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
}

.event-badge.update {
    background: rgba(34,211,165,0.1);
    border: 1px solid rgba(34,211,165,0.25);
    color: var(--green);
}

.event-badge.offline {
    background: rgba(248,113,113,0.1);
    border: 1px solid rgba(248,113,113,0.25);
    color: var(--red);
}

.event-badge.ping {
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.25);
    color: #a5b4fc;
}

.event-badge.sub {
    background: rgba(251,191,36,0.1);
    border: 1px solid rgba(251,191,36,0.25);
    color: var(--yellow);
}

.event-desc {
    font-size: 0.9rem;
    color: var(--text-2);
    line-height: 1.5;
}

.event-card pre {
    margin: 0;
    border: none;
    border-radius: 0;
    background: var(--code-bg);
}

/* ─── Plans ──────────────────────────────────────────────── */
.plan-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.plan-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
    text-align: center;
    position: relative;
    transition: transform 0.25s, border-color 0.25s;
}

.plan-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
}

.plan-card.featured {
    border-color: rgba(99,102,241,0.45);
    background: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, var(--surface) 60%);
}

.plan-card.enterprise {
    border-color: rgba(34,211,165,0.35);
    background: linear-gradient(135deg, rgba(34,211,165,0.06) 0%, var(--surface) 60%);
}

.plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    padding: 0.2rem 0.65rem;
    border-radius: 99px;
    background: var(--accent);
    color: white;
}

.plan-icon { font-size: 1.75rem; margin-bottom: 0.75rem; }
.plan-card h4 { font-size: 1rem; margin-bottom: 0.5rem; color: var(--text-1); }
.plan-card > p { font-size: 0.82rem; color: var(--text-3); margin: 0; }

.plan-stat {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-1), var(--text-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0.35rem 0 0.1rem;
    line-height: 1;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
    text-align: left;
    font-size: 0.83rem;
}

.plan-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-2);
}

.plan-features li:last-child { border-bottom: none; }

/* ─── Errors ─────────────────────────────────────────────── */
.error-list { display: flex; flex-direction: column; gap: 1rem; }

.error-item {
    background: rgba(248,113,113,0.04);
    border-left: 3px solid rgba(248,113,113,0.5);
    padding: 1.25rem 1.5rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.error-code {
    font-family: 'Geist Mono', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--red);
    display: block;
    margin-bottom: 0.4rem;
}

.error-item p { margin: 0; font-size: 0.9rem; }

/* ─── Footer ─────────────────────────────────────────────── */
footer {
    margin-left: var(--sidebar-w);
    border-top: 1px solid var(--border);
    padding: 2rem 6rem;
    position: relative;
    z-index: 1;
}

.footer-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-logo {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-1);
}

.footer-logo span {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-copy {
    font-size: 0.85rem;
    color: var(--text-3);
}

.footer-links {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--text-3);
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 1200px) {
    .content { padding: 4rem 3rem; max-width: 900px; }
    .feature-grid, .plan-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    .sidebar { width: 64px; padding: 1.25rem 0.75rem; }
    .logo-text, .version-badge, .nav-label, .nav-link span:not(.nav-icon), .sidebar-footer { display: none; }
    .nav-link { justify-content: center; padding: 0.65rem; }
    .nav-icon { font-size: 1rem; }
    .content, footer { margin-left: 64px; padding: 2.5rem 1.75rem; }
    .auth-methods { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .hero-title { font-size: 2.2rem; }
    .feature-grid, .plan-grid { grid-template-columns: 1fr; }
    .step { flex-direction: column; }
}
