/* Documentation Page Styles */

.docs-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 4rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 100px 2rem 0;
    height: 100vh;
    overflow: hidden;
}

/* Font Consistency Fix */
.docs-layout,
.docs-sidebar,
.docs-content,
.content-text,
.sidebar-link,
.sidebar-title,
.doc-section,
.doc-article {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

.code-block code,
.content-text code,
.content-text pre {
    font-family: 'Monaco', 'Courier New', monospace !important;
}

/* Original docs styles compatibility */
.docs-sidebar nav {
    display: block;
}

/* Sidebar */
.docs-sidebar {
    height: 100%;
    overflow-y: auto;
    padding-right: 1rem;
    padding-bottom: 4rem;
}

.docs-content {
    min-width: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding-bottom: 4rem;
    padding-right: 1rem;
}

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

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

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

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section h3 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.sidebar-link {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.sidebar-link:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: rgba(255, 0, 0, 0.1);
    color: var(--primary);
    font-weight: 600;
}

/* Main Content */
.docs-content {
    max-width: 800px;
}

.doc-article {
    color: var(--text-primary);
}

.doc-article h1 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.lead {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    line-height: 1.7;
}

.doc-section {
    margin-bottom: 4rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--border);
}

.doc-section:last-child {
    border-bottom: none;
}

.doc-section h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    margin-top: 2rem;
    scroll-margin-top: 100px;
}

.doc-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    margin-top: 2rem;
    color: var(--text-primary);
}

.doc-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.doc-section ul,
.doc-section ol {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.doc-section li {
    margin-bottom: 0.5rem;
}

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

/* Code Blocks */
.code-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
}

.code-block code {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--primary);
    line-height: 1.6;
}

/* Info Boxes */
.info-box,
.warning-box {
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    border-left: 4px solid;
}

.info-box {
    background: rgba(0, 170, 255, 0.05);
    border-color: #0aa;
    color: var(--text-secondary);
}

.warning-box {
    background: rgba(255, 0, 0, 0.05);
    border-color: var(--primary);
    color: var(--text-secondary);
}

.info-box strong,
.warning-box strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.5rem;
}

/* FAQ Items */
.faq-item {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.faq-item h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    margin-top: 0;
    color: var(--text-primary);
}

.faq-item p {
    margin-bottom: 0;
}

/* Original docs compatibility classes */
.sidebar-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.sidebar-title:first-child {
    margin-top: 0;
}

.sidebar-item {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    cursor: pointer;
}

.sidebar-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.sidebar-item.active {
    background: rgba(255, 0, 0, 0.1);
    color: var(--primary);
    font-weight: 600;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-title {
    font-size: 2rem !important;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.subsection-title {
    font-size: 1rem !important;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.content-text {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1rem !important;
}

.content-text *,
.content-text p,
.content-text li,
.content-text span,
.content-text div {
    font-size: 1rem !important;
}

.content-text h3 {
    font-size: 1.5rem !important;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.content-text h2 {
    font-size: 1.75rem !important;
}

.content-text p {
    margin-bottom: 1rem;
}

.content-text ul,
.content-text ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.content-text li {
    margin-bottom: 0.5rem;
}

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

.content-text code {
    background: var(--bg-card);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem !important;
    color: var(--primary);
}

.content-text pre {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.content-text pre code {
    background: none;
    padding: 0;
}

/* Hide Footer on Docs Page */
.footer {
    display: none;
}

/* Responsive */
@media (max-width: 1100px) {
    html, body {
        height: auto;
        overflow: auto;
    }

    .docs-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
        height: auto;
        overflow: visible;
        padding: 8rem 1rem 2rem;
    }
    
    .docs-sidebar {
        position: relative;
        top: 0;
        height: auto;
        max-height: 300px;
        overflow-y: auto;
        padding-right: 0.5rem;
        border-bottom: 1px solid var(--border);
        padding-bottom: 1rem;
        margin-bottom: 2rem;
        background: rgba(0,0,0,0.2);
        border-radius: 8px;
        padding: 1rem;
    }

    .docs-content {
        height: auto;
        overflow: visible;
        padding-right: 0;
    }
    
    /* Tablet/Mobile Navigation Grid */
    .docs-sidebar {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .sidebar-section {
        display: block;
        margin-bottom: 0;
    }

    .sidebar-title {
        position: sticky;
        top: 0;
        background: var(--bg-card);
        padding: 0.5rem;
        margin: 0 0 0.5rem 0;
        z-index: 10;
        border-radius: 4px;
        border-left: 3px solid var(--primary);
    }
    
    /* Container for links to make them grid-like */
    .sidebar-section {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 0.5rem;
    }
    
    /* Make the title span full width */
    .sidebar-section .sidebar-title {
        grid-column: 1 / -1;
    }
    
    .sidebar-link, .sidebar-item {
        display: block;
        margin: 0;
        background: rgba(255, 255, 255, 0.03);
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sidebar-link:hover, .sidebar-item:hover {
        background: var(--bg-card);
        transform: translateY(-2px);
    }
}

@media (max-width: 768px) {
    .docs-layout {
        padding: 6rem 1rem 2rem;
    }
    
    .docs-sidebar {
        max-height: 250px;
    }
    
    .sidebar-section {
        grid-template-columns: 1fr; /* Stack on phones */
    }
    
    .sidebar-link, .sidebar-item {
        text-align: left;
        padding-left: 1rem;
    }

    .doc-article h1 {
        font-size: 2rem;
    }
    
    .lead {
        font-size: 1.1rem;
    }
    
    .doc-section h2 {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .subsection-title {
        font-size: 1.25rem;
    }
}
