/* Documentation Styles */

:root {
    --primary: #007AFF;
    --secondary: #5856D6;
    --success: #34C759;
    --warning: #FF9500;
    --danger: #FF3B30;
    --dark: #1C1C1E;
    --gray-900: #2C3E50;
    --gray-800: #34495E;
    --gray-700: #4A5568;
    --gray-600: #718096;
    --gray-500: #A0AEC0;
    --gray-400: #CBD5E0;
    --gray-300: #E2E8F0;
    --gray-200: #EDF2F7;
    --gray-100: #F7FAFC;
    --gray-50: #F9FAFB;
    --white: #FFFFFF;
    
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Monaco', monospace;
    --sidebar-width: 280px;
    --header-height: 72px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--gray-900);
    background: var(--white);
    line-height: 1.6;
}

/* Docs Search in Content Area */
.docs-search-container {
    position: relative;
    margin-bottom: 32px;
    max-width: 100%;
}

.docs-search-input {
    width: 100%;
    height: 48px;
    padding: 0 48px 0 20px;
    background: var(--white);
    border: 2px solid var(--gray-300);
    border-radius: 12px;
    font-size: 16px;
    color: var(--gray-900);
    transition: all 0.2s;
}

.docs-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.docs-search-container .search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    stroke: var(--gray-500);
    pointer-events: none;
}


/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Layout */
.docs-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    width: 100%;
}

/* Sidebar */
.docs-sidebar {
    background: var(--gray-50);
    border-right: 1px solid var(--gray-200);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--header-height));
    position: sticky;
    top: var(--header-height);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--gray-200);
}

.sidebar-header h3 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-600);
}

.sidebar-nav {
    flex: 1;
    padding: 16px;
}

.category-item {
    margin-bottom: 8px;
}

.category-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.category-link:hover {
    background: var(--white);
    color: var(--primary);
}

.category-link.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.category-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
    align-self: center;
}

.category-header .category-icon {
    width: 28px;
    height: 28px;
    align-self: flex-start;
    margin-top: 2px;
}

.category-count {
    margin-left: auto;
    font-size: 12px;
    background: var(--gray-200);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--gray-600);
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid var(--gray-200);
    margin-top: auto;
    background: var(--gray-50);
    flex-shrink: 0;
}

.last-updated {
    font-size: 12px;
    color: var(--gray-600);
    margin-bottom: 16px;
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.sidebar-link:hover {
    color: var(--primary);
}

/* Main Content */
.docs-content {
    padding: 32px;
    max-width: 900px;
    width: 100%;
}

/* Featured Section */
.featured-section {
    margin-bottom: 48px;
}

.featured-section h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--gray-900);
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.featured-card {
    padding: 16px;
    background: var(--gray-50);
    border-radius: 12px;
    text-decoration: none;
    color: var(--gray-900);
    transition: all 0.2s;
    border: 1px solid transparent;
}

.featured-card:hover {
    background: var(--white);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.featured-question {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--gray-900);
}

.featured-category {
    font-size: 12px;
    color: var(--gray-600);
}

/* FAQ Content */
.category-section {
    margin-bottom: 48px;
    scroll-margin-top: calc(var(--header-height) + 24px);
}

.category-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-200);
    margin-left: 0;
    padding-left: 0;
}

.category-title {
    font-size: 28px;
    color: var(--gray-900);
    line-height: 32px;
}

.category-description {
    color: var(--gray-600);
    margin-bottom: 24px;
    font-size: 15px;
}

.faq-item {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--gray-50);
    border-radius: 12px;
    scroll-margin-top: calc(var(--header-height) + 24px);
    transition: all 0.2s;
    border: 1px solid transparent;
}

.faq-item:target,
.faq-item:hover {
    background: var(--white);
    border-color: var(--gray-300);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.faq-question {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.faq-link {
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.2s;
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
}

.faq-link img {
    width: 20px;
    height: 20px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.faq-item:hover .faq-link {
    opacity: 1;
}

.faq-link:hover img {
    opacity: 1;
}

.faq-answer {
    color: var(--gray-700);
    line-height: 1.7;
    font-size: 15px;
}

.faq-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.faq-tag {
    font-size: 12px;
    padding: 4px 8px;
    background: var(--gray-200);
    color: var(--gray-600);
    border-radius: 4px;
}

/* Code Blocks */
.code-block {
    margin-top: 16px;
    background: var(--gray-900);
    border-radius: 8px;
    overflow: hidden;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: var(--gray-800);
    border-bottom: 1px solid var(--gray-700);
}

.code-language {
    font-size: 12px;
    color: var(--gray-400);
    font-family: var(--font-mono);
}

.code-copy {
    padding: 4px 8px;
    background: var(--gray-700);
    color: var(--gray-300);
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.code-copy:hover {
    background: var(--gray-600);
    color: var(--white);
}

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

.code-content {
    padding: 16px;
    overflow-x: auto;
}

.code-content pre {
    margin: 0;
    color: var(--gray-100);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.5;
}

/* Related Links */
.related-links {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}

.related-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.related-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.related-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    padding: 4px 8px;
    background: rgba(0, 122, 255, 0.1);
    border-radius: 4px;
    transition: all 0.2s;
}

.related-link:hover {
    background: rgba(0, 122, 255, 0.2);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 64px 32px;
    color: var(--gray-600);
}

.no-results svg {
    color: var(--gray-400);
    margin-bottom: 16px;
}

.no-results h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--gray-700);
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #0051D5;
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 968px) {
    .docs-container {
        display: block;
    }
    
    .docs-sidebar {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: var(--sidebar-width);
        height: calc(100vh - var(--header-height));
        transform: translateX(-100%);
        transition: transform 0.3s;
        z-index: 999;
        max-height: calc(100vh - var(--header-height));
    }
    
    .docs-sidebar.active {
        transform: translateX(0);
    }
    
    .docs-content {
        padding: 24px;
    }
    
    .search-container {
        width: 200px;
    }
}

@media (max-width: 640px) {
    .nav-right {
        flex-direction: column;
        gap: 8px;
    }
    
    .search-container {
        width: 100%;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
    }
}

/* Syntax Highlighting (basic) */
.token-keyword { color: #FF79C6; }
.token-string { color: #F1FA8C; }
.token-comment { color: #6272A4; }
.token-number { color: #BD93F9; }
.token-property { color: #8BE9FD; }