/* Documentation specific styles */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-header {
    padding: 2.5rem 0;
    text-align: center;
    background-color: var(--background-light);
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.page-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto;
}

main {
    display: flex;
    flex: 1;
    padding: 2rem 0;
}

.doc-nav {
    width: 280px;
    flex-shrink: 0;
    background-color: var(--background);
    border-right: 1px solid var(--border);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.doc-nav-inner {
    padding: 0 1.5rem;
}

.doc-nav h3 {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

.doc-nav h3:first-child {
    margin-top: 0;
}

.doc-nav ul {
    list-style: none;
    margin-bottom: 1.5rem;
}

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

.doc-nav li a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    display: block;
    padding: 0.35rem 0;
    border-radius: 4px;
    transition: all 0.2s;
}

.doc-nav li a:hover, .doc-nav li a.active {
    color: var(--primary);
}

.doc-nav li a.active {
    background-color: rgba(14, 165, 233, 0.1);
    padding-left: 0.5rem;
}

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

.doc-nav-section > span {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: block;
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

.doc-nav-section ul {
    padding-left: 1rem;
    margin-bottom: 0.75rem;
}

.doc-content {
    flex: 1;
    padding: 0 2rem 2rem;
    max-width: 920px;
    margin: 0 auto;
}

.doc-content h2 {
    font-size: 1.8rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.doc-content h2:first-child {
    margin-top: 0;
}

.doc-content h3 {
    font-size: 1.4rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.doc-content h4 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.doc-content p {
    margin-bottom: 1.25rem;
}

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

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

.doc-content a {
    color: var(--primary);
    text-decoration: none;
}

.doc-content a:hover {
    text-decoration: underline;
}

.doc-content code {
    font-family: 'Courier New', Courier, monospace;
    background-color: var(--background-light);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.doc-content pre {
    background-color: var(--background-light);
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.doc-content pre code {
    background-color: transparent;
    padding: 0;
    font-size: 0.9rem;
    display: block;
}

.doc-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.doc-content table th, .doc-content table td {
    padding: 0.75rem;
    border: 1px solid var(--border);
    text-align: left;
}

.doc-content table th {
    background-color: var(--background-light);
}

.doc-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert-info {
    background-color: rgba(14, 165, 233, 0.1);
    border-color: var(--primary);
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
}

/* Add support for diagram elements used in clustering page */
.diagram {
    background-color: var(--background-light);
    border-radius: 8px;
    padding: 2rem;
    margin: 1.5rem 0;
    text-align: center;
    border: 1px solid var(--border);
}

.diagram pre {
    margin-bottom: 0;
    text-align: left;
}

@media (max-width: 1024px) {
    .doc-nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
}

.step-container {
    margin-bottom: 2rem;
    width: 100%; /* Ensure full width */
}


.step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    text-align: left;
    width: 100%; /* Ensure full width */
    max-width: none; /* Override any inherited max-width */
}


.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 16px;
    background-color: var(--primary);
    color: white;
    font-weight: bold;
    margin-right: 1rem;
    flex-shrink: 0;
    margin-top: 0.25rem; /* Slight offset to align with text baseline */
}

.step-content {
    flex: 1;
    text-align: left;
    width: 100%; /* Ensure content takes full available width */
    min-width: 0; /* Allow flex item to shrink below content size */
}

    .step-content h4 {
        margin-top: 0;
        margin-bottom: 0.5rem;
        text-align: left; /* Ensure headers are left-aligned */
    }

    .step-content h5 {
        text-align: left; /* Also fix h5 alignment */
        margin-top: 1rem;
        margin-bottom: 0.5rem;
    }

    .step-content p {
        text-align: left; /* Override any inherited alignment */
    }

    .step-content pre {
        text-align: left; /* Ensure code blocks stay left-aligned */
    }

    .step-content ul, .step-content ol {
        text-align: left; /* Ensure lists are left-aligned */
    }

/* Professional Scrollbar Styles for ApiCharge */

/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--background);
    border-radius: 6px;
    border: 1px solid var(--border);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--text-muted), #64748b);
    border-radius: 6px;
    border: 2px solid var(--background);
    transition: background 0.3s ease;
}

    ::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    }

::-webkit-scrollbar-corner {
    background: var(--background);
}

/* Thin scrollbar variant for documentation navigation */
.doc-nav::-webkit-scrollbar {
    width: 8px;
}

.doc-nav::-webkit-scrollbar-track {
    background: var(--background-light);
    border-radius: 4px;
    border: 1px solid rgba(51, 65, 85, 0.3);
}

.doc-nav::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--text-muted), #64748b);
    border-radius: 4px;
    border: 1px solid var(--background-light);
}

    .doc-nav::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    }

/* Firefox scrollbar styling */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--text-muted) var(--background);
}

.doc-nav {
    scrollbar-width: thin;
    scrollbar-color: var(--text-muted) var(--background-light);
}

/* Enhanced scrollbar for code blocks */
pre::-webkit-scrollbar {
    height: 8px;
}

pre::-webkit-scrollbar-track {
    background: var(--background-light);
    border-radius: 4px;
}

pre::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
    border: 1px solid var(--background-light);
}

    pre::-webkit-scrollbar-thumb:hover {
        background: var(--primary);
    }

/* Table horizontal scrolling */
.doc-content table::-webkit-scrollbar {
    height: 6px;
}

.doc-content table::-webkit-scrollbar-track {
    background: var(--background-light);
    border-radius: 3px;
}

.doc-content table::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

    .doc-content table::-webkit-scrollbar-thumb:hover {
        background: var(--primary);
    }

/* Smooth scrolling behavior */
html {
    scroll-behavior: smooth;
}

/* Custom scroll indicators for better UX */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform-origin: left;
    transform: scaleX(0);
    z-index: 9999;
    transition: transform 0.1s ease-out;
}

/* Alternative: More subtle scrollbars for a cleaner look */
.subtle-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.subtle-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.subtle-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.5);
    border-radius: 3px;
}

    .subtle-scrollbar::-webkit-scrollbar-thumb:hover {
        background: rgba(14, 165, 233, 0.8);
    }

/* Mobile-specific scrollbar adjustments */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

    .doc-nav::-webkit-scrollbar {
        width: 6px;
    }
}

/* Dark mode optimization (if you implement theme switching) */
@media (prefers-color-scheme: dark) {
    ::-webkit-scrollbar-thumb {
        background: linear-gradient(180deg, #64748b, #475569);
    }

        ::-webkit-scrollbar-thumb:hover {
            background: linear-gradient(180deg, var(--primary), var(--primary-dark));
        }
}