/* Documentation Specific Styles */

/* Override body overflow for docs page */
body.docs-page {
    overflow-x: visible;
}

/* Layout */
.docs-layout {
    display: grid;
    grid-template-columns: 280px 1fr 200px;
    gap: 0;
    min-height: calc(100vh - 70px);
    margin-top: 70px;
}

/* Sidebar */
.docs-sidebar {
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    padding: 32px 0;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
}

/* Custom scrollbar for docs sidebar */
.docs-sidebar {
    scrollbar-color: #d1d5db #f8fafc;
    scrollbar-width: thin;
}

.docs-sidebar::-webkit-scrollbar {
    width: 8px;
}

.docs-sidebar::-webkit-scrollbar-track {
    background: #f8fafc;
}

.docs-sidebar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.docs-sidebar::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.docs-search {
    padding: 0 24px 24px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

/* Navigation */
.docs-nav {
    padding: 0 24px;
}

.docs-nav-section {
    margin-bottom: 32px;
}

.docs-nav-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.docs-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.docs-nav-list li {
    margin-bottom: 4px;
}

.docs-nav-link {
    display: block;
    padding: 8px 12px;
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.docs-nav-link:hover {
    background: white;
    color: #f97316;
}

.docs-nav-link.active {
    background: #fed7aa;
    color: #ea580c;
    font-weight: 500;
}

/* Main Content */
.docs-content {
    padding: 32px 48px;
    max-width: none;
    overflow-x: auto;
}

.docs-article {
    max-width: 800px;
}

/* Typography */
.docs-heading {
    color: #111827;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
}

.docs-article h1 {
    font-size: 2.5rem;
    margin-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 16px;
}

.docs-article h2 {
    font-size: 1.875rem;
    margin: 48px 0 24px 0;
    color: #1f2937;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 8px;
}

.docs-article h3 {
    font-size: 1.5rem;
    margin: 32px 0 16px 0;
    color: #374151;
}

.docs-article h4 {
    font-size: 1.25rem;
    margin: 24px 0 12px 0;
    color: #4b5563;
}

.docs-lead {
    font-size: 1.25rem;
    color: #6b7280;
    line-height: 1.7;
    margin-bottom: 32px;
}

.docs-section {
    margin-bottom: 48px;
}

.docs-section:first-child {
    margin-top: 0;
}

/* Lists */
.docs-list {
    margin: 16px 0;
    padding-left: 24px;
}

.docs-list li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.docs-list li strong {
    color: #374151;
}

/* Code Blocks */
.code-block {
    background: #1e293b;
    border-radius: 12px;
    overflow: hidden;
    margin: 24px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.code-header {
    background: #334155;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #475569;
}

.code-title {
    font-size: 14px;
    font-weight: 500;
    color: #e2e8f0;
    font-family: 'JetBrains Mono', 'Monaco', monospace;
}

.code-copy {
    background: #f97316;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.code-copy:hover {
    background: #ea580c;
}

.code-block pre {
    margin: 0;
    padding: 20px;
    font-family: 'JetBrains Mono', 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #e2e8f0;
    overflow-x: auto;
}

/* Prevent auto-linking in code blocks */
.code-block a,
.code-block pre a,
code a {
    color: inherit !important;
    text-decoration: none !important;
    pointer-events: none !important;
}

.code-block code {
    background: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
}

/* Inline code */
code {
    background: #f1f5f9;
    color: #e11d48;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', 'Monaco', monospace;
    font-size: 0.875em;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin: 24px 0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.docs-table th {
    background: #f8fafc;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.docs-table td {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
}

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

.docs-table tbody tr:hover {
    background: #f9fafb;
}

/* Callouts */
.docs-callout {
    padding: 20px;
    border-radius: 12px;
    margin: 24px 0;
    border-left: 4px solid;
}

.docs-callout-info {
    background: #f8fafc;
    border-color: #64748b;
    color: #475569;
}

.docs-callout-info a {
    color: #475569 !important;
    text-decoration: underline;
}

.docs-callout-info a:hover {
    color: #334155 !important;
}

.docs-callout-info ul {
    margin: 12px 0 0 0;
    padding-left: 20px;
}

.docs-callout-info li {
    margin-bottom: 4px;
}

.docs-callout-warning {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.docs-callout-success {
    background: #ecfdf5;
    border-color: #10b981;
    color: #065f46;
}

.docs-callout-danger {
    background: #fef2f2;
    border-color: #ef4444;
    color: #b91c1c;
}

/* Plan Badge */
.docs-plan-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* API Endpoints */
.api-endpoint {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
}

.http-method {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    min-width: 60px;
    text-align: center;
}

.http-method.get {
    background: #fed7aa;
    color: #ea580c;
}

.http-method.post {
    background: #dcfce7;
    color: #166534;
}

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

.http-method.delete {
    background: #fecaca;
    color: #b91c1c;
}

.endpoint-url {
    font-size: 14px;
    color: #374151;
}

/* Troubleshooting */
.docs-troubleshoot-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.docs-troubleshoot-item h4 {
    margin: 0 0 12px 0;
    color: #1f2937;
}

.docs-troubleshoot-item p {
    margin: 8px 0;
}

.docs-troubleshoot-item strong {
    color: #374151;
}

/* Table of Contents */
.docs-toc {
    padding: 32px 0;
    position: sticky;
    top: 70px;
    height: fit-content;
}

.docs-toc h4 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

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

.toc-list a {
    display: block;
    padding: 4px 0;
    color: #6b7280;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.4;
    transition: color 0.2s ease;
    border-left: 2px solid transparent;
    padding-left: 12px;
}

.toc-list a:hover {
    color: #f97316;
}

.toc-list a.active {
    color: #ea580c;
    border-left-color: #f97316;
    font-weight: 500;
}

/* Links */
.docs-article a {
    color: #f97316;
    text-decoration: none;
    font-weight: 500;
}

.docs-article a:hover {
    color: #ea580c;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .docs-layout {
        grid-template-columns: 280px 1fr;
    }
    
    .docs-toc {
        display: none;
    }
}

@media (max-width: 768px) {
    .docs-layout {
        grid-template-columns: 1fr;
    }
    
    .docs-sidebar {
        position: fixed;
        top: 70px;
        left: -280px;
        width: 280px;
        height: calc(100vh - 70px);
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: none;
        border-right: none;
    }
    
    .docs-sidebar.mobile-open {
        left: 0;
    }
    
    .docs-content {
        padding: 24px 20px;
    }
    
    .docs-article h1 {
        font-size: 2rem;
    }
    
    .docs-article h2 {
        font-size: 1.5rem;
    }
    
    .code-block {
        margin: 16px -20px;
        border-radius: 0;
    }
    
    .table-container {
        margin: 16px -20px;
        border-radius: 0;
    }
}

@media (max-width: 480px) {
    .docs-content {
        padding: 16px;
    }
    
    .docs-article h1 {
        font-size: 1.75rem;
    }
    
    .docs-article h2 {
        font-size: 1.375rem;
    }
    
    .docs-article h3 {
        font-size: 1.25rem;
    }
    
    .api-endpoint {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .code-block {
        margin: 16px -16px;
    }
    
    .table-container {
        margin: 16px -16px;
    }
    
    .docs-callout {
        margin: 16px -16px;
        border-radius: 0;
    }
}

/* Print Styles */
@media print {
    .nav,
    .docs-sidebar,
    .docs-toc,
    .code-copy {
        display: none !important;
    }
    
    .docs-layout {
        grid-template-columns: 1fr;
    }
    
    .docs-content {
        padding: 0;
        max-width: none;
    }
    
    .docs-article {
        max-width: none;
    }
    
    .code-block {
        background: #f8fafc !important;
        border: 1px solid #e5e7eb;
    }
    
    .code-block pre {
        color: #374151 !important;
    }
    
    .docs-callout {
        border: 1px solid #d1d5db;
        background: #f9fafb !important;
        color: #374151 !important;
    }
}

/* Syntax Highlighting */
.code-block .comment {
    color: #94a3b8;
}

.code-block .string {
    color: #34d399;
}

.code-block .number {
    color: #fbbf24;
}

.code-block .keyword {
    color: #60a5fa;
}

.code-block .function {
    color: #a78bfa;
}

/* Animations */
.docs-nav-link,
.toc-list a,
.search-input,
.code-copy {
    transition: all 0.2s ease;
}

/* Focus States */
.docs-nav-link:focus,
.toc-list a:focus,
.search-input:focus,
.code-copy:focus {
    outline: 2px solid #f97316;
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: #fed7aa;
    color: #ea580c;
}

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

.docs-sidebar::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.docs-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.docs-sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}