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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #fafafa;
    color: #3b4151;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 300px;
    min-width: 300px;
    background: #1b1b1b;
    color: #fff;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #333;
    overflow: hidden;
}

.sidebar-header {
    padding: 20px 16px 12px;
    border-bottom: 1px solid #333;
}

.brand-home {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0 0 16px;
    cursor: pointer;
}

.brand-home:focus-visible {
    outline: 2px solid #89bf04;
    outline-offset: 4px;
}

.brand-logo {
    display: block;
    width: 190px;
    max-width: 100%;
    max-height: 62px;
    object-fit: contain;
    object-position: left center;
}

.search-box {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #444;
    border-radius: 4px;
    background: #2d2d2d;
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.sort-label {
    display: block;
    margin: 10px 0 5px;
    color: #b8c0c8;
    font-size: 11px;
}

.sort-select {
    width: 100%;
    border: 1px solid #3b444d;
    border-radius: 4px;
    background: #2a3138;
    color: #e9eef3;
    padding: 7px 8px;
}

.search-box:focus {
    border-color: #89bf04;
}

.search-box::placeholder {
    color: #888;
}

.endpoint-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.endpoint-item {
    cursor: pointer;
    padding: 8px 16px;
    font-size: 13px;
    color: #ccc;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.endpoint-item:hover {
    background: #2a2a2a;
    color: #fff;
}

.endpoint-item.active {
    background: #333;
    color: #89bf04;
    border-left: 3px solid #89bf04;
    padding-left: 13px;
}

.endpoint-item .order-badge {
    font-size: 10px;
    background: #444;
    color: #aaa;
    padding: 1px 5px;
    border-radius: 3px;
    min-width: 16px;
    text-align: center;
}

.endpoint-item.active .order-badge {
    background: #89bf04;
    color: #1b1b1b;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.welcome {
    padding: 42px 40px;
    max-width: none;
}

.welcome h2 {
    font-size: 24px;
    margin-bottom: 16px;
    color: #3b4151;
}

.welcome p {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 12px;
}

.welcome h3 {
    margin-top: 24px;
    margin-bottom: 8px;
    font-size: 16px;
    color: #3b4151;
}

.welcome code {
    background: #e8e8e8;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
}

.welcome-code {
    max-height: none;
    margin-bottom: 16px;
}

/* ===== ENDPOINT DETAIL ===== */
.endpoint-detail {
    padding: 30px 40px;
    max-width: none;
}

.endpoint-detail h2 {
    font-size: 22px;
    margin-bottom: 6px;
    color: #3b4151;
}

.endpoint-meta {
    font-size: 13px;
    color: #888;
    margin-bottom: 20px;
    line-height: 1.5;
}

.endpoint-meta .badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 6px;
}

.endpoint-meta .badge-order {
    background: #e8f5e9;
    color: #2e7d32;
}

.endpoint-description {
    font-size: 14px;
    color: #555;
    margin-bottom: 16px;
    line-height: 1.5;
}

.dependency-block {
    border: 1px solid #cfd6df;
    border-radius: 6px;
    margin-bottom: 16px;
    overflow: hidden;
    background: #fff;
}

.dependency-header {
    width: 100%;
    border: 0;
    background: #f7fafc;
    color: #3b4151;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.dependency-header .dependency-summary {
    color: #697586;
    font-size: 12px;
    font-weight: 400;
    flex: 1;
}

.dependency-header .expand-icon {
    transition: transform 0.2s;
}

.dependency-block.expanded .dependency-header .expand-icon {
    transform: rotate(180deg);
}

.dependency-body {
    display: none;
    padding: 12px 14px;
    color: #555;
    font-size: 13px;
    line-height: 1.5;
    border-top: 1px solid #d8e0e8;
}

.dependency-block.expanded .dependency-body {
    display: block;
}

.dependency-list {
    white-space: pre-line;
}

.dependency-tree {
    margin: 0;
    padding-left: 22px;
    list-style: none;
}

.dependency-tree li {
    position: relative;
    padding: 3px 0 3px 16px;
}

.dependency-tree li::before {
    content: '\2514\2500';
    position: absolute;
    left: 0;
    color: #8a96a3;
}

.dependency-tree .dependency-tree {
    margin-top: 2px;
}

.dependency-name {
    font-weight: 600;
    color: #3b4151;
}

.dependency-status {
    color: #111;
    font-size: 11px;
    margin-left: 5px;
}

.dependency-status.required {
    color: #e00000;
}

/* ===== METHOD BLOCKS ===== */
.method-block {
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.method-block:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.method-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    gap: 12px;
    user-select: none;
}

.method-header .method-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 3px;
    min-width: 60px;
    text-align: center;
    text-transform: uppercase;
}

.method-badge.get { background: #61affe; color: #fff; }
.method-badge.post { background: #49cc90; color: #fff; }
.method-badge.put { background: #fca130; color: #fff; }
.method-badge.delete { background: #f93e3e; color: #fff; }

.method-block.get { border-color: #61affe; }
.method-block.post { border-color: #49cc90; }
.method-block.put { border-color: #fca130; }
.method-block.delete { border-color: #f93e3e; }

.method-header.get { background: #ebf3fb; }
.method-header.post { background: #e8f6f0; }
.method-header.put { background: #fef5e7; }
.method-header.delete { background: #fce8e8; }

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

.method-header .method-summary {
    font-size: 13px;
    color: #888;
    margin-left: auto;
}

.method-header .expand-icon {
    font-size: 12px;
    color: #888;
    transition: transform 0.2s;
}

.method-block.expanded > .method-header .expand-icon {
    transform: rotate(180deg);
}

.method-body {
    display: none;
    padding: 16px 20px;
    border-top: 1px solid #eee;
    background: #fff;
}

.method-description {
    margin-bottom: 16px;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.method-block.expanded .method-body {
    display: block;
}

/* ===== PARAMS TABLE ===== */
.params-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: #3b4151;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

.section-header {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #eee;
    background: #fafafa;
    color: #3b4151;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
}

.section-header .expand-icon {
    font-size: 12px;
    color: #888;
    transition: transform 0.2s;
}

.toggle-section .section-body {
    display: none;
}

.toggle-section.expanded .section-body {
    display: block;
}

.toggle-section.expanded > .section-header .expand-icon {
    transform: rotate(180deg);
}

.params-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    font-size: 13px;
    margin-bottom: 16px;
}

.params-table th {
    text-align: left;
    padding: 8px 10px;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    color: #555;
    font-size: 12px;
}

.params-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #f5f5f5;
    vertical-align: top;
}

.params-table .param-name {
    font-family: monospace;
    font-weight: 600;
    color: #3b4151;
}

.params-table .param-type {
    color: #888;
    font-size: 12px;
}

.params-table .param-format {
    color: #666;
    font-size: 12px;
    white-space: normal;
}

.params-table .param-required {
    color: #f93e3e;
    font-size: 11px;
    font-weight: 600;
}

.params-table .param-conditional {
    color: #f93e3e;
    display: block;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2px;
    white-space: normal;
}

.params-table .param-desc {
    color: #666;
    line-height: 1.45;
}

.model-table th:first-child,
.model-table td:first-child,
.params-table:not(.model-table):not(.order-table) th:first-child,
.params-table:not(.model-table):not(.order-table) td:first-child {
    width: 28px;
    min-width: 28px;
    max-width: 36px;
    padding-left: 0;
    padding-right: 4px;
    white-space: nowrap;
}

.model-table td:nth-child(2) {
    width: auto;
    position: relative;
}

.model-table th:nth-child(3),
.model-table td:nth-child(3),
.params-table:not(.model-table):not(.order-table) th:nth-child(3),
.params-table:not(.model-table):not(.order-table) td:nth-child(3) {
    width: 90px;
}

.model-table th:nth-child(4),
.model-table td:nth-child(4),
.params-table:not(.model-table):not(.order-table) th:nth-child(4),
.params-table:not(.model-table):not(.order-table) td:nth-child(4) {
    width: 135px;
}

.model-table th:nth-child(5),
.model-table td:nth-child(5),
.params-table:not(.model-table):not(.order-table) th:nth-child(5),
.params-table:not(.model-table):not(.order-table) td:nth-child(5) {
    width: 48%;
    min-width: 420px;
}

.params-table .param-desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    max-height: calc(1.45em * 3);
}

.model-table .depth-0,
.model-table .depth-1,
.model-table .depth-2,
.model-table .depth-3,
.model-table .depth-4,
.model-table .depth-5,
.model-table .depth-6 {
    padding-left: 34px;
}

.schema-child-hidden {
    display: none;
}

.schema-toggle {
    width: 20px;
    height: 20px;
    border: 0;
    background: transparent;
    color: #666;
    cursor: pointer;
    left: 8px;
    margin-right: 0;
    position: absolute;
    top: 5px;
    vertical-align: middle;
    z-index: 1;
}

.schema-toggle .expand-icon {
    display: inline-block;
    font-size: 10px;
    transition: transform 0.2s;
}

.schema-row.schema-expanded > td .schema-toggle .expand-icon {
    transform: rotate(180deg);
}

.schema-toggle-spacer {
    display: none;
}

.order-table {
    max-width: 100%;
}

.order-table th:nth-child(2) {
    width: 68%;
}

.muted {
    color: #888;
    white-space: nowrap;
}

/* ===== RESPONSE EXAMPLE ===== */
.response-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: #3b4151;
    margin-bottom: 10px;
}

.response-code {
    background: #272822;
    color: #f8f8f2;
    padding: 14px 16px;
    border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    overflow-x: auto;
    line-height: 1.5;
    max-height: 400px;
    overflow-y: auto;
}

.response-description {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    margin-bottom: 12px;
}

/* ===== SCROLLBAR ===== */
.endpoint-list::-webkit-scrollbar,
.main-content::-webkit-scrollbar,
.response-code::-webkit-scrollbar {
    width: 6px;
}

.endpoint-list::-webkit-scrollbar-track,
.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.endpoint-list::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.main-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}
