/* Ensure content has a comfortable width with margins */
.md-grid {
    max-width: 90rem; /* Set a maximum width for the content */
    margin-left: auto;
    margin-right: auto;
    padding-left: 2rem;  /* Add left padding */
    padding-right: 2rem; /* Add right padding */
}

/* Remove cell input numbers (In [x]:) */
.jp-InputPrompt, .prompt,
.jp-OutputPrompt, .output_prompt {
    display: none !important;
}

/* Make Jupyter Notebook code cells take full width inside the column */
div.jp-Notebook, .cell {
    max-width: 100% !important;
    width: 100% !important;
}

/* Reduce Jupyter Notebook code font size to match Markdown */
.jp-CodeCell {
    font-size: 0.7rem !important; /* Reduce font size to match Markdown */
    line-height: 1.3 !important;
    width: 100%;
    background: none !important; /* Remove any extra background */
}

/* Ensure Markdown code blocks match Jupyter Notebook */
.md-typeset pre {
    border-radius: 5px; /* Rounded corners for aesthetics */
    padding: 8px; /* Reduce padding slightly */
    font-size: 0.7rem !important; /* Ensure consistency */
    line-height: 1.15 !important;
    background: none !important; /* Remove background color band */
    overflow-x: auto !important;
}

/* Ensure inline code snippets match block code */
.md-typeset code {
    font-size: 0.7rem !important;
    padding: 2px 5px;
}

/* Ensure tables are full width */
.md-typeset__table {
    width: 100% !important;
}

/* Clean up Admonition (Info Box) styling */
.md-typeset details.wiki,
.md-typeset .admonition.wiki {
    border-color: transparent;
    background-color: transparent;
}

.admonition.wiki {
    float: left;
    margin-right: 0.8rem;
    margin-top: 0;
    width: 11.7rem;
}

.admonition.wiki h1 {
    text-align: center;
    padding-top: 0.5em;
    margin-bottom: 0;
}

/* Remove unnecessary background colors */
.md-typeset pre, .jp-CodeCell {
    background: none !important;
}

/* Improve footnote readability */
.md-typeset .footnote-ref {
    font-size: 1em !important;
    font-weight: 400 !important;
}

/* Sidebar scrollbar improvements */
.md-sidebar__scrollwrap {
    scrollbar-color: transparent transparent;
}

.md-sidebar__scrollwrap:hover {
    scrollbar-color: var(--md-accent-fg-color) transparent;
}

.md-sidebar__scrollwrap::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.md-sidebar__scrollwrap::-webkit-scrollbar-thumb {
    background-color: transparent;
}

.md-sidebar__scrollwrap:hover::-webkit-scrollbar-thumb:hover {
    background-color: var(--md-accent-fg-color);
}

/* Ensure tooltip background matches theme */
:root,
[data-md-color-scheme="slate"] {
    --tooltip-bg: #31313d;
}

:root,
[data-md-color-scheme="default"] {
    --tooltip-bg: #ffffff;
}

/* Responsive adjustments for mobile devices */
@media (max-width: 768px) {
    .md-grid {
        padding-left: 0; /* Remove left padding on smaller screens */
        padding-right: 0; /* Remove right padding on smaller screens */
    }

    .admonition.wiki {
        float: none; /* Remove float on smaller screens */
        width: 100%; /* Full width on smaller screens */
        margin-right: 0; /* Remove right margin on smaller screens */
        margin-bottom: 1rem; /* Add bottom margin on smaller screens */
    }

    .admonition.wiki h1 {
        padding-top: 0.2em; /* Adjust padding for smaller screens */
    }

    .jp-CodeCell, .md-typeset pre {
        font-size: 0.7rem !important; /* Further reduce font size on smaller screens */
    }
}