/* Main Layout */
.main-content {
    margin-top: 72px;
    min-height: calc(100vh - 72px);
}

/* API Sidebar */
.sidebar {
    width: 300px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 10px 0;
    position: fixed;
    top: 72px;
    left: 0;
    height: calc(100vh - 72px);
    overflow-y: auto;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-nav {
    padding: 0;
}

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

.sidebar-section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    transition: color 0.2s ease;
}

.sidebar-section-title:hover {
    color: var(--primary);
}

.sidebar-section.expanded > .sidebar-section-title {
    color: var(--primary);
}

.sidebar-section-title::after {
    content: '+';
    font-size: 18px;
    font-weight: bold;
    transition: transform 0.3s ease;
    margin-left: 8px;
}

.sidebar-section.expanded .sidebar-section-title::after {
    transform: rotate(45deg);
}

.sidebar-section-links {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    opacity: 0;
}

.sidebar-section.expanded .sidebar-section-links {
    max-height: var(--ul-max-height, 2000px);
    margin-top: 8px;
    opacity: 1;
}

.sidebar-section > .sidebar-section-links > li {
    margin-bottom: 4px;
}

.sidebar-section > .sidebar-section-links > li > a {
    display: block;
    padding: 10px 20px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-section > .sidebar-section-links > li > a:hover {
    background: var(--card-hover-bg);
    color: var(--primary);
}

.sidebar-section > .sidebar-section-links > li > a.active {
    background: var(--card-hover-bg);
    color: var(--primary);
}

/* Content Area */
.content-area {
    margin-left: 300px;
    padding: 48px;
    /* max-width: 900px; */
    min-width: 0;
    overflow-x: hidden;
    transition: all 0.3s ease;
}

.api-header {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    scroll-margin-top: 88px;
}

.api-subsection {
    scroll-margin-top: 88px;
    margin-bottom: 48px;
}

.api-title {
    font-size: 34px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.2;
}

.api-meta {
    display: flex;
    gap: 16px;
    align-items: center;
}

.api-version {
    display: inline-block;
    padding: 4px 12px;
    background: var(--gradient-start);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    border-radius: 20px;
}

.api-date {
    color: var(--text-secondary);
    font-size: 14px;
}

/* API Content Styles */
.api-content h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 48px 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
    scroll-margin-top: 88px;
}

.api-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 36px 0 16px;
    scroll-margin-top: 88px;
}

.api-content h4 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 28px 0 12px;
}

.api-content p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 16px;
}

.api-content ul, .api-content ol {
    margin: 16px 0;
    padding-left: 24px;
    color: var(--text-secondary);
}

.api-content li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.api-content a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.api-content a:hover {
    text-decoration: underline;
}

.api-content blockquote {
    background: var(--surface);
    border-left: 4px solid var(--primary);
    padding: 16px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
}

.api-content blockquote p {
    margin-bottom: 0;
}

.api-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Method Badge */
.method-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 12px;
    vertical-align: middle;
}

.method-badge.get {
    background: rgba(16, 185, 129, 0.15);
    color: var(--method-get);
}

.method-badge.post {
    background: rgba(59, 130, 246, 0.15);
    color: var(--method-post);
}

.method-badge.put {
    background: rgba(245, 158, 11, 0.15);
    color: var(--method-put);
}

.method-badge.delete {
    background: rgba(239, 68, 68, 0.15);
    color: var(--method-delete);
}

/* API Section */
.api-section {
    scroll-margin-top: 88px;
}

/* Endpoint Block */
.endpoint-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
    transition: all 0.3s ease;
    scroll-margin-top: 88px;
}

.endpoint-block:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--card-hover-bg);
}

.endpoint-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    padding-top: 4px;
}

.endpoint-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.endpoint-path {
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
}

.endpoint-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

/* Parameter Table */
.param-table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.param-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.param-table th {
    background: var(--code-bg);
    color: var(--text-primary);
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

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

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

.param-table tr:hover td {
    background: var(--card-hover-bg);
}

.param-name {
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
}

.param-required {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    margin-left: 6px;
}

.param-type {
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    color: var(--text-tertiary);
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Nested Model */
.nested-model {
    margin-top: 16px;
    padding: 16px;
    background: var(--code-bg);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.nested-model-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border);
}

.nested-param-table {
    margin-top: 8px;
}

.param-table.nested {
    font-size: 13px;
}

.param-table.nested th {
    background: rgba(79, 70, 229, 0.1);
    font-weight: 600;
    font-size: 12px;
}

.param-table.nested td {
    padding: 8px 12px;
}

.param-table.nested .nested-name {
    color: var(--primary);
    font-weight: 500;
}

/* .param-table.nested tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.3);
} */

.param-table.nested tr:hover td {
    background: var(--card-hover-bg);
}

/* Code Block */
.code-block-wrapper {
    margin: 20px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--code-bg);
    border-bottom: 1px solid var(--border);
}

.code-block-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.code-block-copy {
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.code-block-copy:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.code-block-copy.copied {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

pre.code-block {
    margin: 0;
    padding: 16px;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.7;
    color: var(--code-text);
    background: var(--code-bg);
    overflow-x: auto;
    white-space: pre;
}

code.inline-code {
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    color: var(--primary);
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Response Example */
.response-example {
    margin: 20px 0;
}

.response-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.status-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--success);
}

.status-code {
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    color: var(--text-tertiary);
}

/* Nested Model */
.nested-model {
    margin: 20px 0;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.nested-model-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* Config Table */
.config-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.config-table th {
    background: var(--code-bg);
    color: var(--text-primary);
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.config-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

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

.config-table tr:hover td {
    background: var(--card-hover-bg);
}

/* TOC */
.toc-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
}

.toc-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.toc-list {
    list-style: none;
    padding: 0;
}

.toc-list li {
    margin-bottom: 8px;
}

.toc-list a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
    display: block;
    padding: 4px 0;
}

.toc-list a:hover {
    color: var(--primary);
}

.toc-list .toc-h2 {
    font-weight: 600;
    color: var(--text-primary);
}

.toc-list .toc-h3 {
    padding-left: 16px;
}

/* Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 250px;
        min-width: 250px;
    }
    .content-area {
        margin-left: 250px;
        padding: 32px;
        max-width: calc(100% - 250px);
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .content-area {
        margin-left: 0;
        padding: 24px;
        width: 100%;
        max-width: 100%;
    }
    .api-title {
        font-size: 28px;
    }
    .endpoint-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .content-area {
        padding: 16px;
    }
    .api-title {
        font-size: 24px;
    }
    .param-table-wrapper {
        font-size: 12px;
    }
    .param-table th,
    .param-table td {
        padding: 8px 10px;
    }
}
