/* Ultimate API Documentation Styles */
:root {
    --primary-color: #2e7d32;
    --secondary-color: #1976d2;
    --success-color: #4caf50;
    --error-color: #f44336;
    --warning-color: #ff9800;
    --info-color: #2196f3;
    --bg-color: #fafafa;
    --sidebar-bg: #ffffff;
    --border-color: #e0e0e0;
    --text-primary: #212121;
    --text-secondary: #757575;
    --code-bg: #f5f5f5;
    --method-width: 60px;
}

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

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

.app-container { display: flex; min-height: 100vh; }

.endpoint-summary {
    margin-top: 30px;
    font-size: 24px;
}

.endpoint-summary a {
    text-decoration: none;
}

.endpoint-description {
    margin-bottom: 25px;
    font-size: 16px;
}

.expand-icon {
    display: inline-block;
    width: 12px;
    cursor: pointer;
    transition: transform 0.2s;
    user-select: none;
    margin-right: 5px;
}

.expand-icon.expanded {
    transform: rotate(90deg);
}

.sidebar {
    width: 360px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 8px rgba(0,0,0,0.05);
}

.sidebar-header {
    color: black;
    margin-top: 70px;
    text-align: center;
}

.logo-container { margin-bottom: 15px }
.logo { position: absolute; top: -30px; left: -40px }

.sidebar-header h1 { font-size: 20px; font-weight: 600; margin: 0; position: relative }
.sidebar-header a { color: black; text-decoration: none; }

.search-container { padding: 15px; border-bottom: 1px solid var(--border-color); position: relative; }

.search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 15px;
    right: 15px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.search-results.active { display: block; }

.search-result {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.search-result:hover { background: #f8f9fa; }

.nav-groups { padding: 10px 0; }
.nav-group { margin-bottom: 5px; }

.nav-group-title {
    padding: 10px 20px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-group-title:hover { background: #f5f5f5; }
.nav-group.active .nav-group-title { background: #f0f0f0; }

.nav-group-toggle {
    transition: transform 0.2s;
}

.nav-group.active .nav-group-toggle {
    transform: rotate(90deg);
}

.nav-group-items { display: none; }
.nav-group.active .nav-group-items { display: block; }

.nav-subitem {
    padding: 6px 20px 6px 35px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    display: block;
}

.nav-subitem:hover {
    background: #f8f9fa;
    color: var(--text-primary);
}

.nav-file { margin-bottom: 5px; }

.nav-file-title {
    display: flex;
    align-items: center;
    padding: 8px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.nav-file-title:hover { background: #f8f9fa; }

.nav-file-toggle {
    margin-left: auto;
    transition: transform 0.2s;
}

.nav-file.active .nav-file-toggle {
    transform: rotate(90deg);
}

.nav-file-endpoints { display: none; }
.nav-file.active .nav-file-endpoints { display: block; }

.nav-endpoint {
    display: flex;
    align-items: flex-start;
    padding: 8px 20px 8px 40px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
}

.nav-endpoint:hover {
    background: #f8f9fa;
    color: var(--text-primary);
}

.nav-method {
    display: inline-block;
    min-width: var(--method-width);
    padding: 3px 0;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    margin-right: 10px;
    flex-shrink: 0;
}

.nav-endpoint-text {
    flex: 1;
    white-space: normal;
    word-wrap: break-word;
}

.method-get { background: #61affe; color: white; }
.method-post { background: #49cc90; color: white; }
.method-put { background: #fca130; color: white; }
.method-delete { background: #f93e3e; color: white; }
.method-patch { background: #50e3c2; color: white; }
.method-head { background: #9012fe; color: white; }
.method-options { background: #0d5aa7; color: white; }

.main-content {
    flex: 1;
    margin-left: 360px;
    padding: 40px 60px;
    max-width: 1400px;
}

.endpoint-section {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 40px;
}

.endpoint-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    margin-top: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.endpoint-method {
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    margin-right: 12px;
}

.endpoint-path {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 16px;
    flex: 1;
}

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

.params-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border: 1px solid var(--border-color);
    font-size: 13px;
}

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

.no-margin {
    padding: 0;
}

.params-table .param-name {
    font-family: 'SF Mono', Monaco, monospace;
    font-weight: 600;
    color: var(--text-primary);
}

.param-required {
    color: #c73e3a;
}

.enum-value {
    display: inline-block;
    background: #a6d0fb;
    margin-right: 5px;
    margin-bottom: 2px;
    border-radius: 5px;
    padding: 2px 5px;
}

.params-table .param-type {
    font-family: 'SF Mono', Monaco, monospace;
    color: var(--secondary-color);
    font-size: 13px;
}

.params-table .required-badge {
    background: #ffebee;
    color: #c62828;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

/* Вложенные структуры */
.nested-structure {
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.structure-toggle {
    cursor: pointer;
    font-weight: 600;
    color: var(--secondary-color);
    padding: 5px 0;
    list-style: none;
}

.structure-toggle::-webkit-details-marker {
    display: none;
}

.structure-toggle::before {
    content: '▶';
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.2s;
}

details[open] .structure-toggle::before {
    transform: rotate(90deg);
}

.nested-params-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: white;
}

.nested-params-table th {
    background: #e9ecef;
    padding: 8px;
    text-align: left;
    font-weight: 600;
    border: 1px solid #dee2e6;
    font-size: 12px;
}

.nested-params-table td {
    padding: 8px;
    border: 1px solid #dee2e6;
    font-size: 13px;
}

.nested-row {
    background: #f8f9fa;
    border-top: none !important;
}

.nested-row td {
    border-top: none !important;
}

.nested-structure {
    border: none;
    background: transparent;
}

.nested-structure[open] {
    padding-bottom: 10px;
}

.structure-toggle {
    cursor: pointer;
    font-weight: 600;
    color: var(--secondary-color);
    list-style: none;
    background: #f8f9fa;
}

.structure-toggle:hover {
    background: #e9ecef;
}

.nested-params-table {
    background: white;
    border: 1px solid #dee2e6;
}

.array-type-label {
    color: var(--secondary-color);
    font-size: 12px;
    margin-top: 2px;
}

.array-type-info {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

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

.property-table {
    width: 100%;
    border-collapse: collapse;
}

.property-table th {
    text-align: left;
    padding: 10px;
    background: #f8f9fa;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
}

.property-table td {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.property-name {
    font-family: 'SF Mono', Monaco, monospace;
    font-weight: 600;
    color: var(--text-primary);
}

.property-type {
    font-family: 'SF Mono', Monaco, monospace;
    color: var(--secondary-color);
    font-size: 13px;
}

.required-badge {
    background: #ffebee;
    color: #c62828;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.schema-type-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #e3f2fd;
    color: #1565c0;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

.array-structure {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.array-type-label {
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 10px;
}

.nested-properties {
    margin-left: 20px;
    padding-left: 15px;
    border-left: 2px solid #e0e0e0;
    margin-top: 10px;
}

.show-more-btn {
    display: inline-block;
    margin: 10px 0;
    padding: 6px 12px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.show-more-btn:hover { background: #1565c0; }

.hidden-properties { display: none; }
.hidden-properties.expanded { display: block; }

.code-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.code-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

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

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

.code-example {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre;
}

.response-section {
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

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

.response-header:hover { background: #f8f9fa; }

.response-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    margin-right: 12px;
}

.status-success { background: #e8f5e9; color: #2e7d32; }
.status-client-error { background: #ffebee; color: #c62828; }
.status-server-error { background: #fce4ec; color: #ad1457; }

.response-body {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: none;
}

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

/* Expandable schemas */
.expandable-schema {
    color: var(--secondary-color);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.expandable-schema:hover {
    text-decoration-style: solid;
}

.expand-icon {
    font-size: 10px;
    transition: transform 0.2s;
}

.expandable-schema.expanded .expand-icon {
    transform: rotate(90deg);
}

.schema-details {
    display: none;
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-left: 3px solid var(--secondary-color);
    border-radius: 4px;
}

.schema-details.visible {
    display: block;
}

.schema-reference {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 12px;
}

.preview-properties {
    display: inline-block;
    margin-left: 8px;
    color: var(--text-secondary);
    font-size: 12px;
}

.property-expandable {
    position: relative;
}

.property-expandable::after {
    content: '...';
    color: var(--secondary-color);
    margin-left: 4px;
}

/* Markdown content styles */
.content-list {
    margin: 16px 0;
    padding-left: 24px;
}

.content-list-item {
    margin: 8px 0;
    line-height: 1.6;
}

.content-list ul,
.content-list ol {
    margin-top: 8px;
    margin-bottom: 8px;
}

.content-paragraph {
    margin: 16px 0;
    line-height: 1.6;
}

.content-heading {
    margin-top: 32px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.content-h1 { font-size: 28px; }
.content-h2 { font-size: 24px; }
.content-h3 { font-size: 20px; }
.content-h4 { font-size: 18px; }

.code-block {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 16px 0;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 14px;
    line-height: 1.5;
}

.inline-code {
    background: #f5f5f5;
    color: #d73a49;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 85%;
}

.content-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.content-table th,
.content-table td {
    padding: 12px;
    text-align: left;
    border: 1px solid var(--border-color);
}

.content-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.content-table tr:nth-child(even) {
    background: #fafafa;
}

.table-wrapper {
    overflow-x: auto;
    margin: 16px 0;
}

blockquote {
    margin: 16px 0;
    padding: 0 16px;
    border-left: 4px solid var(--secondary-color);
    color: var(--text-secondary);
}

hr {
    margin: 32px 0;
    border: none;
    border-top: 1px solid var(--border-color);
}