/*
 * Light keeps the original look (dark navbar and banners on a white page).
 * Dark keeps the same layout on a dark page.
 */

/* Theme-specific images: render both variants, show the one matching the theme */
[data-bs-theme="light"] .theme-dark-only,
[data-bs-theme="dark"] .theme-light-only {
    display: none !important;
}

/* Stop type icons are inline SVGs that follow the text color in both themes */
.stop-type-display {
    display: inline-block;
    line-height: 1;
    vertical-align: middle;
}

.stop-type-display .stop-type-icon {
    height: 24px;
    width: 24px;
    fill: currentColor;
}

/* Dark: keep the navbar and banners a touch darker than the page, with a divider */
[data-bs-theme="dark"] .navbar.bg-dark,
[data-bs-theme="dark"] .bg-dark.text-white {
    background-color: #16181b !important;
}

[data-bs-theme="dark"] .navbar.bg-dark {
    border-bottom: 1px solid var(--bs-border-color);
}

/* Dark: legacy fixed light surfaces */
[data-bs-theme="dark"] .bg-white,
[data-bs-theme="dark"] .bg-light {
    background-color: var(--bs-tertiary-bg) !important;
}

[data-bs-theme="dark"] .bg-white.text-dark,
[data-bs-theme="dark"] .bg-light.text-dark,
[data-bs-theme="dark"] .bg-white .text-dark,
[data-bs-theme="dark"] .bg-light .text-dark {
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .bg-white .btn-warning.text-dark,
[data-bs-theme="dark"] .bg-light .btn-warning.text-dark,
[data-bs-theme="dark"] .bg-white .bg-warning.text-dark,
[data-bs-theme="dark"] .bg-light .bg-warning.text-dark,
[data-bs-theme="dark"] .bg-white .bg-info.text-dark,
[data-bs-theme="dark"] .bg-light .bg-info.text-dark {
    color: #212529 !important;
}

[data-bs-theme="dark"] .card.bg-light .btn-outline-dark {
    --bs-btn-color: var(--bs-body-color);
    --bs-btn-border-color: var(--bs-secondary-color);
    --bs-btn-hover-color: var(--bs-body-bg);
    --bs-btn-hover-bg: var(--bs-body-color);
    --bs-btn-hover-border-color: var(--bs-body-color);
    --bs-btn-active-color: var(--bs-body-bg);
    --bs-btn-active-bg: var(--bs-body-color);
    --bs-btn-active-border-color: var(--bs-body-color);
    --bs-btn-disabled-color: var(--bs-secondary-color);
    --bs-btn-disabled-border-color: var(--bs-border-color);
}

/* Dark: lift uncolored cards off the page, including border-0 ones */
[data-bs-theme="dark"] .card:not([class*="bg-"]) {
    --bs-card-bg: var(--bs-tertiary-bg);
    --bs-card-border-color: rgba(255, 255, 255, .08);
    box-shadow: 0 .25rem .85rem rgba(0, 0, 0, .16);
}

[data-bs-theme="dark"] .card.border-0:not([class*="bg-"]) {
    border: 1px solid var(--bs-card-border-color) !important;
}

[data-bs-theme="dark"] .table-light {
    --bs-table-color: var(--bs-emphasis-color);
    --bs-table-bg: var(--bs-tertiary-bg);
    --bs-table-border-color: var(--bs-border-color);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.05);
    --bs-table-striped-color: var(--bs-emphasis-color);
    --bs-table-active-bg: rgba(255, 255, 255, 0.1);
    --bs-table-active-color: var(--bs-emphasis-color);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.075);
    --bs-table-hover-color: var(--bs-emphasis-color);
    color: var(--bs-table-color);
}
