/* ── DESIGN TOKENS ──────────────────────────────────────────── */
:root {
    --bg-base:       #0f172a;
    --bg-surface:    #1e293b;
    --bg-terminal:   #020617;
    --border-color:  #334155;
    --text-primary:  #f8fafc;
    --text-muted:    #94a3b8;
    --text-body:     #cbd5e1;
    --accent-sky:    #38bdf8;
    --accent-emerald:#10b981;
    --header-height: 64px;
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-body);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ── HEADER ─────────────────────────────────────────────────── */
.app-header {
    height: var(--header-height);
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    gap: 16px;
}

.logo-area {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.logo-url { text-decoration: none; color: #ffffff; }
.logo-url:visited { color: inherit; }
.logo-accent { color: var(--accent-sky); }

.console-badge {
    font-size: 0.75rem;
    font-weight: 400;
    background-color: rgba(56, 189, 248, 0.1);
    color: var(--accent-sky);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 10px;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

/* ── HEADER NAV ─────────────────────────────────────────────── */
.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    margin-left: 32px;
}

.header-nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    transition: color 0.15s, background-color 0.15s;
}

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

.user-auth-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.user-auth-actions > span {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.3;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── LAYOUT GRIDS ───────────────────────────────────────────── */
/* Playground: sidebar + content + right panel */
.layout-wrapper {
    margin-top: var(--header-height);
    display: grid;
    grid-template-columns: 320px 1fr 1fr;
    min-height: calc(100vh - var(--header-height));
}

/* Landing / docs: sidebar + content */
.layout-wrapper-aside-1-col {
    margin-top: var(--header-height);
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: calc(100vh - var(--header-height));
}

/* ── SIDEBAR ────────────────────────────────────────────────── */
.sidebar-nav {
    background-color: var(--bg-base);
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
}

.sidebar-scroller-panel {
    height: 100vh;
    overflow-y: auto;
}

.nav-group { margin-bottom: 24px; }

.nav-group h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding-left: 8px;
}

.nav-group ul { list-style: none; }

.nav-item {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    padding: 6px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
    color: #fff;
    background-color: rgba(56, 189, 248, 0.15);
}

/* ── BADGES ─────────────────────────────────────────────────── */
.badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 4px;
    margin-right: 8px;
    font-family: monospace;
}

.badge-get  { background: rgba(56, 189, 248, 0.15); color: var(--accent-sky); }
.badge-post { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }

/* ── MAIN CONTENT ───────────────────────────────────────────── */
.main-content {
    background-color: var(--bg-base);
    padding: 40px;
    overflow-y: auto;
    min-width: 0;
}

h1 { font-size: 2rem; color: var(--text-primary); margin-bottom: 12px; }
h2 { font-size: 1.4rem; color: var(--text-primary); margin-top: 32px; margin-bottom: 16px; }
h3 { color: var(--text-primary); }

.lead-text { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 24px; }

.hero-section { margin-bottom: 32px; }

/* ── INFO CARD ──────────────────────────────────────────────── */
.info-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
}

/* ── PARAMETERS TABLE ───────────────────────────────────────── */
.parameters-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    margin-bottom: 24px;
}

.parameters-table th,
.parameters-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.parameters-table th {
    background-color: rgba(30, 41, 59, 0.5);
    color: var(--text-primary);
    font-weight: 600;
}

/* ── CODE ───────────────────────────────────────────────────── */
code {
    font-family: 'Fira Code', Consolas, Monaco, monospace;
    /*background-color: var(--bg-surface);*/
    color: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.code-terminal {
    background-color: #010409;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
}

.code-terminal pre {
    margin: 0;
    padding: 4px;
    overflow-x: auto;
    font-family: 'Fira Code', Consolas, Monaco, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #e2e8f0;
    white-space: pre-wrap;
}

.code-terminal .json-key     { color: #ff7b72; font-weight: bold; }
.code-terminal .json-string  { color: #a5d6ff; }
.code-terminal .json-number  { color: #d2a8ff; }
.code-terminal .json-boolean { color: #ffadb1; }
.code-terminal .json-null    { color: #79c0ff; }
.code-terminal .json-comment { color: #8b949e; font-style: italic; }

/* ── TERMINAL METHOD BAR ────────────────────────────────────── */
.terminal-method-bar {
    background-color: var(--bg-terminal);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.85rem;
    margin-bottom: 15px;
    color: var(--accent-sky);
    overflow-x: auto;
    white-space: nowrap;
}

/* ── ENDPOINT SECTIONS ──────────────────────────────────────── */
.endpoints-specification { margin-top: 24px; }
.endpoints-specification h3 { font-size: 1rem; margin-bottom: 8px; }
.next-endpoint { margin-top: 40px; }

.section-divider { border: 0; border-top: 1px solid var(--border-color); margin: 40px 0; }

.required { color: #ef4444; }
.optional  { color: var(--text-muted); }

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    border: none;
    white-space: nowrap;
}

.btn-primary { background-color: #0284c7; color: #fff; }
.btn-primary:hover { background-color: #0369a1; }

.btn-secondary { color: var(--text-body); background-color: transparent; }
.btn-secondary:hover { color: var(--text-primary); }

.btn-execute {
    display: block;
    width: 100%;
    background-color: var(--accent-emerald);
    color: #fff;
    font-weight: 600;
    text-align: center;
    padding: 12px;
    margin-top: 24px;
}
.btn-execute:hover { background-color: #059669; }

/* ── MOBILE NAV BUTTON ──────────────────────────────────────── */
.mobile-nav-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
}

.mobile-nav-btn span {
    display: block;
    height: 2px;
    background: var(--text-muted);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

.mobile-nav-btn--open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-nav-btn--open span:nth-child(2) { opacity: 0; }
.mobile-nav-btn--open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── RESPONSIVE ─────────────────────────────────────────────── */

/* Tablet: collapse playground right panel */
@media (max-width: 1200px) {
    .layout-wrapper {
        grid-template-columns: 260px 1fr;
    }
    .layout-wrapper > *:last-child {
        display: none;
    }
}

/* Tablet: hide sidebar on landing/docs layout */
@media (max-width: 900px) {
    .layout-wrapper-aside-1-col {
        grid-template-columns: 1fr;
    }
    .layout-wrapper-aside-1-col .sidebar-nav {
        display: none;
    }
    .layout-wrapper {
        grid-template-columns: 1fr;
    }
    .layout-wrapper .sidebar-nav {
        display: none;
    }
}

/* Mobile: hamburger nav */
@media (max-width: 640px) {
    .app-header { padding: 0 16px; }

    .mobile-nav-btn { display: flex; }

    .user-auth-actions { display: none; }

    .header-nav {
        margin-left: 0px;
        display: none;
        flex-direction: column;
        gap: 4px;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border-color);
        padding: 16px;
        z-index: 999;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    }

    .header-nav.mobile-nav-open { display: flex; }

    .header-nav-link {
        padding: 10px 12px;
        font-size: 1rem;
    }

    .mobile-nav-auth {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding-top: 12px;
        margin-top: 8px;
        border-top: 1px solid var(--border-color);
    }

    .mobile-nav-auth .btn {
        width: 100%;
        text-align: center;
        padding: 10px 16px;
    }

    .btn { padding: 6px 12px; font-size: 0.8rem; }

    .main-content { padding: 20px 16px; }

    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.2rem; }
    .lead-text { font-size: 1rem; }

    .parameters-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .parameters-table { min-width: 480px; }
}

/* Hide mobile-only auth block on desktop */
.mobile-nav-auth { display: none; }
