/* Theme-aware images for Sphinx Book Theme */

/* Hide dark images by default (light mode) */
.theme-image-dark {
    display: none !important;
}

.theme-image-light {
    display: block !important;
    margin: 0 auto;
}

/* Show dark images when dark mode is active */
html[data-theme="dark"] .theme-image-dark {
    display: block !important;
    margin: 0 auto;
    background: transparent !important;
}

html[data-theme="dark"] .theme-image-light {
    display: none !important;
}

/* Center images */
.theme-image-light,
.theme-image-dark {
    max-width: 100%;
    height: auto;
    background: transparent !important;
}

/* Remove underlines from badge links */
a img[src*="shields.io"],
a img[src*="img.shields.io"],
a img[alt*="badge"],
a img[alt*="Badge"] {
    border: none !important;
}

a:has(img[src*="shields.io"]),
a:has(img[src*="img.shields.io"]) {
    text-decoration: none !important;
    border-bottom: none !important;
}

/* ============================================
   Sphinx-tabs dark mode support
   ============================================ */

/* Dark mode tab styling */
html[data-theme="dark"] .sphinx-tabs-tab {
    background-color: #1a1a2e !important;
    color: #e0e0e0 !important;
    border-color: #3d3d5c !important;
}

html[data-theme="dark"] .sphinx-tabs-tab:hover {
    background-color: #2d2d44 !important;
}

html[data-theme="dark"] .sphinx-tabs-tab[aria-selected="true"] {
    background-color: #2d2d44 !important;
    color: #ffffff !important;
    border-bottom-color: #2d2d44 !important;
}

html[data-theme="dark"] .sphinx-tabs-panel {
    background-color: #1e1e2e !important;
    border-color: #3d3d5c !important;
    color: #e0e0e0 !important;
}

/* Code blocks inside tabs - dark mode */
html[data-theme="dark"] .sphinx-tabs-panel .highlight {
    background-color: #0d1117 !important;
}

html[data-theme="dark"] .sphinx-tabs-panel .highlight pre {
    background-color: #0d1117 !important;
    color: #c9d1d9 !important;
}

/* Tab container border */
html[data-theme="dark"] .sphinx-tabs {
    border-color: #3d3d5c !important;
}

/* Ensure text inside panels is visible in dark mode */
html[data-theme="dark"] .sphinx-tabs-panel p,
html[data-theme="dark"] .sphinx-tabs-panel li,
html[data-theme="dark"] .sphinx-tabs-panel code {
    color: #e0e0e0 !important;
}

/* Inline code in tabs */
html[data-theme="dark"] .sphinx-tabs-panel code.literal {
    background-color: #2d2d44 !important;
    color: #ff79c6 !important;
}
