#dvMap {
    z-index: 1;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}

#bo_gmap {
    z-index: 2;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    background: #000 !important;
    opacity: 1 !important;
}

/* Apply dark/inverted color scheme to RADAR MAP - multiple approaches */
.weather-map,
.weather-map *,
#bo_gmap,
#bo_gmap * {
    filter: invert(100%) hue-rotate(180deg) brightness(100%) contrast(100%);
    opacity: 1 !important;
}

.weather-map .leaflet-container,
#bo_gmap .leaflet-container {
    background: #000 !important;
    background-color: #000 !important;
    filter: invert(100%) hue-rotate(180deg) brightness(100%) contrast(100%);
    opacity: 1 !important;
}

/* Target all images and canvas within weather map */
.weather-map img,
.weather-map canvas,
#bo_gmap img,
#bo_gmap canvas,
.weather-map .leaflet-tile,
#bo_gmap .leaflet-tile {
    filter: invert(100%) hue-rotate(180deg) brightness(100%) contrast(100%) !important;
    opacity: 1 !important;
}

.leaflet-control {
    display: none;
}

.leaflet-contextmenu {
    display: none !important;
}

.leaflet-layer,
.leaflet-control-zoom-in,
.leaflet-control-zoom-out,
.leaflet-control-attribution {
    filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

.leaflet-container {
    background: #000
}

/* Fix popup styling - counter-invert to restore normal appearance */
.leaflet-popup {
    filter: invert(100%) hue-rotate(180deg) !important;
    border-radius: 8px !important;
}

.leaflet-popup-content-wrapper {
    filter: invert(100%) hue-rotate(180deg) !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 8px !important;
}

.leaflet-popup-content {
    filter: invert(100%) hue-rotate(180deg) !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    color: #000000 !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 13px 19px !important;
}

.leaflet-popup-tip {
    filter: invert(100%) hue-rotate(180deg) !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
}

/* Ensure popup elements within bo_gmap also get proper styling */
#bo_gmap .leaflet-popup-content-wrapper,
.weather-map .leaflet-popup-content-wrapper {
    filter: invert(100%) hue-rotate(180deg) !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 8px !important;
}

#bo_gmap .leaflet-popup-content,
.weather-map .leaflet-popup-content {
    filter: invert(100%) hue-rotate(180deg) !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    color: #000000 !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
}

#bo_gmap .leaflet-popup-tip,
.weather-map .leaflet-popup-tip {
    filter: invert(100%) hue-rotate(180deg) !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
}

.leaflet-control-zoom,
.leaflet-control-attribution,
.leaflet-control-scale-line,
#ctrl_clock,
#ctrl_lmimg,
#ctrl_inf,
#ctrl_strokes,
#ctrl_pos,
#ctrl_snd,
#ctrl_st,
#ctrl_settings {
    display: none;
}

#map-select-buttons {
    z-index: 1001;
    position: relative;
    display: flex;
    gap: 0;
    margin-right: 0;
    margin-left: clamp(8px, 2vw, 16px);
    flex-shrink: 0;
}

.map-select-button,
#station-map-button,
#weather-map-button {
    font-size: clamp(11px, 2vw, 14px) !important;
    font-weight: 700 !important;
    padding: clamp(10px, 2vw, 14px) clamp(12px, 2.5vw, 18px) !important;
    min-height: clamp(44px, 8vw, 56px) !important;
    white-space: nowrap;
    height: auto;
    line-height: 1;
    border-radius: 0 !important;
    transition: all 0.3s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-select-button.active,
#station-map-button.active,
#weather-map-button.active,
.map-select-button.btn-dark,
#station-map-button.btn-dark,
#weather-map-button.btn-dark,
.map-select-button[aria-current="page"],
#station-map-button[aria-current="page"],
#weather-map-button[aria-current="page"] {
    background: rgba(150, 200, 255, 0.6) !important;
    box-shadow: 
        inset 0 1px 4px rgba(0, 150, 255, 0.3),
        inset 0 -1px 4px rgba(0, 150, 255, 0.15),
        0 0 8px rgba(0, 150, 255, 0.4),
        0 0 16px rgba(0, 150, 255, 0.25),
        0 0 24px rgba(0, 150, 255, 0.15) !important;
    border-color: rgba(100, 180, 255, 0.5) !important;
    color: #000000 !important;
    text-shadow: none !important;
}

/* Ensure weather-map-button gets the same styling when it has btn-dark */
#weather-map-button.btn-dark {
    background: rgba(150, 200, 255, 0.6) !important;
    box-shadow: 
        inset 0 1px 4px rgba(0, 150, 255, 0.3),
        inset 0 -1px 4px rgba(0, 150, 255, 0.15),
        0 0 8px rgba(0, 150, 255, 0.4),
        0 0 16px rgba(0, 150, 255, 0.25),
        0 0 24px rgba(0, 150, 255, 0.15) !important;
    border-color: rgba(100, 180, 255, 0.5) !important;
    color: #000000 !important;
    text-shadow: none !important;
}

/* Override Bootstrap btn-secondary for unselected state - dull silver */
#station-map-button.btn-secondary,
#weather-map-button.btn-secondary {
    background: rgba(180, 180, 180, 0.5) !important;
    color: #000000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    border-color: rgba(160, 160, 160, 0.4) !important;
}

#station-map-button {
    border-top-left-radius: 10px !important;
    border-bottom-left-radius: 10px !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

#weather-map-button {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: 10px !important;
    border-bottom-right-radius: 10px !important;
}

.btn {
    font-size: 10pt !important;
    font-weight: normal;
}

/* Narrow screen optimizations */
@media (max-width: 480px) {
    .map-select-button,
    #station-map-button,
    #weather-map-button {
        font-size: clamp(10px, 1.8vw, 13px) !important;
        padding: clamp(8px, 1.5vw, 12px) clamp(10px, 2vw, 16px) !important;
        min-height: clamp(40px, 7vw, 52px) !important;
    }
}

@media (max-width: 360px) {
    .map-select-button,
    #station-map-button,
    #weather-map-button {
        font-size: clamp(9px, 1.6vw, 12px) !important;
        padding: clamp(6px, 1.2vw, 10px) clamp(8px, 1.5vw, 14px) !important;
        min-height: clamp(38px, 6.5vw, 48px) !important;
    }

    #map-select-buttons {
        margin-left: clamp(4px, 1vw, 8px);
    }
}
