/* Fuse AIs brand tokens — new design system (Poppins / IBM Plex Mono) */
:root {
    --navy: #0f1f45;
    --blue: #2b52e6;
    --blue-strong: #2b52e6;
    --blue-hover: #1c3ab0;
    --blue-tint: #eaf0ff;
    --accent: #2b52e6;
    --ink: #0f1f45;
    --body: #48577d;
    --muted: #7787ab;
    --line: #e8ecf5;
    --line-soft: #eef2f9;
    --surface: #ffffff;
    --surface-alt: #f4f7fd;
    --surface-soft: #fafbfe;
    --mono-ink: #34456f;
    --font-display: 'Poppins', 'Helvetica Neue', Helvetica, sans-serif;
    --font-body: 'Poppins', 'Helvetica Neue', Helvetica, sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(15, 31, 69, .06);
    --shadow: 0 10px 30px rgba(15, 31, 69, .08);
}

/* CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base Styles */
body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--ink);
    background-color: var(--surface-alt);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.flex {
    display: flex;
}

h1, h2, h3, h4 { font-family: var(--font-display); }

/* Header Styles */
header {
    background-color: var(--navy);
    color: white;
    padding: 30px 0;
}

header h1 {
    font-size: 28px;
    margin-bottom: 5px;
}

header p {
    font-size: 16px;
    opacity: 0.8;
}

/* Navigation Styles */
nav {
    width: 250px;
    background-color: white;
    border-right: 1px solid var(--line);
    padding: 20px 0;
    height: calc(100vh - 100px);
    position: sticky;
    top: 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 20px;
    padding: 0 20px;
}

.nav-section h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--navy);
}

.nav-note {
    font-size: 11px;
    color: #999;
    font-style: italic;
    margin: -5px 0 8px 0;
}

.nav-links {
    list-style: none;
}

.nav-links a {
    display: block;
    padding: 5px 0;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    border-left: 2px solid transparent;
    padding-left: 10px;
    transition: all 0.2s ease;
}

.nav-links a:hover {
    color: var(--blue-strong);
    border-left-color: var(--blue-strong);
}

.nav-links a.active {
    color: var(--blue-strong);
    border-left-color: var(--blue-strong);
}

/* Main Content Styles */
main {
    flex: 1;
    padding: 30px 20px;
    background-color: white;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.05);
}

section {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

section h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--navy);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

section p {
    margin-bottom: 15px;
}

/* Endpoint Styles */
.endpoint {
    margin-bottom: 30px;
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
}

.endpoint-header {
    display: flex;
    align-items: center;
    background-color: var(--surface-alt);
    padding: 10px 15px;
    border-bottom: 1px solid var(--line);
}

.method {
    padding: 5px 10px;
    color: white;
    border-radius: 3px;
    font-weight: bold;
    font-size: 14px;
    margin-right: 15px;
}

.get {
    background-color: #61affe;
}

.post {
    background-color: #49cc90;
}

.put {
    background-color: #fca130;
}

.delete {
    background-color: #f93e3e;
}

.endpoint-path {
    font-family: monospace;
    font-size: 14px;
    color: #3b4151;
}

.endpoint-body {
    padding: 20px;
}

.description {
    margin-bottom: 15px;
    font-size: 15px;
}

/* Parameter Tables */
.section-title {
    font-size: 16px;
    font-weight: bold;
    margin: 20px 0 10px;
    color: var(--navy);
}

.params-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.params-table th, .params-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.params-table th {
    font-weight: 600;
    background-color: var(--surface-alt);
}

.param-required {
    background-color: #ff4d4f;
    color: white;
    font-size: 12px;
    padding: 2px 5px;
    border-radius: 3px;
}

.param-optional {
    background-color: #d9d9d9;
    color: var(--ink);
    font-size: 12px;
    padding: 2px 5px;
    border-radius: 3px;
}

/* Code Blocks */
.code-block {
    position: relative;
    background-color: #2d2d2d;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #1e1e1e;
    border-bottom: 1px solid #181a1f;
}

.code-tabs {
    display: flex;
    background-color: #1e1e1e;
}

.code-tab {
    padding: 10px 15px;
    color: #abb2bf;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.code-tab:hover {
    background-color: var(--navy);
}

.code-tab.active {
    background-color: var(--navy);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.copy-button {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 500;
    background-color: rgba(77, 85, 102, 0.7); 
    color: #e6e6e6;
    border: 1px solid rgba(100, 100, 100, 0.3);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.copy-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(40, 167, 69, 0.5);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 20;
}

.copy-button:hover {
    background-color: rgba(90, 100, 119, 0.9);
    color: white;
}

.copy-button:active {
    background-color: rgba(61, 68, 84, 0.9);
    transform: scale(0.97);
}

.copy-button:focus {
    outline: none;
    box-shadow: 0 0 0 1px rgba(77, 85, 102, 0.5);
}

.copy-feedback.show {
    opacity: 1;
}

pre {
    margin: 0;
    padding: 15px;
    overflow-x: auto;
}

code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 14px;
}

/* API Info Cards */
.api-info {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.info-card {
    background-color: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 15px;
    min-width: 250px;
    flex: 1;
}

.info-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--navy);
}

.badge {
    display: inline-block;
    background-color: #e6f7ff;
    color: #1890ff;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    margin-right: 5px;
    margin-bottom: 5px;
}

/* Top Button */
#top-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--navy);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

#top-button.visible {
    opacity: 1;
}

/* Helper Classes */
.placeholder-content {
    padding: 20px;
    background-color: var(--surface-alt);
    border: 1px dashed #d0d7de;
    border-radius: 4px;
    color: #6e7781;
    text-align: center;
    margin-bottom: 20px;
}

/* Authentication Section Specific Styles */
.auth-steps, 
.auth-best-practices {
    background-color: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    max-width: 100%;
    box-sizing: border-box;
}

.auth-steps ol,
.auth-best-practices ul {
    padding-left: 20px;
    margin-left: 0;
    margin-bottom: 0;
}

.auth-steps li,
.auth-best-practices li {
    margin-bottom: 10px;
}

.auth-steps li:last-child,
.auth-best-practices li:last-child {
    margin-bottom: 0;
}

.auth-steps ul {
    padding-left: 20px;
    margin-top: 5px;
    margin-bottom: 5px;
}

/* General list fix for documentation */
section ul, 
section ol {
    padding-left: 20px;
}

/* Ensure content doesn't overflow container */
main {
    overflow-x: hidden;
}

/* Mobile responsiveness for lists */
@media (max-width: 768px) {
    .auth-steps ol,
    .auth-best-practices ul {
        padding-left: 15px;
    }
    
    .auth-steps ul {
        padding-left: 15px;
    }
}
    
/* Responsive Styles */
@media (max-width: 768px) {
    .container.flex {
        flex-direction: column;
    }
    
    nav {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--line);
    }
    
    .api-info {
        flex-direction: column;
    }
}

/* ---- Mobile hardening (60% of traffic is mobile) ---- */
img, svg { max-width: 100%; height: auto; }
pre, code { max-width: 100%; }
pre { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 768px) {
    /* Wide endpoint parameter tables scroll inside themselves instead of
       stretching the page */
    table, .params-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .container { padding: 0 14px; }
    header h1 { font-size: 22px; }
    h2 { font-size: 20px; }
    .code-block, pre { font-size: 12px; }
}

@media (max-width: 480px) {
    header { padding: 18px 0; }
    header h1 { font-size: 19px; }
    body { font-size: 15px; }
}
