/* The map (Leaflet) rules every host needs, in one copy since 2026-11-02: they were written
   three times, in tokens.css, admin.css and agent.css. Linked by the Web host's App.razor,
   the Android app through app.css, and Admin's and Agent's App.razor. */

/* ====== LEAFLET Z-INDEX FIX ====== */
.leaflet-pane {
    z-index: 0 !important;
}
.leaflet-top,
.leaflet-bottom {
    z-index: 1 !important;
}
.leaflet-container {
    z-index: 0;
    position: relative;
}

/* ====== LEAFLET DARK MODE ======
   A dark ground behind the tiles, and the light map tiles turned dark. */
[data-theme='dark'] .leaflet-container {
    background: #2d3748;
}

[data-theme='dark'] .leaflet-tile-pane img {
    filter: invert(1) hue-rotate(180deg) brightness(0.95) contrast(0.9);
}

/* ====== PINS IN THE THEME COLOUR ======
   The pin, the "your location" dot and the radius circle take --map-pin (theme.css), so they
   follow the side and the light or dark theme, and change with it while the map is open. A
   pin a caller colours itself (the agent portal's legend) keeps its own fill. The circle's
   class wins over the stroke and fill attributes Leaflet writes on the path. */
.leaflet-pin-icon .map-pin-fill {
    fill: var(--map-pin);
}
.leaflet-interactive.map-pin-area {
    stroke: var(--map-pin);
    fill: var(--map-pin);
}

/* ====== "USE MY LOCATION" ======
   While a reading is on its way, a ring pulses out from the pin (leaflet-map.js setLocating);
   once it lands, the margin the device reported is drawn around the pin (setPosition). Both in
   --map-pin, so they follow the side and the theme like the pin. Leaflet adds no interactive
   class to the margin, so its class alone sets the colours. */
.map-locate-pulse {
    border-radius: 50%;
    pointer-events: none;
}
.map-locate-pulse::before,
.map-locate-pulse::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--map-pin);
    opacity: 0;
    animation: map-locate-pulse 1.6s ease-out infinite;
}
.map-locate-pulse::after {
    animation-delay: 0.8s;
}
@keyframes map-locate-pulse {
    0% {
        transform: scale(1);
        opacity: 0.45;
    }
    100% {
        transform: scale(6);
        opacity: 0;
    }
}
/* Reduced motion: one still ring around the pin instead of the pulse. */
@media (prefers-reduced-motion: reduce) {
    .map-locate-pulse::before {
        animation: none;
        opacity: 0.25;
        transform: scale(2.5);
    }
    .map-locate-pulse::after {
        animation: none;
    }
}
path.map-accuracy {
    stroke: var(--map-pin);
    fill: var(--map-pin);
}

/* ====== ZOOM BUTTONS PRESS ======
   Leaflet's own sheet lights the + and - buttons on hover and focus only, and tokens.css turns
   the browser's tap highlight off, so a tap on a phone showed nothing. Press gets Leaflet's
   own hover grey. */
.leaflet-bar a:active {
    background-color: #f4f4f4;
}
