/*
 * Dark-mode theming for the MapLibre chrome (controls, basemap switcher, layer
 * toggle, popups) so it matches Filament's dark panel. Filament toggles the
 * `dark` class on <html>, so these rules react to the panel's theme switch with
 * no JS. The raster basemap tiles themselves stay light (a true dark basemap
 * needs a dark tile source — separate follow-up).
 */

.dark .maplibregl-ctrl-group {
    background: #1f2937; /* gray-800 */
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.dark .maplibregl-ctrl-group button {
    background-color: #1f2937;
}

.dark .maplibregl-ctrl-group button:hover {
    background-color: #374151; /* gray-700 */
}

.dark .maplibregl-ctrl-group button + button {
    border-top-color: #374151;
}

/* MapLibre's control icons are dark SVGs tuned for a light background — invert
   them to read on the dark control group. */
.dark .maplibregl-ctrl button .maplibregl-ctrl-icon {
    filter: invert(1);
}

/* Custom controls (basemap <select>, layer-toggle <label>s). */
.dark .maplibregl-ctrl-group select,
.dark .maplibregl-ctrl-group label {
    background: #1f2937;
    color: #e5e7eb; /* gray-200 */
}

/* Popups. */
.dark .maplibregl-popup-content {
    background: #1f2937;
    color: #e5e7eb;
}

.dark .maplibregl-popup-close-button {
    color: #e5e7eb;
}

.dark .maplibregl-popup-anchor-top .maplibregl-popup-tip,
.dark .maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.dark .maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
    border-bottom-color: #1f2937;
}

.dark .maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.dark .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.dark .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
    border-top-color: #1f2937;
}

.dark .maplibregl-popup-anchor-left .maplibregl-popup-tip {
    border-right-color: #1f2937;
}

.dark .maplibregl-popup-anchor-right .maplibregl-popup-tip {
    border-left-color: #1f2937;
}

/* Popup detail links: keep them legible on the dark popup background. */
.dark .maplibregl-popup-content a {
    color: #60a5fa; /* blue-400 */
}
