/* Bootstrap handles its components; these rules adapt the site's custom surfaces. */
.settings-menu {
    --settings-selected-bg: rgba(71, 130, 211, 0.12);
    --settings-selected-color: #2d5e9f;
    --settings-hover-bg: #f2f3f5;
}

.settings-menu .dropdown-item {
    position: relative;
    padding-inline-end: 2.5rem;
}

.settings-menu.dropdown-menu .dropdown-item:hover,
.settings-menu.dropdown-menu .dropdown-item:focus {
    background-color: var(--settings-hover-bg);
    color: var(--bs-dropdown-link-color) !important;
}

.settings-menu .dropdown-item.active,
.settings-menu .dropdown-item.active:hover,
.settings-menu .dropdown-item.active:focus {
    background-color: var(--settings-selected-bg);
    color: var(--settings-selected-color) !important;
}

/* A decorative check complements the existing accessible selection attributes. */
.settings-menu .dropdown-item.active::after {
    content: "";
    position: absolute;
    inset-inline-end: 1rem;
    top: 50%;
    width: 0.4rem;
    height: 0.7rem;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    transform: translateY(-65%) rotate(45deg);
}

.settings-menu .dropdown-item:focus-visible {
    outline: 2px solid var(--settings-selected-color);
    outline-offset: -2px;
}

[data-bs-theme="dark"] .settings-menu {
    --settings-selected-bg: rgba(71, 130, 211, 0.22);
    --settings-selected-color: #b5d5ff;
    --settings-hover-bg: #2c3440;
}

[data-bs-theme="dark"] {
    color-scheme: dark;
    --bs-body-bg: #111b28;
    --bs-body-bg-rgb: 17, 27, 40;
    --bs-body-color: #dbe5ef;
    --bs-body-color-rgb: 219, 229, 239;
    --bs-secondary-color: #a7b7c9;
    --bs-secondary-color-rgb: 167, 183, 201;
    --bs-border-color: #35465a;
    --bs-link-color: #8cbcff;
    --bs-link-hover-color: #b5d5ff;
}
[data-bs-theme="dark"] :is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) { color: #e3edf7; }
[data-bs-theme="dark"] a:not(.btn):not(.dropdown-item):not(.nav-link):not(.text-white) { color: var(--bs-link-color); }
[data-bs-theme="dark"] a:not(.btn):not(.dropdown-item):not(.nav-link):hover { color: var(--bs-link-hover-color); }
[data-bs-theme="dark"] :is(.bg-light, .bg-white, .translucent) { background-color: #1b293b !important; }
[data-bs-theme="dark"] :is(.text-dark, .text-body, .text-secondary, .text-muted) { color: var(--bs-secondary-color) !important; }
[data-bs-theme="dark"] .text-primary { color: #8cbcff !important; }
[data-bs-theme="dark"] .section-border { border-color: var(--bs-border-color); }
[data-bs-theme="dark"] :is(.border-eee, .tide-info-panel) { border-color: var(--bs-border-color); }
[data-bs-theme="dark"] :is(.header-search__control, .location-date-picker, .location-date-picker .form-control[readonly], .tide-info-panel, .fishing-predictions-dialog, .fishing-predictions-dialog__header, .fishing-predictions-dialog__footer) {
    background-color: #1b293b;
    color: var(--bs-body-color);
}
[data-bs-theme="dark"] :is(.header-search__control .form-control, .header-search__submit, .location-date-picker .form-control, .location-date-picker .btn, .tide-table td, .weather-trend__temperature, .weather-wind__speed, .weather-wave__arrow) { color: var(--bs-body-color); }
[data-bs-theme="dark"] :is(.header-search__control .form-control::placeholder, .tide-table tr.secondary-text th, .weather-trend__rain-label) { color: var(--bs-secondary-color); }
[data-bs-theme="dark"] :is(.navbar-light .navbar-brand, .navbar-light .navbar-nav .nav-link, .navbar-light .navbar-toggler) { color: var(--bs-body-color); }
[data-bs-theme="dark"] .navbar-light .navbar-nav .nav-link:hover { color: #fff; }
[data-bs-theme="dark"] .navbar-toggler-icon { background-image: var(--bs-navbar-toggler-icon-bg); }
[data-bs-theme="dark"] .btn-light {
    --bs-btn-color: #dbe5ef;
    --bs-btn-bg: #26374d;
    --bs-btn-border-color: #35465a;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #35465a;
    --bs-btn-hover-border-color: #49617c;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #35465a;
    --bs-btn-active-border-color: #49617c;
}
[data-bs-theme="dark"] .dropdown-menu { --bs-dropdown-bg: #1b293b; --bs-dropdown-link-color: #dbe5ef; --bs-dropdown-link-hover-bg: #26374d; --bs-dropdown-link-hover-color: #fff; --bs-dropdown-header-color: #a7b7c9; }
[data-bs-theme="dark"] .nav.nav-tabs .nav-link { color: #a7b7c9; }
[data-bs-theme="dark"] .nav.nav-tabs .nav-link.active { color: #e3edf7; background-color: #1b293b; border-color: #35465a #35465a #1b293b; }
[data-bs-theme="dark"] .table { --bs-table-color: #dbe5ef; --bs-table-bg: #111b28; --bs-table-border-color: #35465a; --bs-table-striped-color: #dbe5ef; --bs-table-striped-bg: #1b293b; --bs-table-hover-color: #fff; --bs-table-hover-bg: #26374d; }
[data-bs-theme="dark"] .table-secondary { --bs-table-color: #dbe5ef; --bs-table-bg: #26374d; }
[data-bs-theme="dark"] .weather-wave--has-height { background: #173a50; }
[data-bs-theme="dark"] .weather-wave__bar { background: #285e7b; }
[data-bs-theme="dark"] .weather-direction { color: #bfa6ef; }
[data-bs-theme="dark"] .tide-chart__tooltip { background: #1b293b; color: #dbe5ef; }
[data-bs-theme="dark"] .tide-chart__tooltip-time { color: #8cbcff; }
[data-bs-theme="dark"] .tide-chart svg text { fill: #a7b7c9; }
[data-bs-theme="dark"] .tide-chart svg .tide-chart__annotation { fill: #e3edf7; stroke: #111b28; }
[data-bs-theme="dark"] .tide-chart svg text[fill="#b4232d"] { fill: #ff8791; }
[data-bs-theme="dark"] .tide-chart svg line[stroke="#f5f5f5"],
[data-bs-theme="dark"] .tide-chart svg .tide-chart__day-divider { stroke: #35465a; }
[data-bs-theme="dark"] .tide-chart__day-band { fill: #111b28; }
[data-bs-theme="dark"] .tide-chart__day-band[fill="#f1f5f9"] { fill: #1b293b; }
[data-bs-theme="dark"] .flatpickr-calendar { background: #1b293b; color: #dbe5ef; box-shadow: 0 0 0 1px #35465a, 0 4px 12px #0006; }
[data-bs-theme="dark"] :is(.flatpickr-months .flatpickr-month, .flatpickr-current-month .flatpickr-monthDropdown-months, .flatpickr-weekdays, span.flatpickr-weekday, .flatpickr-day, .flatpickr-time input) { background: transparent; color: #dbe5ef; }
[data-bs-theme="dark"] :is(.flatpickr-prev-month, .flatpickr-next-month) svg { fill: #dbe5ef; }
[data-bs-theme="dark"] :is(.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay, .flatpickr-day.flatpickr-disabled) { color: #74869c; }
[data-bs-theme="dark"] .flatpickr-day:hover { background: #35465a; border-color: #35465a; }
[data-bs-theme="dark"] .flatpickr-day.selected { background: #4782d3; border-color: #4782d3; color: #fff; }
[data-bs-theme="dark"] :is(a.hover-bg, button.hover-bg):hover { color: #8cbcff !important; background: #26374d; }
[data-bs-theme="dark"] .dropdown-item:hover { color: #b5d5ff !important; }
[data-bs-theme="dark"] :is(.day-tooltip, .weather-table-shell, .weather-table .weather-table__label, .weather-day-shortcuts .weather-day-pill) { background: #1b293b; color: #dbe5ef; border-color: #35465a; }
[data-bs-theme="dark"] :is(.weather-table__dates th:not(.weather-table__label), .weather-table__date-title, .weather-table thead .weather-table__label) { background: #26374d; }
[data-bs-theme="dark"] .weather-table tbody td:nth-child(odd) { --bs-table-bg: #162233; background-color: #162233; }
[data-bs-theme="dark"] .weather-table tbody td.is-current { --bs-table-bg: #203955; background-color: #203955; }
[data-bs-theme="dark"] .weather-table__hour { background: #26374d !important; color: #dbe5ef !important; }
[data-bs-theme="dark"] .weather-table__hour.is-current { background: #203955 !important; color: #8cbcff !important; }
[data-bs-theme="dark"] :is(.weather-table th, .weather-table td, .weather-table__dates th:not(.weather-table__label) + th, .weather-table .weather-table__day-start) { border-color: #35465a; }
[data-bs-theme="dark"] :is(.weather-day-shortcuts .weather-day-pill.is-active, .weather-day-shortcuts .weather-day-pill:hover, .nav.nav-tabs.location-tabs .nav-link.active, .nav.nav-tabs.location-tabs .nav-link:hover) { background: #203955; color: #8cbcff; border-color: #35465a; }
[data-bs-theme="dark"] :is(.location-subtitle, .weather-forecast-credit, .weather-table .weather-table__unit) { color: #a7b7c9; }
[data-bs-theme="dark"] .wide-table-scroll.has-more-right::after,
[data-bs-theme="dark"] .xscroll-nav-shell.has-more-right::after,
[data-bs-theme="dark"] #topOutside.has-more-right::after { background: linear-gradient(to right, transparent, #111b28 85%); }
@media (max-width: 575.98px) {
    [data-bs-theme="dark"] .navbar-toggler .navbar-toggler-icon { background-image: none; }
}
[data-bs-theme="dark"] :is(.table-secondary, .table-secondary > th, .table-secondary > td) { background-color: #26374d; }
/* These captions set their own light-mode colors instead of inheriting body text. */
[data-bs-theme="dark"] .chart-key,
[data-bs-theme="dark"] .chart-key > h3,
[data-bs-theme="dark"] #tide-overview { color: var(--bs-body-color); }
[data-bs-theme="dark"] .tide-info-panel__icon { color: #8cbcff; border-color: #8cbcff; }
[data-bs-theme="dark"] .tide-chart svg text.tide-chart__annotation[fill="#b4232d"] {
    fill: #ff8791;
    stroke: #1b293b;
    stroke-width: 3;
    paint-order: stroke;
}
[data-bs-theme="dark"] .tide-chart svg line[stroke="#b4232d"] { stroke: #ff8791; }
[data-bs-theme="dark"] img[src*="/images/fish/"] { filter: invert(1); mix-blend-mode: screen; }
/* Today's tide/solunar row keeps its green cue on a dark surface. */
[data-bs-theme="dark"] .table-success {
    --bs-table-color: #dbe5ef;
    --bs-table-bg: #203e3c;
    --bs-table-border-color: #3c605b;
    --bs-table-striped-color: #dbe5ef;
    --bs-table-striped-bg: #264743;
    --bs-table-active-color: #fff;
    --bs-table-active-bg: #305650;
    --bs-table-hover-color: #fff;
    --bs-table-hover-bg: #2b4e49;
}
/* Brighter low-tide labels remain readable on regular and highlighted rows. */
[data-bs-theme="dark"] .text-danger { color: #f58289 !important; }
[data-bs-theme="dark"] .tide-chart__tooltip-indicator.is-low { color: #f58289; }
[data-bs-theme="dark"] .nav.nav-tabs.location-tabs .nav-link:not(.active) { color: #8e9db0; }
[data-bs-theme="dark"] .nav.nav-tabs.location-tabs .nav-link:not(.active):is(:hover, :focus-visible) { color: #b3c6de; }
/* Soften states without tide stations while preserving the map's blue and hover fills. */
[data-bs-theme="dark"] #vmap path[fill="#f4f3f0"] { fill: #445368; }
