/* Custom CSS for Sphinx documentation */

/* Match the Material theme colors */
:root {
    --pst-color-primary: #000000;
    --pst-color-secondary: #ffffff;
    --pst-color-link: #000000;
    --pst-color-link-hover: #444444;
}

/* Typography */
body {
    font-family: 'Calm', -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}

/* Code blocks */
pre {
    border-radius: 4px;
    background-color: #f8f8f8;
}

.highlight {
    border-radius: 4px;
}

/* Admonitions */
.admonition {
    border-radius: 4px;
    margin: 1.5em 0;
}

.admonition-title {
    font-weight: bold;
}

/* Tables */
table.docutils {
    border-collapse: collapse;
    margin: 1em 0;
    width: 100%;
}

table.docutils th, table.docutils td {
    padding: 0.5em;
    border: 1px solid #e1e4e5;
}

table.docutils th {
    background-color: #f3f6f6;
}

/* Navigation */
.toc-item {
    margin-top: 0.5em;
}

/* Horizontal Navigation Styling */
.navbar-nav.navbar-nav-scroll {
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0.5rem 0;
    align-items: center;
}

.navbar-nav.navbar-nav-scroll .nav-item {
    margin: 0 0.5rem;
}

.navbar-nav.navbar-nav-scroll .nav-link {
    padding: 0.5rem 1rem;
    white-space: nowrap;
}

/* Style for search button and theme toggle in navbar */
.navbar-header-items__center .search-button,
.navbar-header-items__center .theme-switch-button {
    margin-left: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Ensure buttons are properly sized and styled */
.navbar-header-items__center .btn {
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    background-color: transparent;
    border: none;
    color: var(--pst-color-primary);
}

.navbar-header-items__center .btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--pst-color-link-hover);
}

/* Add a separator between nav items and buttons */
.navbar-header-items__center .navbar-nav:after {
    content: "";
    display: inline-block;
    height: 24px;
    margin: 0 0.5rem;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

/* Ensure all navbar items are aligned properly */
.navbar-header-items__center {
    display: flex;
    align-items: center;
}

/* Make sure the icons are visible and properly sized */
.navbar-header-items__center .fa-lg {
    font-size: 1.25em;
    line-height: 0.75em;
    vertical-align: -0.0667em;
}

/* Ensure dropdown menus appear below their parent items */
.navbar-nav .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
}

/* Style for active navigation items */
.navbar-nav .active {
    font-weight: bold;
    border-bottom: 2px solid var(--pst-color-primary);
}

/* Adjust main content to account for horizontal navbar */
.bd-main .bd-content {
    padding-top: 1rem;
}

/* Hide sidebar completely */
.bd-sidebar-primary {
    display: none !important;
}

.sidebar-drawer {
    display: none !important;
}

/* Hide sidebar toggle buttons, checkboxes, and overlays */
.sidebar-toggle.primary-toggle {
    display: none !important;
}

#pst-primary-sidebar-checkbox {
    display: none !important;
}

.overlay.overlay-primary {
    display: none !important;
}

/* Hide sidebar header items */
.sidebar-header-items {
    display: none !important;
}

.sidebar-primary-items__start {
    display: none !important;
}

.sidebar-primary-items__end {
    display: none !important;
}

/* Ensure main content uses full width */
.bd-main {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
}

.bd-page-width {
    max-width: 100% !important;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Jupyter notebook styling */
.cell_output {
    padding: 1em;
    background-color: #f8f8f8;
    border-radius: 4px;
}

/* API documentation */
dl.py.class, dl.py.function, dl.py.method {
    padding: 1em;
    margin: 1em 0;
    border-left: 3px solid var(--pst-color-primary);
    background-color: #f8f8f8;
}

dl.py dt {
    font-weight: bold;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .sidebar-drawer {
        width: 100%;
    }
}

/* Copy button for code blocks */
button.copybtn {
    opacity: 0.5;
    transition: opacity 0.3s;
}

button.copybtn:hover {
    opacity: 1;
}

/* Improve spacing */
.section {
    margin-bottom: 2em;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

p {
    margin-bottom: 1em;
}

/* Improve links */
a {
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}