@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0a0b0e;
    color: #e5e7eb;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: #fbbf24;
    text-decoration: none;
}

a:hover {
    color: #f59e0b;
}

code,
pre {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #0a0b0e;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

button {
    cursor: pointer;
    font-family: inherit;
}

input {
    font-family: inherit;
}

.docs-layout {
    display: grid;
    grid-template-columns: 280px 1fr 420px;
    min-height: 100vh;
}

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: rgba(10, 11, 14, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-brand img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.topbar-brand h1 {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

.topbar-brand span {
    font-size: 11px;
    font-weight: 600;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(251, 191, 36, 0.2);
    margin-left: 4px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-link {
    font-size: 13px;
    font-weight: 600;
    color: #9ca3af;
    transition: color 0.15s;
}

.topbar-link:hover {
    color: #fff;
}

.sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 280px;
    background: #0e0f13;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    overflow-y: auto;
    padding: 16px 0;
    z-index: 50;
}

.sidebar-search {
    padding: 0 16px;
    margin-bottom: 16px;
}

.sidebar-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 8px 12px 8px 36px;
    font-size: 13px;
    color: #e5e7eb;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.sidebar-search input:focus {
    border-color: rgba(251, 191, 36, 0.4);
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-search-wrap {
    position: relative;
}

.sidebar-search-wrap svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    width: 14px;
    height: 14px;
    pointer-events: none;
}

.sidebar-group {
    margin-bottom: 4px;
}

.sidebar-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px 6px 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

.sidebar-group-title:hover {
    color: #9ca3af;
}

.sidebar-group-title svg {
    width: 12px;
    height: 12px;
    transition: transform 0.2s;
}

.sidebar-group.collapsed .sidebar-group-title svg {
    transform: rotate(-90deg);
}

.sidebar-group.collapsed .sidebar-group-items {
    display: none;
}

.sidebar-group-items {
    padding: 2px 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px 6px 28px;
    font-size: 13px;
    font-weight: 500;
    color: #9ca3af;
    transition: all 0.15s;
    border-left: 2px solid transparent;
}

.sidebar-link:hover {
    color: #e5e7eb;
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-link.active {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.06);
    border-left-color: #fbbf24;
}

.sidebar-method {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    padding: 1px 6px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    border-radius: 3px;
    flex-shrink: 0;
}

.content {
    margin-top: 56px;
    margin-left: 280px;
    padding: 40px 48px 120px;
    max-width: calc(100vw - 280px - 420px);
    min-height: 100vh;
}

.doc-section {
    margin-bottom: 64px;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.doc-section:last-child {
    border-bottom: none;
}

.section-header {
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.section-header p {
    font-size: 15px;
    color: #9ca3af;
    line-height: 1.7;
    max-width: 640px;
}

.endpoint-block {
    margin-bottom: 48px;
}

.endpoint-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.endpoint-path-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #12131a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 20px;
}

.endpoint-path-bar code {
    font-size: 14px;
    color: #e5e7eb;
    flex: 1;
}

.try-btn {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.try-btn:hover {
    opacity: 0.85;
}

.endpoint-desc {
    font-size: 14px;
    color: #9ca3af;
    line-height: 1.7;
    margin-bottom: 24px;
    max-width: 640px;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.auth-badge.key {
    background: rgba(251, 191, 36, 0.08);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.15);
}

.auth-badge.admin {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.auth-badge.owner {
    background: rgba(168, 85, 247, 0.08);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.15);
}

.auth-badge.public {
    background: rgba(34, 197, 94, 0.08);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.15);
}

.method {
    font-weight: 700;
    font-size: 13px;
    padding: 3px 10px;
    border-radius: 5px;
    letter-spacing: 0.03em;
}

.method-get {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
}

.method-post {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}

.method-put {
    background: rgba(168, 85, 247, 0.12);
    color: #a855f7;
}

.method-patch {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.method-delete {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.sidebar-method.get {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.sidebar-method.post {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.sidebar-method.put {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.sidebar-method.patch {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.sidebar-method.delete {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* ── Params Table ────────────────────────────────── */
.params-section {
    margin-bottom: 24px;
}

.params-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}

.params-subtitle {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.param-row {
    display: grid;
    grid-template-columns: 160px 80px 1fr auto;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    align-items: start;
}

.param-row:last-child {
    border-bottom: none;
}

.param-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    color: #fbbf24;
}

.param-type {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.param-desc {
    font-size: 13px;
    color: #9ca3af;
    line-height: 1.5;
}

.param-required {
    font-size: 10px;
    font-weight: 700;
    color: #ef4444;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.param-optional {
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.response-block {
    margin-top: 24px;
}

.response-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.success {
    background: #22c55e;
}

.status-dot.error {
    background: #ef4444;
}

.status-dot.warning {
    background: #f59e0b;
}

.code-panel {
    position: fixed;
    top: 56px;
    right: 0;
    bottom: 0;
    width: 420px;
    background: #0c0d11;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    overflow-y: auto;
    padding: 24px 20px;
    z-index: 50;
}

.code-block-card {
    background: #12131a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.code-block-title {
    font-size: 12px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.code-tabs {
    display: flex;
    gap: 2px;
}

.code-tab {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    transition: all 0.15s;
}

.code-tab:hover {
    color: #9ca3af;
}

.code-tab.active {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
}

.code-body {
    padding: 16px;
    overflow-x: auto;
}

.code-body pre {
    font-size: 12.5px;
    line-height: 1.6;
    white-space: pre;
    color: #d1d5db;
}

.code-copy-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #9ca3af;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Response preview */
.response-card {
    background: #12131a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 16px;
}

.response-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.response-card-title {
    font-size: 12px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.response-status-badge {
    font-size: 12px;
    font-weight: 600;
    color: #22c55e;
}

.response-body {
    padding: 16px;
    overflow-x: auto;
}

.response-body pre {
    font-size: 12.5px;
    line-height: 1.6;
    white-space: pre;
}

.syn-key {
    color: #7dd3fc;
}

.syn-str {
    color: #86efac;
}

.syn-num {
    color: #fbbf24;
}

.syn-bool {
    color: #c084fc;
}

.syn-null {
    color: #6b7280;
}

.syn-comment {
    color: #4b5563;
    font-style: italic;
}

.syn-cmd {
    color: #f472b6;
}

.key-panel {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.03), rgba(15, 16, 20, 0));
    border: 1px solid rgba(251, 191, 36, 0.12);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 48px;
}

.key-panel-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.key-panel-icon {
    width: 48px;
    height: 48px;
    background: rgba(251, 191, 36, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.key-panel-icon svg {
    color: #fbbf24;
    width: 24px;
    height: 24px;
}

.key-panel-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

.key-panel-subtitle {
    font-size: 14px;
    color: #9ca3af;
    margin-top: 2px;
}

.key-display {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    align-items: stretch;
}

.key-value {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 14px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: #22c55e;
    display: flex;
    align-items: center;
    word-break: break-all;
}

.key-actions {
    display: flex;
    gap: 8px;
}

.key-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.key-stat {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.key-stat-value {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.key-stat-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 4px;
}

.key-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    border: none;
    transition: all 0.2s;
}

.key-btn-primary {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
}

.key-btn-primary:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.key-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.key-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.key-btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.key-btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.key-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #9ca3af;
    transition: all 0.15s;
}

.key-btn-icon:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.auth-prompt {
    text-align: center;
    padding: 48px 32px;
}

.auth-prompt h3 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.auth-prompt p {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 24px;
}

.info-card {
    background: #12131a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.info-card h4 {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.info-card p {
    font-size: 13px;
    color: #9ca3af;
    line-height: 1.6;
}

.info-card code {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #fbbf24;
}

.content code:not(pre code) {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12.5px;
    color: #fbbf24;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 13px;
}

.doc-table th {
    text-align: left;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 700;
    color: #9ca3af;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.doc-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #d1d5db;
}

.doc-table td code {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #fbbf24;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #9ca3af;
    padding: 4px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 40;
}

@media (max-width: 1200px) {
    .docs-layout {
        grid-template-columns: 260px 1fr;
    }

    .code-panel {
        display: none;
    }

    .content {
        max-width: calc(100vw - 260px);
    }

    .sidebar {
        width: 260px;
    }

    .endpoint-code-inline {
        display: block !important;
    }
}

@media (max-width: 768px) {
    .docs-layout {
        grid-template-columns: 1fr;
    }

    .content {
        margin-left: 0;
        padding: 24px 16px 80px;
        max-width: 100vw;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    .mobile-menu-btn {
        display: block;
    }

    .topbar-link.hide-mobile {
        display: none;
    }

    .param-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .key-stats {
        grid-template-columns: 1fr;
    }

    .key-display {
        flex-direction: column;
    }

    .key-actions {
        flex-direction: row;
    }

    .section-header h2 {
        font-size: 22px;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0);
    }

    50% {
        box-shadow: 0 0 20px 2px rgba(251, 191, 36, 0.15);
    }
}

.animate-in {
    animation: fadeInUp 0.4s ease-out forwards;
    opacity: 0;
}

.pulse-glow {
    animation: pulse-glow 3s ease-in-out infinite;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(251, 191, 36, 0.2);
    border-top-color: #fbbf24;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.endpoint-code-inline {
    display: none;
    margin-top: 20px;
}

.endpoint-code-inline .code-block-card {
    margin-bottom: 12px;
}

.alert {
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.alert-info {
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.12);
    color: #93c5fd;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.12);
    color: #fcd34d;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.12);
    color: #fca5a5;
}

.alert svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 32px 0;
}