/* Toggle button for right sidebar */
.sidebar-toggle-js {
    position: fixed;
    top: 50%;
    right: 10px;
    z-index: 1000;
    background: #5A92BA;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.sidebar-toggle-js:hover {
    background: #5A92BA;
    transform: scale(1.1);
}

/* Hide RIGHT sidebar (table of contents) by default */
.bd-sidebar-secondary {
    display: none !important;
    transition: all 0.3s ease;
}

/* Show RIGHT sidebar when toggled */
.show-right-sidebar .bd-sidebar-secondary {
    display: block !important;
}

/* Keep LEFT sidebar always visible */
.bd-sidebar-primary {
    display: block !important;
}

/* Adjust main content when RIGHT sidebar is shown */
.show-right-sidebar .bd-main {
    width: calc(100% - 300px) !important; /* Account for right sidebar */
    max-width: none !important;
}

/* When RIGHT sidebar is hidden, expand main content */
.bd-main {
    width: 100% !important;
    max-width: none !important;
}

/* Override ALL width constraints when sidebar is hidden */
.bd-content,
.bd-article-container,
.bd-article {
    width: 100% !important;
    max-width: none !important;
}

/* When RIGHT sidebar is shown, adjust content width */
.show-right-sidebar .bd-content,
.show-right-sidebar .bd-article-container,
.show-right-sidebar .bd-article {
    width: calc(100% - 250px) !important;
    max-width: none !important;
}

/* Style the navigation panel logo area */
.bd-sidebar-primary .bd-sidebar {
    padding-top: 10px;
}


/* Override primary background color */
.bg-primary {
    background-color: #5A92BA !important;
}


/* Panel dark mode support */
[data-theme="dark"] .card {
    background-color: #1e1e1e !important;
    color: #ffffff !important;
}

[data-theme="dark"] .card-header {
    background-color: #2d2d2d !important;
    border-bottom: 1px solid #404040 !important;
}

[data-theme="dark"] .card a {
    color: #58a6ff !important;
}

[data-theme="dark"] .btn-outline-primary {
    color: #58a6ff !important;
    border-color: #58a6ff !important;
}

[data-theme="dark"] .btn-outline-primary:hover {
    background-color: #58a6ff !important;
    color: #1e1e1e !important;
}

[data-theme="dark"] .text-dark {
    color: #ffffff !important;
}
html[data-theme="dark"] .bd-content .panels-container {
    background-color: var(--pst-color-background);
}

html[data-theme="dark"] .bd-content .panels .card {
    background-color: var(--pst-color-surface);
    border-color: var(--pst-color-border);
}

html[data-theme="dark"] .bd-content .panels .bg-secondary {
    background-color: var(--pst-color-secondary) !important;
}

html[data-theme="dark"] .bd-content .panels .card-body {
    color: var(--pst-color-text-base);
}

html[data-theme="dark"] .bd-content .panels .btn-outline-primary {
    color: var(--pst-color-primary);
    border-color: var(--pst-color-primary);
}

html[data-theme="dark"] .bd-content .panels a {
    color: var(--pst-color-link);
}
