/* GitBook-inspired Documentation Styles */

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --border-hover: #d1d5db;
    --code-bg: #f9fafb;
    --code-border: #e5e7eb;
    --sidebar-width: 280px;
    --sidebar-bg: #fafbfc;
    --sidebar-border: #e1e4e8;
    --link-color: #0366d6;
    --link-hover: #0256c2;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --overlay-bg: rgba(0, 0, 0, 0.5);
}

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

html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    scroll-behavior: smooth;
}

.documentation-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    top: 0;
    left: 0;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--sidebar-border);
    background-color: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar-logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.sidebar-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.version-badge {
    display: inline-block;
    padding: 2px 8px;
    background-color: var(--bg-tertiary);
    color: var(--text-muted);
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.sidebar-nav {
    padding: 16px 0;
}

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

.nav-link {
    display: block;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    border-left-color: var(--primary-color);
}

.nav-link.active {
    color: var(--primary-color);
    background-color: var(--bg-secondary);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.nav-link.nav-endpoint {
    padding-left: 32px;
    font-size: 13px;
    font-weight: 400;
}

.nav-link.nav-endpoint:hover {
    background-color: var(--bg-tertiary);
}

.nav-group-title {
    padding: 12px 20px 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1001;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.sidebar-toggle:hover {
    background-color: var(--bg-secondary);
    box-shadow: var(--shadow-lg);
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

.sidebar-toggle span {
    width: 20px;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s ease;
    display: block;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--overlay-bg);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background-color: var(--bg-primary);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 48px 32px;
    width: 100%;
    box-sizing: border-box;
}

.doc-section {
    margin-bottom: 64px;
    scroll-margin-top: 24px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.doc-section h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    margin-top: 0;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.doc-section h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 40px;
    margin-bottom: 16px;
    padding-top: 8px;
}

.doc-section h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 28px;
    margin-bottom: 12px;
}

.doc-section h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 24px;
    margin-bottom: 10px;
}

.doc-section p {
    margin-bottom: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.doc-section ul,
.doc-section ol {
    margin-bottom: 20px;
    padding-left: 24px;
    color: var(--text-secondary);
}

.doc-section li {
    margin-bottom: 8px;
    line-height: 1.7;
    font-size: 15px;
}

.markdown-list {
    margin: 16px 0;
    padding-left: 24px;
}

.markdown-list li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.doc-section code {
    background-color: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 3px;
    padding: 2px 6px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    color: #d73a49;
}

.doc-section a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.doc-section a:hover {
    border-bottom-color: var(--link-color);
}

.doc-section strong {
    font-weight: 600;
    color: var(--text-primary);
}

/* Dynamic Content Containers */
#endpointsContent,
#gettingStartedContent {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Endpoint Card */
.endpoint-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 32px;
    transition: box-shadow 0.2s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
    overflow-x: hidden;
}

.endpoint-card:hover {
    box-shadow: var(--shadow-md);
}

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

.method-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.method-badge.get {
    background-color: #dbeafe;
    color: #1e40af;
}

.method-badge.post {
    background-color: #d1fae5;
    color: #065f46;
}

.method-badge.put {
    background-color: #fef3c7;
    color: #92400e;
}

.method-badge.delete {
    background-color: #fee2e2;
    color: #991b1b;
}

.endpoint-path {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
    overflow-wrap: break-word;
}

.endpoint-summary {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.endpoint-description {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.7;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Parameters Table */
.parameters-section {
    margin-bottom: 24px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.parameters-section h4 {
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
}

.parameters-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
}

.parameters-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    margin-bottom: 0;
    font-size: 14px;
}

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

.parameters-table th {
    background-color: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.parameters-table td {
    color: var(--text-secondary);
}

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

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

.param-type {
    color: var(--text-muted);
    font-size: 13px;
}

.param-required {
    display: inline-block;
    padding: 2px 6px;
    background-color: var(--error-color);
    color: white;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

/* Code Examples */
.code-examples-section {
    margin-top: 32px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.code-examples-section h4 {
    margin-bottom: 16px;
}

.code-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
}

.code-tab {
    padding: 10px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    font-family: inherit;
}

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

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

.code-block-wrapper {
    position: relative;
    margin-bottom: 24px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.code-block {
    background-color: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 6px;
    padding: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    position: relative;
    width: 100%;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

.code-block pre {
    margin: 0;
    white-space: pre;
    overflow-x: auto;
    word-break: normal;
    overflow-wrap: normal;
    -webkit-overflow-scrolling: touch;
}

.copy-button {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 8px 14px;
    min-height: 36px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.copy-button:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

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

/* Response Examples */
.response-section {
    margin-top: 24px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.response-section h4 {
    margin-bottom: 12px;
}

.response-example {
    background-color: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 6px;
    padding: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    position: relative;
    width: 100%;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

.response-example pre {
    margin: 0;
    white-space: pre;
    overflow-x: auto;
    word-break: normal;
    overflow-wrap: normal;
    -webkit-overflow-scrolling: touch;
}

/* Loading & Error States */
.loading-state,
.error-state {
    text-align: center;
    padding: 64px 32px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-state h2 {
    color: var(--error-color);
    margin-bottom: 12px;
}

.error-state p {
    color: var(--text-secondary);
}

/* Responsive Design */

/* Tablet and below (768px) */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }

    .sidebar.open {
        transform: translateX(0);
        z-index: 1000;
    }

    .sidebar-toggle {
        display: flex !important;
        visibility: visible;
        opacity: 1;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }

    .content-wrapper {
        padding: 24px 20px;
        max-width: 100%;
    }

    .doc-section {
        margin-bottom: 48px;
        scroll-margin-top: 80px;
    }

    .doc-section h1 {
        font-size: 28px;
        margin-bottom: 20px;
        padding-bottom: 12px;
    }

    .doc-section h2 {
        font-size: 22px;
        margin-top: 32px;
        margin-bottom: 14px;
    }

    .doc-section h3 {
        font-size: 18px;
        margin-top: 24px;
        margin-bottom: 10px;
    }

    .doc-section h4 {
        font-size: 16px;
        margin-top: 20px;
        margin-bottom: 8px;
    }

    .doc-section p {
        font-size: 15px;
        margin-bottom: 14px;
    }

    .endpoint-card {
        padding: 20px;
        margin-bottom: 24px;
    }

    .endpoint-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .endpoint-path {
        font-size: 14px;
        word-break: break-all;
    }

    .endpoint-summary {
        font-size: 16px;
    }

    .endpoint-description {
        font-size: 14px;
    }

    .code-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 12px;
        padding-bottom: 0;
    }

    .code-tab {
        padding: 10px 14px;
        font-size: 13px;
        min-height: 40px;
        white-space: nowrap;
    }

    .code-block {
        padding: 14px;
        font-size: 12px;
    }

    .code-block pre {
        font-size: 12px;
    }

    .copy-button {
        top: 10px;
        right: 10px;
        padding: 6px 12px;
        font-size: 11px;
    }

    .parameters-section h4 {
        font-size: 15px;
    }

    .parameters-table-wrapper {
        margin-left: -20px;
        margin-right: -20px;
        border-left: none;
        border-right: none;
        border-radius: 0;
    }

    .parameters-table {
        font-size: 13px;
    }

    .parameters-table th,
    .parameters-table td {
        padding: 10px 12px;
    }

    .sidebar-header {
        padding: 20px 16px;
    }

    .sidebar-title {
        font-size: 16px;
    }

    .nav-link {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .nav-link.nav-endpoint {
        padding-left: 28px;
        font-size: 13px;
    }

    .loading-state,
    .error-state {
        padding: 48px 24px;
    }
}

/* Small mobile (480px and below) */
@media (max-width: 480px) {
    .content-wrapper {
        padding: 20px 16px;
        max-width: 100%;
    }

    .doc-section {
        margin-bottom: 40px;
    }

    .doc-section h1 {
        font-size: 24px;
        margin-bottom: 16px;
        padding-bottom: 10px;
    }

    .doc-section h2 {
        font-size: 20px;
        margin-top: 28px;
        margin-bottom: 12px;
    }

    .doc-section h3 {
        font-size: 17px;
        margin-top: 20px;
        margin-bottom: 8px;
    }

    .doc-section h4 {
        font-size: 15px;
        margin-top: 18px;
        margin-bottom: 6px;
    }

    .doc-section p {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .doc-section ul,
    .doc-section ol {
        padding-left: 20px;
        margin-bottom: 16px;
    }

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

    .endpoint-card {
        padding: 16px;
        margin-bottom: 20px;
    }

    .endpoint-summary {
        font-size: 15px;
    }

    .endpoint-description {
        font-size: 13px;
        margin-bottom: 20px;
    }

    .method-badge {
        padding: 3px 10px;
        font-size: 11px;
    }

    .endpoint-path {
        font-size: 13px;
    }

    .code-tabs {
        gap: 6px;
        margin-bottom: 10px;
    }

    .code-tab {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 36px;
    }

    .code-block {
        padding: 12px;
        font-size: 11px;
    }

    .code-block pre {
        font-size: 11px;
    }

    .copy-button {
        top: 8px;
        right: 8px;
        padding: 5px 10px;
        font-size: 10px;
        min-height: 32px;
    }

    .parameters-table {
        font-size: 12px;
        min-width: 500px;
    }

    .parameters-table th,
    .parameters-table td {
        padding: 8px 10px;
    }

    .parameters-table th {
        font-size: 11px;
    }

    .param-name {
        font-size: 12px;
    }

    .param-type {
        font-size: 11px;
    }

    .param-required {
        font-size: 10px;
        padding: 1px 5px;
        margin-left: 6px;
    }

    .sidebar-toggle {
        top: 12px;
        right: 12px;
        left: auto;
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        padding: 8px;
        display: flex !important;
        visibility: visible;
        opacity: 1;
        z-index: 1001;
    }

    .sidebar-header {
        padding: 16px 14px;
    }

    .sidebar-logo {
        width: 28px;
        height: 28px;
    }

    .sidebar-title {
        font-size: 15px;
    }

    .version-badge {
        font-size: 10px;
        padding: 2px 6px;
    }

    .nav-link {
        padding: 10px 14px;
        font-size: 13px;
        min-height: 40px;
    }

    .nav-link.nav-endpoint {
        padding-left: 24px;
        font-size: 12px;
    }

    .nav-group-title {
        padding: 10px 14px 6px;
        font-size: 11px;
    }

    .loading-state,
    .error-state {
        padding: 40px 20px;
    }

    .spinner {
        width: 36px;
        height: 36px;
    }
}

/* Small desktop / Large tablet (1024px and below) */
@media (max-width: 1024px) and (min-width: 769px) {
    .content-wrapper {
        padding: 40px 28px;
    }

    .sidebar {
        width: 260px;
    }

    .main-content {
        margin-left: 260px;
    }

    .endpoint-card {
        padding: 22px;
    }
}

/* Syntax Highlighting (basic) */
.code-block .keyword {
    color: #d73a49;
}

.code-block .string {
    color: #032f62;
}

.code-block .number {
    color: #005cc5;
}

.code-block .comment {
    color: #6a737d;
    font-style: italic;
}

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

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

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

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

