
/* ==========================================================================
   ENDPOINT REFERENCE PAGES - Harmonized with MasLeads Modern Redesign
   ========================================================================== */

.endpoint-page {
    padding: 0;
    background: var(--ml-bg, #0d1420);
    color: var(--ml-text, #edf4ff);
    font-family: var(--font-sans, 'Onest', sans-serif);
}

.endpoint-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(380px, 0.85fr);
    min-height: calc(100vh - 68px);
    background: var(--ml-bg, #0d1420);
}

.endpoint-left {
    padding: 40px 48px 60px;
    overflow-y: auto;
    background: var(--ml-bg, #0d1420);
    border-right: 1px solid var(--ml-line, #2a3b51);
}

.endpoint-right {
    position: sticky;
    top: 68px;
    height: calc(100vh - 68px);
    overflow-y: auto;
    padding: 36px 32px;
    background: var(--ml-surface, #141e2d);
    color: var(--ml-text, #edf4ff);
    border-left: 1px solid var(--ml-line, #2a3b51);
}

/* --- Endpoint header --- */
.endpoint-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.endpoint-url {
    font-family: var(--font-mono, 'Recursive', monospace);
    font-size: 0.95rem;
    color: var(--color-text-secondary, #94a3b8);
    background: var(--color-bg-secondary, #0d131f);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
    word-break: break-all;
}

.endpoint-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin: 0 0 16px 0;
    color: var(--color-text, #f8fafc);
}

.endpoint-description {
    margin-bottom: 28px;
    line-height: 1.7;
    font-size: 1rem;
    color: var(--color-text-secondary, #94a3b8);
}

.endpoint-description p {
    margin: 0 0 12px 0;
}

.endpoint-description p:last-child {
    margin-bottom: 0;
}

/* --- Mental Model Banner --- */
.ml-ref-mental-model {
    background: var(--color-bg-secondary, #0d131f);
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 32px;
}

.ml-ref-model-header {
    margin-bottom: 20px;
}

.ml-ref-model-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #005cff;
    background: rgba(0, 92, 255, 0.12);
    border: 1px solid rgba(0, 92, 255, 0.25);
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.ml-ref-model-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: var(--color-text, #f8fafc);
}

.ml-ref-model-header p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--color-text-secondary, #94a3b8);
}

.ml-ref-model-steps {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.ml-ref-step-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.06));
    border-radius: 8px;
    padding: 16px;
}

.ml-ref-step-num {
    display: inline-block;
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    font-weight: 700;
    color: #005cff;
    margin-bottom: 6px;
}

.ml-ref-step-item strong {
    display: block;
    font-size: 0.875rem;
    color: var(--color-text, #f8fafc);
    margin-bottom: 6px;
}

.ml-ref-step-item p {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--color-text-secondary, #94a3b8);
    margin: 0;
}

.ml-ref-step-item code {
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    background: rgba(0, 92, 255, 0.1);
    color: #93c5fd;
    padding: 1px 4px;
    border-radius: 3px;
}

.ml-ref-model-rules {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border, rgba(255, 255, 255, 0.06));
    font-size: 0.8125rem;
    color: var(--color-text-secondary, #94a3b8);
}

.ml-ref-model-rules span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ml-ref-model-rules span span {
    color: #10b981;
    font-weight: bold;
}

/* --- Method badges --- */
.method-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 4px;
    line-height: 1.4;
    flex-shrink: 0;
    font-family: var(--font-mono, monospace);
}

.method-get { background: rgba(0, 92, 255, 0.14); color: #60a5fa; border: 1px solid rgba(0, 92, 255, 0.25); }
.method-post { background: rgba(16, 185, 129, 0.14); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.25); }
.method-put { background: rgba(245, 158, 11, 0.14); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.25); }
.method-delete { background: rgba(239, 68, 68, 0.14); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.25); }
.method-patch { background: rgba(245, 158, 11, 0.14); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.25); }

/* --- Parameter sections --- */
.params-section {
    margin-bottom: 32px;
}

.params-section h3 {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 16px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
    color: var(--color-text, #f8fafc);
}

.param-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--color-border, rgba(255, 255, 255, 0.06));
}

.param-item:last-child {
    border-bottom: none;
}

.param-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.param-name {
    font-weight: 600;
    font-family: var(--font-mono, monospace);
    font-size: 0.9375rem;
    color: var(--color-text, #f8fafc);
}

.param-type {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text-secondary, #94a3b8);
    font-family: var(--font-mono, monospace);
}

.param-required {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(239, 68, 68, 0.14);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.param-optional {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-muted, #7a899d);
}

.param-description {
    font-size: 0.875rem;
    color: var(--color-text-secondary, #94a3b8);
    margin: 6px 0;
    line-height: 1.55;
}

.param-constraints {
    font-size: 0.8125rem;
    color: var(--color-text-muted, #7a899d);
    margin: 4px 0;
}

.param-enum {
    font-size: 0.8125rem;
    color: var(--color-text-muted, #7a899d);
    margin: 4px 0;
}

.param-enum code {
    font-size: 0.8125rem;
    font-family: var(--font-mono, monospace);
    background: rgba(255, 255, 255, 0.06);
    color: #93c5fd;
    padding: 1px 5px;
    border-radius: 4px;
}

.param-default {
    font-size: 0.8125rem;
    color: var(--ml-muted, #aebbd0);
    margin: 4px 0;
}

.param-default code {
    font-size: 0.8125rem;
    font-family: var(--font-mono, monospace);
    background: rgba(255, 255, 255, 0.06);
    color: #93c5fd;
    padding: 1px 5px;
    border-radius: 4px;
}

.param-example {
    font-size: 0.8125rem;
    color: var(--ml-muted, #aebbd0);
    margin: 4px 0;
}

.param-example code {
    font-size: 0.8125rem;
    font-family: var(--font-mono, monospace);
    background: rgba(255, 255, 255, 0.06);
    color: #93c5fd;
    padding: 1px 5px;
    border-radius: 4px;
    word-break: break-all;
}

.param-children {
    margin: 12px 0 6px 14px;
    padding-left: 14px;
    border-left: 2px solid var(--ml-line, rgba(255, 255, 255, 0.15));
}

.param-children-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ml-muted, #aebbd0);
    margin: 10px 0 8px 0;
}

/* --- Status codes table --- */
.status-codes {
    margin-top: 32px;
}

.status-codes h3 {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 16px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
    color: var(--color-text, #f8fafc);
}

.status-codes table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.status-codes th,
.status-codes td {
    padding: 11px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border, rgba(255, 255, 255, 0.06));
}

.status-codes th {
    font-weight: 600;
    background: var(--color-bg-secondary, #0d131f);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted, #7a899d);
}

.status-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    padding: 2px 8px;
    border-radius: 4px;
    min-width: 36px;
    text-align: center;
}

.status-2xx { background: rgba(16, 185, 129, 0.14); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.25); }
.status-3xx { background: rgba(0, 92, 255, 0.14); color: #60a5fa; border: 1px solid rgba(0, 92, 255, 0.25); }
.status-4xx { background: rgba(245, 158, 11, 0.14); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.25); }
.status-5xx { background: rgba(239, 68, 68, 0.14); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.25); }

/* --- Right Side Panel (Option 2) --- */
.reference-side-panel {
    display: flex;
    flex-direction: column;
}

.reference-playground-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    width: 100%;
    box-sizing: border-box;
    background: #005cff;
    color: #ffffff !important;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s ease;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 92, 255, 0.5);
    box-shadow: 0 2px 10px rgba(0, 92, 255, 0.3);
}

.reference-playground-btn:hover {
    background: #004ad9;
    box-shadow: 0 4px 16px rgba(0, 92, 255, 0.45);
    transform: translateY(-1px);
}

.reference-url-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--ml-code, #09101a);
    border: 1px solid var(--ml-line, #2a3b51);
    border-radius: 8px;
    margin-bottom: 18px;
    overflow-x: auto;
}

.reference-url-badge code {
    font-size: 0.8125rem;
    font-family: var(--font-mono, 'Recursive', monospace);
    color: #93c5fd;
    word-break: break-all;
}

/* Code tabs inside endpoint-right */
.endpoint-right .code-tabs {
    background: var(--ml-code, #09101a);
    border: 1px solid var(--ml-line, #2a3b51);
    border-radius: 8px;
    overflow: hidden;
    margin: 0 0 20px 0;
}

.endpoint-right .code-tabs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--ml-surface-soft, #192638);
    border-bottom: 1px solid var(--ml-line, #2a3b51);
    padding: 0 12px;
}

.endpoint-right .code-tabs-nav {
    display: flex;
    gap: 0;
}

.endpoint-right .code-tab {
    background: none;
    border: none;
    padding: 10px 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: var(--font-sans, 'Onest', sans-serif);
    color: var(--ml-muted, #aebbd0);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
    margin-bottom: -1px;
}

.endpoint-right .code-tab:hover {
    color: var(--ml-text, #edf4ff);
}

.endpoint-right .code-tab.active {
    color: var(--ml-blue, #78a8ff);
    border-bottom-color: var(--ml-blue, #78a8ff);
    font-weight: 600;
}

.endpoint-right .code-copy-btn {
    background: transparent;
    border: 1px solid var(--ml-line, rgba(255, 255, 255, 0.1));
    color: var(--ml-muted, #aebbd0);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 3px 9px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.endpoint-right .code-copy-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.05);
}

.endpoint-right .code-copy-btn.copied {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.35);
}

.endpoint-right .code-panel {
    display: none;
    padding: 0;
    margin: 0;
}

.endpoint-right .code-panel.active {
    display: block;
}

.endpoint-right .code-panel pre {
    margin: 0;
    padding: 16px;
    background: var(--ml-code, #09101a);
    overflow-x: auto;
    max-height: 380px;
}

.endpoint-right .code-panel code {
    font-family: var(--font-mono, 'Recursive', monospace);
    font-size: 0.8125rem;
    line-height: 1.55;
    color: #edf4ff;
    white-space: pre;
}

/* Example response card */
.reference-response-card {
    background: var(--ml-code, #09101a);
    border: 1px solid var(--ml-line, #2a3b51);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 10px;
}

.reference-response-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--ml-surface-soft, #192638);
    border-bottom: 1px solid var(--ml-line, #2a3b51);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ml-text, #edf4ff);
}

.reference-response-body {
    margin: 0;
    padding: 16px;
    font-family: var(--font-mono, 'Recursive', monospace);
    font-size: 0.8125rem;
    line-height: 1.55;
    color: #93c5fd;
    background: var(--ml-code, #09101a);
    max-height: 360px;
    overflow-y: auto;
    white-space: pre;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .endpoint-layout {
        grid-template-columns: 1fr;
    }

    .endpoint-right {
        position: static;
        height: auto;
    }
}

@media (max-width: 768px) {
    .endpoint-left {
        padding: 24px 16px;
    }

    .endpoint-right {
        padding: 24px 16px;
    }

    .param-input {
        max-width: 100%;
    }

    .ml-ref-model-steps {
        grid-template-columns: 1fr;
    }
}
