.navbar-brand img {
    width: auto;
    /* Maintain aspect ratio */
    height: 70px;
    /* Adjusting logo */
}

/* Adjusting navbar height */
.navbar {
    min-height: 80px;
}

/* Responsive layout improvements */
.bd-main .bd-content {
    max-width: none;
    flex: 1;
}

/* Make the main content area fluid and grow with viewport */
.bd-container,
.bd-container-fluid,
.bd-page-width,
.bd-main .bd-content,
.bd-content .bd-article-container,
.bd-article {
    max-width: none !important;
}

.bd-container-fluid,
.bd-page-width {
    width: 100% !important;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Reduce excessive padding on large screens */
@media (min-width: 1200px) {
    .bd-container-fluid {
        padding: 0 2rem;
    }
}

/* Scikit-learn style sidebar width (22.5% like their setup) */
.bd-sidebar-primary {
    width: 22.5%;
    min-width: 250px;
    max-width: 320px;
}

.bd-sidebar-secondary {
    min-width: 200px;
    max-width: 250px;
}

/* Better responsive behavior */
@media (max-width: 1400px) {
    .bd-sidebar-secondary {
        max-width: 200px;
    }
}

@media (max-width: 1200px) {
    .bd-sidebar-secondary {
        display: none;
    }
}

/* Ensure content area can flex and scroll if needed */
.bd-main .bd-content {
    flex: 1 1 auto;
}

.bd-article {
    min-width: 0;
    flex: 1 1 auto;
    overflow-x: auto;
}

/* Better word wrapping for long titles */
h1,
h2,
h3,
h4,
h5,
h6 {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Scikit-learn inspired color scheme */
:root {
    /* Cyan palette - primary */
    --sk-cyan-tint5: #edf7fd;
    --sk-cyan-tint4: #c5e7f6;
    --sk-cyan-tint3: #9dd6ef;
    --sk-cyan-tint2: #75c6e8;
    --sk-cyan-tint1: #4db5e1;
    --sk-cyan: #29abe2;
    --sk-cyan-shade1: #2294c4;
    --sk-cyan-shade2: #1c7da6;
    --sk-cyan-shade3: #156688;
    --sk-cyan-shade4: #0e4f6a;
    --sk-cyan-shade5: #07384c;

    /* Orange palette - secondary */
    --sk-orange-tint5: #fff5ec;
    --sk-orange-tint4: #fde0c2;
    --sk-orange-tint3: #fbcb98;
    --sk-orange-tint2: #f9b66e;
    --sk-orange-tint1: #f7a044;
    --sk-orange: #f7931e;
    --sk-orange-shade1: #d77f19;
    --sk-orange-shade2: #b76b14;
    --sk-orange-shade3: #97570f;
    --sk-orange-shade4: #77430a;
    --sk-orange-shade5: #572f05;
}

/* AutoAPI specific styling - adapted for actual AutoAPI structure */

/* Function signatures in AutoAPI */
.rst-content .sig.py {
    background: var(--sk-orange-tint5);
    border-left: 3px solid var(--sk-orange);
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 0;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9em;
    line-height: 1.4;
}

/* Module level functions */
.rst-content .py.function > .sig {
    background: var(--sk-orange-tint5);
    border-left: 3px solid var(--sk-orange);
}

/* Class signatures */
.rst-content .py.class > .sig {
    background: var(--sk-cyan-tint4);
    border-left: 4px solid var(--sk-cyan);
    font-weight: 500;
}

/* Method signatures within classes */
.rst-content .py.method > .sig {
    background: var(--sk-orange-tint4);
    border-left: 2px solid var(--sk-orange-shade1);
    margin-left: 1rem;
    font-size: 0.85em;
}

/* Property signatures */
.rst-content .py.property > .sig {
    background: var(--sk-cyan-tint5);
    border-left: 2px solid var(--sk-cyan-shade2);
    margin-left: 1rem;
    font-size: 0.85em;
}

/* Attribute signatures */
.rst-content .py.attribute > .sig {
    background: #f8f9fa;
    border-left: 2px solid #6c757d;
    margin-left: 1rem;
    font-style: italic;
    font-size: 0.85em;
}

/* Signature name styling */
.rst-content .sig .sig-name {
    font-weight: 600;
    color: var(--sk-cyan-shade4);
}

/* Parameter highlighting */
.rst-content .sig .sig-param {
    color: var(--sk-orange-shade2);
    font-style: normal;
}

.rst-content .sig .sig-param .default_value {
    color: var(--sk-cyan-shade2);
    font-weight: normal;
}

/* Scikit-learn style section headers */
.rst-content h1 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--sk-cyan-shade3);
    font-weight: 600;
    font-size: 1.8rem;
    border-bottom: 2px solid var(--sk-cyan-tint3);
    padding-bottom: 0.5rem;
}

/* Scikit-learn style navigation sidebar - cleaner hierarchy */
.bd-sidebar-primary {
    font-size: 0.9rem;
}

.bd-sidebar-primary .toctree-l1 {
    margin-bottom: 0.8rem;
    border-bottom: none;
}

.bd-sidebar-primary .toctree-l1 > a {
    font-weight: 600;
    color: var(--sk-cyan-shade3);
    padding: 0.4rem 0.5rem;
    display: block;
    border-radius: 4px;
    background: transparent;
    transition: all 0.2s ease;
}

.bd-sidebar-primary .toctree-l1 > a:hover,
.bd-sidebar-primary .toctree-l1 > a.current {
    background-color: var(--sk-cyan-tint5);
    color: var(--sk-cyan-shade4);
    text-decoration: none;
}

/* Level 2 - Main sections (more compact) */
.bd-sidebar-primary .toctree-l2 {
    margin-left: 0.5rem;
    margin-bottom: 0.2rem;
}

.bd-sidebar-primary .toctree-l2 > a {
    font-weight: 500;
    color: var(--sk-cyan-shade2);
    padding: 0.25rem 0.5rem;
    display: block;
    font-size: 0.9em;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.bd-sidebar-primary .toctree-l2 > a:hover,
.bd-sidebar-primary .toctree-l2 > a.current {
    background-color: var(--sk-orange-tint5);
    color: var(--sk-orange-shade2);
    text-decoration: none;
}

/* Level 3+ - Make collapsible instead of hidden */
.bd-sidebar-primary .toctree-l3,
.bd-sidebar-primary .toctree-l4 {
    margin-left: 1rem;
    font-size: 0.85em;
}

.bd-sidebar-primary .toctree-l3 > a,
.bd-sidebar-primary .toctree-l4 > a {
    padding: 0.2rem 0.5rem;
    color: var(--sk-cyan-shade1);
    font-weight: 400;
}

.bd-sidebar-primary .toctree-l3 > a:hover,
.bd-sidebar-primary .toctree-l4 > a:hover {
    background-color: var(--sk-orange-tint5);
    color: var(--sk-orange-shade1);
    text-decoration: none;
}

/* Enable collapsible navigation */
.bd-sidebar-primary .toctree-wrapper {
    overflow: visible;
}

/* Style for expand/collapse indicators */
.bd-sidebar-primary .toctree-expand {
    color: var(--sk-cyan-shade2);
    cursor: pointer;
    width: 1rem;
    text-align: center;
    margin-right: 0.25rem;
}

.bd-sidebar-primary .toctree-expand:hover {
    color: var(--sk-orange-shade2);
}

/* Section Navigation header styling */
.bd-sidebar-primary h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--sk-cyan-shade4);
    margin-bottom: 1rem;
    margin-top: 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--sk-cyan-tint4);
}

/* Current page indicator */
.bd-sidebar-primary .current > a {
    background-color: var(--sk-cyan-tint4) !important;
    color: var(--sk-cyan-shade4) !important;
    font-weight: 600;
}

/* Scikit-learn inspired compact API documentation styling */

/* Compact admonitions for version info */
.rst-content div.versionadded,
.rst-content div.versionchanged,
.rst-content div.deprecated {
    margin: 0.5rem 0;
    padding: 0.3rem 0.5rem;
    font-size: 0.9em;
}

/* Compact docstring formatting */
.rst-content dd p:not(table *) {
    margin: 0.3rem 0;
}

.rst-content dd > p:first-child {
    margin-top: 0;
}

.rst-content dd > p:last-child {
    margin-bottom: 0.5rem;
}

/* Method spacing - add margin to first method to separate from docstring */
.rst-content dl.py.method:first-of-type {
    margin-top: 1rem;
}

/* Field lists (Parameters, Returns, etc.) */
.rst-content .field-list {
    margin: 0.8rem 0;
}

.rst-content .field-list .field-name {
    font-weight: 600;
    color: var(--sk-cyan-shade2);
}

.rst-content .field-list .field-body {
    margin-left: 0.5rem;
}

.rst-content .field-list .field-body p {
    margin: 0.2rem 0;
}

/* AutoAPI Parameter and return descriptions - improved layout */
.rst-content dl.field-list dd {
    margin-left: 1.5rem;
    margin-bottom: 0.4rem;
    line-height: 1.5;
}

/* Parameter name styling in AutoAPI */
.rst-content .field-name {
    font-weight: 600;
    color: var(--sk-cyan-shade3);
    font-size: 0.9em;
}

/* Parameter descriptions */
.rst-content .field-body {
    color: #495057;
}

/* AutoAPI function/method docstring container */
.rst-content .py.function .docstring,
.rst-content .py.method .docstring,
.rst-content .py.class .docstring {
    margin-top: 0.75rem;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
    border-left: 2px solid var(--sk-cyan-tint3);
    background-color: #fafbfc;
    padding: 0.75rem;
}

/* Function title styling in content */
.rst-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--sk-cyan-shade3);
    font-size: 1.4rem;
    font-weight: 600;
    border-bottom: 2px solid var(--sk-cyan-tint3);
    padding-bottom: 0.5rem;
}

/* Subsection headers (like "Functions", "Classes") */
.rst-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    color: var(--sk-orange-shade2);
    font-size: 1.2rem;
    font-weight: 500;
    border-bottom: 1px solid var(--sk-orange-tint3);
    padding-bottom: 0.3rem;
}

/* Make Methods section more prominent - target by ID */
.rst-content #methods {
    background-color: var(--sk-cyan-tint5);
    padding: 0.75rem 1rem;
    border-left: 4px solid var(--sk-cyan);
    border-bottom: 2px solid var(--sk-cyan-tint3);
    margin-bottom: 1.5rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(41, 171, 226, 0.1);
}

/* Style any h2 that comes before method definitions */
.rst-content .py.method:first-of-type {
    border-top: 3px solid var(--sk-orange);
    padding-top: 1rem;
    margin-top: 1.5rem;
}

/* Add visual separator before first method */
.rst-content dl.py.method:first-of-type::before {
    content: "Methods";
    display: block;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--sk-cyan-shade3);
    background-color: var(--sk-cyan-tint5);
    padding: 0.75rem 1rem;
    margin: 1.5rem -1rem 1rem -1rem;
    border-left: 4px solid var(--sk-cyan);
    border-bottom: 2px solid var(--sk-cyan-tint3);
    border-radius: 4px;
}

/* Hide :module: text that appears in method signatures */
.rst-content .sig .module {
    display: none;
}

/* Hide the :module: prefix text in AutoAPI generated content */
.rst-content dl.py > dt .module::before,
.rst-content dl.py > dt .module::after {
    display: none;
}

.rst-content dl.py > dt .module {
    display: none !important;
}

/* Target the module text more specifically */
.rst-content .sig-name .module,
.rst-content .sig-prename .module,
.rst-content .descname .module {
    display: none !important;
}

/* Code and literal blocks */
.rst-content code.literal {
    background-color: var(--sk-cyan-tint5);
    color: var(--sk-cyan-shade3);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.9em;
}

.rst-content pre {
    background-color: #f8f9fa;
    border: 1px solid var(--sk-cyan-tint3);
    padding: 0.75rem;
    margin: 0.8rem 0;
    overflow-x: auto;
}

/* Table styling */
.rst-content table.docutils {
    border-collapse: collapse;
    margin: 1rem 0;
}

.rst-content table.docutils th {
    background-color: var(--sk-cyan-tint4);
    color: var(--sk-cyan-shade3);
    font-weight: 600;
    padding: 0.5rem;
    border: 1px solid var(--sk-cyan-tint2);
}

.rst-content table.docutils td {
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--sk-cyan-tint3);
}

/* List styling for better readability */
.rst-content ul,
.rst-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.rst-content li {
    margin: 0.2rem 0;
}

/* Enhanced content structure visualization */
.rst-content .section {
    margin-bottom: 1.5rem;
}

/* Improve main content typography */
.rst-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
}

/* Better spacing for AutoAPI content */
.rst-content .py.function,
.rst-content .py.method,
.rst-content .py.class {
    margin-bottom: 2rem;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 1.5rem;
}

.rst-content .py.function:last-child,
.rst-content .py.method:last-child,
.rst-content .py.class:last-child {
    border-bottom: none;
}

/* Cleaner note and warning admonitions */
.rst-content .admonition {
    margin: 1rem 0;
    padding: 0.75rem;
    border-radius: 4px;
    border-left: 4px solid var(--sk-orange);
}

.rst-content .admonition.note {
    background-color: var(--sk-cyan-tint5);
    border-left-color: var(--sk-cyan);
}

.rst-content .admonition.warning {
    background-color: var(--sk-orange-tint5);
    border-left-color: var(--sk-orange);
}
