/* OppLogix API Documentation Styles */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --text: #1e293b;
    --text-light: #64748b;
    --text-lighter: #94a3b8;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --bg-code: #1e293b;
    --border: #e2e8f0;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0284c7;
    --sidebar-width: 280px;
    --header-height: 64px;
    --get: #16a34a;
    --post: #2563eb;
    --put: #d97706;
    --delete: #dc2626;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 100;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 18px;
}

.header-brand svg {
    width: 32px;
    height: 32px;
}

.header-badge {
    font-size: 11px;
    font-weight: 600;
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 9999px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.header-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 24px;
}

.header-nav a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s;
}

.header-nav a:hover { color: var(--primary); }

.header-search {
    position: relative;
}

.header-search input {
    width: 240px;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-alt);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.header-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.header-search svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-lighter);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 24px 0;
    z-index: 50;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-heading {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-lighter);
    padding: 0 24px;
    margin-bottom: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 24px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    font-weight: 450;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    color: var(--text);
    background: var(--bg-alt);
}

.sidebar-link.active {
    color: var(--primary);
    background: var(--primary-light);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-link .method-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Main content */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 48px 64px;
    max-width: 960px;
}

/* Typography */
h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

h2 {
    font-size: 24px;
    font-weight: 700;
    margin-top: 48px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    letter-spacing: -0.3px;
}

h3 {
    font-size: 18px;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 12px;
}

h4 {
    font-size: 15px;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 8px;
}

p {
    margin-bottom: 16px;
    color: var(--text);
}

.subtitle {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 32px;
    line-height: 1.5;
}

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

/* Endpoint blocks */
.endpoint {
    margin: 32px 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg);
}

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
}

.endpoint-header:hover {
    background: #f1f5f9;
}

.method-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff;
    flex-shrink: 0;
}

.method-badge.get { background: var(--get); }
.method-badge.post { background: var(--post); }
.method-badge.put { background: var(--put); }
.method-badge.delete { background: var(--delete); }

.endpoint-path {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.endpoint-desc {
    margin-left: auto;
    font-size: 13px;
    color: var(--text-light);
    text-align: right;
}

.endpoint-chevron {
    color: var(--text-lighter);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.endpoint.open .endpoint-chevron {
    transform: rotate(90deg);
}

.endpoint-body {
    display: none;
    padding: 24px;
}

.endpoint.open .endpoint-body {
    display: block;
}

/* Auth badge */
.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 9999px;
    margin-bottom: 16px;
}

.auth-badge.required {
    background: #fef3c7;
    color: #92400e;
}

.auth-badge.admin {
    background: #fee2e2;
    color: #991b1b;
}

.auth-badge.public {
    background: #dcfce7;
    color: #166534;
}

.auth-badge.api-key {
    background: #e0e7ff;
    color: #3730a3;
}

/* Parameter tables */
.param-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.param-table th {
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-lighter);
    padding: 8px 12px;
    border-bottom: 2px solid var(--border);
}

.param-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.param-table tr:last-child td {
    border-bottom: none;
}

.param-name {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.param-type {
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
}

.param-required {
    font-size: 11px;
    color: var(--danger);
    font-weight: 600;
    text-transform: uppercase;
}

.param-optional {
    font-size: 11px;
    color: var(--text-lighter);
    font-weight: 500;
}

/* Code blocks */
pre {
    background: var(--bg-code);
    color: #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13px;
    line-height: 1.6;
    margin: 16px 0;
}

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

p code, td code, li code {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #be185d;
}

/* JSON syntax highlighting */
.json-key { color: #7dd3fc; }
.json-string { color: #86efac; }
.json-number { color: #fca5a5; }
.json-boolean { color: #c4b5fd; }
.json-null { color: #94a3b8; }

/* Alert/callout boxes */
.callout {
    padding: 16px 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 14px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.callout-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.callout-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.callout-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.callout-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.callout-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

/* Cards (for landing page) */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: border-color 0.15s, box-shadow 0.15s;
    text-decoration: none;
    color: var(--text);
    display: block;
}

.card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
    text-decoration: none;
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 20px;
}

.card h3 {
    margin: 0 0 8px;
    font-size: 16px;
}

.card p {
    font-size: 14px;
    color: var(--text-light);
    margin: 0;
}

/* Status codes table */
.status-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.status-table th {
    text-align: left;
    padding: 10px 16px;
    background: var(--bg-alt);
    border-bottom: 2px solid var(--border);
    font-size: 13px;
    font-weight: 600;
}

.status-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.status-code {
    font-family: monospace;
    font-weight: 700;
    font-size: 14px;
}

.status-code.s2xx { color: var(--success); }
.status-code.s4xx { color: var(--warning); }
.status-code.s5xx { color: var(--danger); }

/* Tabs for code samples */
.code-tabs {
    margin: 16px 0;
}

.code-tab-buttons {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
}

.code-tab-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
}

.code-tab-btn:hover { color: var(--text); }

.code-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.code-tab-content {
    display: none;
}

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

/* Table of contents (right side) */
.toc {
    position: fixed;
    top: calc(var(--header-height) + 48px);
    right: 24px;
    width: 220px;
    font-size: 13px;
    max-height: calc(100vh - var(--header-height) - 96px);
    overflow-y: auto;
}

.toc-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-lighter);
    margin-bottom: 12px;
}

.toc a {
    display: block;
    padding: 4px 0;
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.15s;
}

.toc a:hover { color: var(--primary); }
.toc a.active { color: var(--primary); font-weight: 600; }

/* Enum/value lists */
.enum-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0;
}

.enum-value {
    font-family: monospace;
    font-size: 12px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--text);
}

/* Footer */
.site-footer {
    margin-left: var(--sidebar-width);
    padding: 32px 64px;
    border-top: 1px solid var(--border);
    color: var(--text-light);
    font-size: 13px;
}

/* Quick reference (landing page) */
.base-url-box {
    background: var(--bg-code);
    color: #e2e8f0;
    padding: 16px 20px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 15px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.base-url-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-lighter);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1280px) {
    .toc { display: none; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 32px 20px;
    }

    .site-footer {
        margin-left: 0;
        padding: 24px 20px;
    }

    .menu-toggle { display: block; }

    .header-search { display: none; }

    .endpoint-desc { display: none; }
}

/* Scrollbar styling */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }

/* Copy button */
.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    color: var(--text-lighter);
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
}

pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: rgba(255, 255, 255, 0.2); }

/* Pre wrapper */
.pre-wrapper {
    position: relative;
}

/* List styling */
ul, ol {
    margin: 12px 0;
    padding-left: 24px;
}

li {
    margin-bottom: 6px;
    font-size: 14px;
}

/* Horizontal rule */
hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 32px 0;
}

/* Inline method labels */
.method-inline {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
    vertical-align: middle;
    margin-right: 4px;
}

.method-inline.get { background: var(--get); }
.method-inline.post { background: var(--post); }
.method-inline.put { background: var(--put); }
.method-inline.delete { background: var(--delete); }
