/* Docs-specific styles - OpenAI inspired design */

/* Override nav to always have background (not transparent) */
#nav,
#nav.scrolled {
    background: var(--bg-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    padding: 15px 0;
}

/* Layout Wrapper */
.docs-layout-wrapper {
    position: fixed;
    top: 130px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

/* Layout Container */
.docs-layout {
    display: grid;
    grid-template-columns: 280px 1fr 200px;
    gap: 0 10px;
    max-width: 1440px;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    padding: 0 clamp(20px, 5vw, 60px);
    box-sizing: border-box;
}

/* Sidebar */
.docs-sidebar {
    height: 100%;
    overflow-y: auto;
    background: var(--bg-color);
    border-right: 1px solid rgba(163, 177, 198, 0.2);
    padding: 20px;
}

.sidebar-search {
    position: relative;
    margin-bottom: 30px;
}

.sidebar-search input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid rgba(163, 177, 198, 0.3);
    border-radius: 8px;
    background: var(--surface-color);
    font-family: var(--font-text);
    font-size: 0.9rem;
    color: var(--text-main);
    transition: all 0.2s;
}

.sidebar-search input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

/* Sidebar Navigation */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.nav-section-title {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.2s;
    display: block;
}

.nav-item:hover {
    background: rgba(79, 172, 254, 0.1);
    color: var(--accent-blue);
}

.nav-item.active {
    background: rgba(79, 172, 254, 0.15);
    color: var(--accent-blue);
    font-weight: 600;
}

/* Main Content */
.doc-article {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 40px 40px 40px;
    background: var(--bg-color);
}

.doc-section {
    margin-bottom: 60px;
    scroll-margin-top: 100px;
}

.doc-section h1 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text-main);
}

.doc-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 16px;
    color: var(--text-main);
}

.doc-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 30px;
    margin-bottom: 12px;
    color: var(--text-main);
}

.doc-section p {
    line-height: 1.8;
    margin-bottom: 16px;
    color: var(--text-main);
}

.lead {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* Info Boxes */
.info-box,
.warning-box {
    padding: 20px;
    border-radius: 12px;
    margin: 24px 0;
    border-left: 4px solid var(--accent-blue);
    background: rgba(79, 172, 254, 0.05);
}

.warning-box {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.info-box-title,
.warning-box-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

/* Code Blocks */
pre {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid rgba(163, 177, 198, 0.2);
}

code {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
}

.code-group {
    margin: 20px 0;
}

.code-group-title {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
}

p code,
li code {
    background: rgba(79, 172, 254, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--accent-blue);
}

/* Lists */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.feature-list li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(163, 177, 198, 0.1);
}

.feature-list li:last-child {
    border-bottom: none;
}

.doc-image {
    max-width: 100%;
    height: auto;
    margin: 2rem 0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
}

ul, ol {
    padding-left: 24px;
    margin: 16px 0;
}

li {
    margin: 8px 0;
    line-height: 1.8;
}

/* Links */
.inline-link {
    color: var(--accent-blue);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.inline-link:hover {
    border-bottom-color: var(--accent-blue);
}

/* Agent Grid */
.agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.agent-card {
    padding: 24px;
    border-radius: 12px;
    background: var(--surface-color);
    border: 1px solid rgba(163, 177, 198, 0.2);
    transition: all 0.3s;
}

.agent-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-blue);
}

.agent-card h3 {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--accent-blue);
}

.agent-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

/* Endpoints */
.endpoint-list {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.endpoint-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface-color);
    border-radius: 8px;
    border: 1px solid rgba(163, 177, 198, 0.2);
}

.endpoint-method {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(79, 172, 254, 0.2);
    color: var(--accent-blue);
}

.endpoint-item code {
    flex: 1;
    background: transparent;
    padding: 0;
    color: var(--text-main);
}

.endpoint-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Table of Contents */
.docs-toc {
    position: sticky;
    top: 20px;
    height: fit-content;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    padding: 20px 0;
    background: var(--bg-color);
}

.toc-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toc-nav a {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 4px 0;
    border-left: 2px solid transparent;
    padding-left: 12px;
    transition: all 0.2s;
}

.toc-nav a:hover {
    color: var(--accent-blue);
    border-left-color: var(--accent-blue);
}

.toc-nav a.active {
    color: var(--accent-blue);
    border-left-color: var(--accent-blue);
    font-weight: 600;
}

/* Footer */
.doc-footer {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid rgba(163, 177, 198, 0.2);
    text-align: center;
    color: var(--text-muted);
}

/* Breadcrumb */
.breadcrumb-container {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--bg-color);
    padding: 15px 0;
    border-bottom: 1px solid rgba(163, 177, 198, 0.2);
    z-index: 999;
}

.breadcrumb {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: opacity 0.2s;
}

.breadcrumb a:hover {
    opacity: 0.7;
}

.breadcrumb-separator {
    color: var(--text-muted);
}

.breadcrumb-current {
    color: var(--text-main);
    font-weight: 600;
}

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

    .docs-toc {
        display: none;
    }

    .doc-article {
        grid-template-columns: 1fr;
    }
}

/* Hide mobile sidebar toggle button by default */
.mobile-sidebar-toggle {
    display: none;
}

@media (max-width: 768px) {
    .docs-layout-wrapper {
        top: 110px;
        position: relative;
    }

    .docs-layout {
        display: flex;
        flex-direction: column;
        height: auto;
        padding: 0;
    }

    /* Mobile sidebar toggle button */
    .mobile-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        padding: 12px 20px;
        margin: 20px 20px 20px 20px;
        background: var(--surface-color);
        border: none;
        border-radius: 12px;
        font-family: var(--font-sans);
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--text-main);
        cursor: pointer;
        box-shadow:
            8px 8px 16px var(--shadow-dark),
            -8px -8px 16px var(--shadow-light);
        transition: all 0.3s ease;
        width: auto;
    }

    .mobile-sidebar-toggle:hover {
        box-shadow:
            10px 10px 20px var(--shadow-dark),
            -10px -10px 20px var(--shadow-light);
    }

    .mobile-sidebar-toggle:active {
        box-shadow:
            inset 4px 4px 8px var(--shadow-dark),
            inset -4px -4px 8px var(--shadow-light);
    }

    .mobile-sidebar-toggle.active {
        box-shadow:
            inset 6px 6px 12px var(--shadow-dark),
            inset -6px -6px 12px var(--shadow-light);
    }

    .mobile-sidebar-toggle span:first-child {
        font-size: 1.3rem;
        line-height: 1;
    }

    /* Hide sidebar on mobile by default */
    .docs-sidebar {
        display: none;
        position: fixed;
        top: 110px;
        left: 0;
        right: 0;
        bottom: 0;
        height: auto;
        max-height: calc(100vh - 110px);
        overflow-y: auto;
        border-right: none;
        border-bottom: none;
        padding: 20px;
        background: var(--bg-color);
        z-index: 998;
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    }

    .docs-sidebar.active {
        display: block;
    }

    /* Content takes full width */
    .doc-article {
        width: 100%;
        padding: 0 20px 30px;
        height: auto;
        overflow-y: visible;
    }

    .agent-grid {
        grid-template-columns: 1fr;
    }

    .breadcrumb-container {
        top: 70px;
        padding: 10px 0;
    }

    .breadcrumb {
        font-size: 0.75rem;
    }

    #nav {
        padding: 10px 0;
    }

    /* Make code examples more mobile-friendly */
    pre {
        font-size: 0.8rem;
        overflow-x: auto;
    }

    /* Adjust heading sizes */
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .docs-layout-wrapper {
        top: 100px;
    }

    .breadcrumb-container {
        top: 65px;
    }

    .doc-article {
        padding: 20px 15px;
    }

    /* Adjust button sizes */
    .btn {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
}
