/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    z-index: 1000;
    height: 70px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo i {
    font-size: 1.5rem;
    color: #3b82f6;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
}

.main-nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover {
    color: #3b82f6;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 70px;
    width: 280px;
    height: calc(100vh - 70px);
    background: #fff;
    border-right: 1px solid #e2e8f0;
    overflow-y: auto;
    z-index: 999;
}

.sidebar-content {
    padding: 2rem 0;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    padding: 0 1.5rem;
}

.sidebar-section ul {
    list-style: none;
}

.sidebar-section li {
    margin-bottom: 0.25rem;
}

.sidebar-section a {
    display: block;
    padding: 0.5rem 1.5rem;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.sidebar-section a:hover,
.sidebar-section a.active {
    background: #f3f4f6;
    color: #3b82f6;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    margin-left: 280px;
    margin-top: 70px;
    padding: 2rem;
    max-width: calc(100vw - 280px);
}

.section {
    margin-bottom: 3rem;
    background: #fff;
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin: 1.5rem 0 0.75rem 0;
}

.section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin: 1rem 0 0.5rem 0;
}

.section p {
    color: #6b7280;
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.feature-card i {
    font-size: 2rem;
    color: #3b82f6;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Info Box */
.info-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.info-box h3,
.info-box h4 {
    color: #1e40af;
    margin-bottom: 0.5rem;
}

.info-box code {
    background: #dbeafe;
    color: #1e40af;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
}

.info-box ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.info-box li {
    margin-bottom: 0.5rem;
    color: #1e40af;
}

/* Code Examples */
.code-example {
    background: #1f2937;
    border-radius: 0.5rem;
    overflow: hidden;
    margin: 1.5rem 0;
}

.code-tabs {
    display: flex;
    background: #374151;
    border-bottom: 1px solid #4b5563;
}

.tab-button {
    background: none;
    border: none;
    color: #9ca3af;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.tab-button:hover {
    background: #4b5563;
    color: #f3f4f6;
}

.tab-button.active {
    background: #1f2937;
    color: #f3f4f6;
    border-bottom: 2px solid #3b82f6;
}

.tab-content {
    display: none;
    padding: 1.5rem;
}

.tab-content.active {
    display: block;
}

.tab-content pre {
    margin: 0;
    color: #f3f4f6;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    overflow-x: auto;
}

.tab-content code {
    color: #f3f4f6;
}

/* Response Examples */
.response-example {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.response-example pre {
    background: #1f2937;
    color: #f3f4f6;
    padding: 1rem;
    border-radius: 0.25rem;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Rate Limits Table */
.rate-limits-table {
    overflow-x: auto;
    margin: 1.5rem 0;
}

.rate-limits-table table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.rate-limits-table th,
.rate-limits-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.rate-limits-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rate-limits-table td {
    color: #6b7280;
    font-size: 0.875rem;
}

.rate-limits-table tr:hover {
    background: #f9fafb;
}

/* Endpoints Grid */
.endpoints-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.endpoint-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.endpoint-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.method {
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.method.get {
    background: #dcfce7;
    color: #166534;
}

.method.post {
    background: #dbeafe;
    color: #1e40af;
}

.method.put {
    background: #fef3c7;
    color: #92400e;
}

.method.delete {
    background: #fee2e2;
    color: #991b1b;
}

.endpoint-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.endpoint-card p {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.endpoint-link {
    display: inline-flex;
    align-items: center;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.endpoint-link:hover {
    color: #1d4ed8;
}

/* Endpoint Info */
.endpoint-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.endpoint-info .endpoint-header {
    margin-bottom: 1rem;
}

.endpoint-info p {
    margin: 0.5rem 0;
    color: #6b7280;
}

/* Table Container */
.table-container {
    overflow-x: auto;
    margin: 1.5rem 0;
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table-container th,
.table-container td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
}

.table-container th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-container td {
    color: #6b7280;
}

.table-container tr:hover {
    background: #f9fafb;
}

/* Changelog */
.changelog-entry {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.changelog-entry h3 {
    color: #1f2937;
    margin-bottom: 1rem;
}

.changelog-entry ul {
    list-style: none;
    padding-left: 0;
}

.changelog-entry li {
    color: #6b7280;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.changelog-entry li::before {
    content: "•";
    color: #3b82f6;
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Request Tester */
.request-tester {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.request-tester h3 {
    margin-bottom: 1rem;
    color: #1f2937;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.btn {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn:hover {
    background: #1d4ed8;
}

.btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.response-preview {
    background: #1f2937;
    color: #f3f4f6;
    padding: 1rem;
    border-radius: 0.375rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-top: 1rem;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

/* Error Codes Table */
.error-codes-table {
    overflow-x: auto;
    margin: 1.5rem 0;
}

.error-codes-table table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.error-codes-table th,
.error-codes-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
}

.error-codes-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.error-codes-table td {
    color: #6b7280;
}

.error-codes-table .error-code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: 600;
    color: #dc2626;
}

.error-codes-table .http-status {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: 600;
    color: #059669;
}

.error-codes-table .category {
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.error-codes-table .category.auth {
    background: #fee2e2;
    color: #991b1b;
}

.error-codes-table .category.validation {
    background: #fef3c7;
    color: #92400e;
}

.error-codes-table .category.business {
    background: #dbeafe;
    color: #1e40af;
}

.error-codes-table .category.system {
    background: #f3e8ff;
    color: #7c3aed;
}

.error-codes-table .category.external {
    background: #ecfdf5;
    color: #065f46;
}

/* Search Controls */
.search-controls {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    margin: 1.5rem 0;
}

/* Best Practices Grid */
.practices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.practice-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
}

.practice-card i {
    font-size: 2rem;
    color: #3b82f6;
    margin-bottom: 1rem;
}

.practice-card h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
}

.practice-card ul {
    list-style: none;
    padding-left: 0;
    text-align: left;
}

.practice-card li {
    color: #6b7280;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.practice-card li::before {
    content: "✓";
    color: #059669;
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Error Examples */
.error-examples {
    margin: 1.5rem 0;
}

.error-examples h4 {
    color: #dc2626;
    margin: 1.5rem 0 0.5rem 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-left: 240px;
        max-width: calc(100vw - 240px);
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 1rem;
    }
    
    .header-content {
        padding: 0 1rem;
    }
    
    .main-nav {
        display: none;
    }
    
    .features-grid,
    .endpoints-grid,
    .practices-grid {
        grid-template-columns: 1fr;
    }
    
    .code-tabs {
        flex-wrap: wrap;
    }
    
    .tab-button {
        flex: 1;
        min-width: 80px;
    }
    
    .search-controls {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 1rem;
    }
    
    .header-content {
        padding: 0 0.5rem;
    }
    
    .logo h1 {
        font-size: 1.25rem;
    }
    
    .section h2 {
        font-size: 1.5rem;
    }
}

/* Loading States */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error States */
.success {
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin: 1rem 0;
}

.error {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin: 1rem 0;
}

/* Syntax Highlighting */
.hljs {
    background: #1f2937 !important;
    color: #f3f4f6 !important;
}

.hljs-keyword {
    color: #f472b6 !important;
}

.hljs-string {
    color: #a7f3d0 !important;
}

.hljs-number {
    color: #fbbf24 !important;
}

.hljs-comment {
    color: #6b7280 !important;
}

.hljs-function {
    color: #60a5fa !important;
}

.hljs-variable {
    color: #f3f4f6 !important;
} 