/* Docs Style - Modern & Readable */
:root {
    --sidebar-width: 280px;
    --toc-width: 240px;
    --docs-container: 1200px;
}

/* Layout */
.docs-wrapper {
    display: flex;
    max-width: var(--docs-container);
    margin: 0 auto;
    padding: 8rem 2rem 4rem;
    gap: 3rem;
    min-height: 100vh;
}

/* Sidebar Styling */
.docs-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: 6rem;
    height: calc(100vh - 8rem);
    overflow-y: auto;
    scrollbar-width: thin;
    padding-right: 1rem;
}

.docs-sidebar::-webkit-scrollbar {
    width: 4px;
}

.docs-sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.docs-search {
    margin-bottom: 2rem;
}

.docs-search .search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.docs-search .search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.1);
    outline: none;
}

.sidebar-section {
    margin-bottom: 2.5rem;
}

.sidebar-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding-left: 0.75rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-link i {
    width: 18px;
    height: 18px;
}

.sidebar-link:hover {
    color: var(--text);
    background: var(--bg-secondary);
}

.sidebar-link.active {
    color: var(--primary);
    background: rgba(88, 101, 242, 0.1);
    font-weight: 600;
}

/* Content Area */
.docs-content {
    flex-grow: 1;
    max-width: 800px;
}

.docs-header {
    margin-bottom: 4rem;
}

.docs-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.docs-breadcrumb a {
    color: inherit;
    text-decoration: none;
}

.docs-breadcrumb a:hover {
    color: var(--primary);
}

.docs-title {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.docs-description {
    font-size: 1.2rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Sections */
.docs-section {
    margin-bottom: 5rem;
    scroll-margin-top: 100px;
}

.docs-section h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.docs-section p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.docs-section ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.docs-section li {
    margin-bottom: 0.75rem;
    color: var(--text-muted);
    font-size: 1rem;
}

.docs-section code {
    background: var(--bg-secondary);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    color: var(--primary);
    border: 1px solid var(--border);
}

/* Callouts */
.callout {
    display: flex;
    gap: 1.25rem;
    padding: 1.5rem;
    border-radius: 16px;
    background: var(--bg-secondary);
    border-left: 4px solid var(--primary);
    margin: 2rem 0;
}

.callout-icon {
    width: 24px;
    height: 24px;
    color: var(--primary);
    flex-shrink: 0;
}

.callout-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.callout-text {
    margin: 0 !important;
    font-size: 0.95rem !important;
}

/* Code Blocks */
.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1e1e2e;
    padding: 0.75rem 1.25rem;
    border-radius: 12px 12px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
}

.code-language {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
}

.copy-code-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    transition: color 0.2s;
}

.copy-code-btn:hover {
    color: white;
}

pre {
    background: #1e1e2e;
    padding: 1.5rem;
    border-radius: 0 0 12px 12px;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
}

pre code {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    color: #cdd6f4 !important;
}

/* Command Examples */
.command-example {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
}

.command-example code {
    font-size: 1.1rem;
    color: var(--primary);
}

/* TOC (Right Sidebar) */
.docs-toc {
    width: var(--toc-width);
    flex-shrink: 0;
    position: sticky;
    top: 8rem;
    height: fit-content;
    padding-left: 2rem;
    border-left: 1px solid var(--border);
}

.toc-title {
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.toc-list {
    list-style: none;
    padding: 0;
}

.toc-item {
    margin-bottom: 0.75rem;
}

.toc-link {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    display: block;
}

.toc-link:hover {
    color: var(--primary);
}

.toc-link.active {
    color: var(--primary);
    font-weight: 600;
}

/* Navigation Buttons at bottom */
.docs-navigation {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 6rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border);
}

.docs-nav-btn {
    flex: 1;
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.docs-nav-btn:hover {
    border-color: var(--primary);
    background: var(--bg-secondary);
    transform: translateY(-4px);
}

.docs-nav-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.docs-nav-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.docs-nav-btn.next {
    align-items: flex-end;
    text-align: right;
}

/* Mobile Responsive Overhaul */
@media (max-width: 1200px) {
    .docs-toc {
        display: none;
    }
}

@media (max-width: 992px) {

    /* Global Fixes */
    html,
    body {
        overflow-x: hidden;
        /* Prevent horizontal scroll */
        max-width: 100vw;
    }

    .docs-wrapper {
        display: block;
        /* Remove flex layout on mobile */
        padding: 6rem 1rem 4rem;
        /* Standard mobile padding */
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }

    /* Content Area */
    .docs-content {
        width: 100%;
        max-width: 100%;
    }

    /* Mobile Sidebar */
    .docs-sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        height: 100vh;
        width: 85%;
        max-width: 320px;
        background: rgba(13, 13, 14, 0.98);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        z-index: 2500;
        padding: 2rem;
        padding-top: 6rem;
        border-right: 1px solid var(--border);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .docs-sidebar.mobile-open {
        left: 0;
    }

    /* Typography fixes for readability */
    .docs-title {
        font-size: 2rem;
        line-height: 1.2;
    }

    .docs-description {
        font-size: 1.05rem;
    }

    .docs-section h2 {
        font-size: 1.5rem;
    }

    .docs-section p,
    .docs-section li {
        font-size: 1rem;
        line-height: 1.6;
    }

    /* CODE BLOCKS - CRITICAL FIX */
    pre {
        padding: 1rem;
        font-size: 0.85rem;
        white-space: pre-wrap;
        /* Force text to wrap */
        word-break: break-all;
        /* Break long words/urls */
        max-width: 100%;
        overflow-x: hidden;
        /* No scrolling needed now */
    }

    .code-block-header {
        padding: 0.5rem 1rem;
    }

    /* Cards & Callouts */
    .callout {
        padding: 1rem;
        gap: 1rem;
    }

    .command-example {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .command-example code {
        font-size: 0.9rem;
        white-space: pre-wrap;
        word-break: break-all;
    }

    /* Navigation grid */
    .command-grid {
        grid-template-columns: 1fr !important;
    }

    /* Sidebar Toggle */
    .sidebar-toggle {
        display: flex;
        position: fixed;
        bottom: 1.5rem;
        right: 1.5rem;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: var(--primary);
        color: white;
        box-shadow: 0 4px 20px rgba(88, 101, 242, 0.4);
        z-index: 2400;
        justify-content: center;
        align-items: center;
        cursor: pointer;
    }

    .docs-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        z-index: 2450;
        display: none;
        opacity: 0;
        transition: opacity 0.3s;
    }

    .docs-backdrop.active {
        display: block;
        opacity: 1;
    }

    .docs-navigation {
        flex-direction: column;
        gap: 1rem;
    }

    .docs-nav-btn.next {
        align-items: flex-start;
        text-align: left;
    }
}