/* mw-map.css — MwMap component styles (global, prefixed mw-map-*).
   Loaded via Assets["mw-map.css"] in App.razor. Leaflet's own base styles
   ship separately as leaflet.css. CSS isolation (.razor.css) is forbidden. */

.mw-map-container {
    width: 100%;
    /* height comes from the inline --mw-map-height style set by the component */
    height: var(--mw-map-height, 500px);
    border-radius: 8px;
    overflow: hidden;
    z-index: 0;
}

/* Leaflet wraps divIcon markers in a white box by default — strip it. */
.mw-map-marker,
.mw-map-userdot-wrap {
    background: transparent;
    border: none;
}

/* Arbitrary-size content (chips) on a zero-size icon: center the child on the point. */
.mw-map-marker-autocenter {
    width: 0;
    height: 0;
}

.mw-map-marker-autocenter > * {
    position: absolute;
    transform: translate(-50%, -50%);
}

/* Pointer chips anchor at the tip (bottom-center) instead of the center, so the exact
   spot stays clear at any zoom. */
.mw-map-marker-autocenter > .mw-map-chip-pointer {
    transform: translate(-50%, -100%);
}

.mw-map-chip-root {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

/* ─── Map chip (MwMapChip) ─────────────────────────────────────────────── */

.mw-map-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 200px;
    padding: 3px 10px 3px 3px;
    background: #fff;
    border: 2px solid var(--mw-map-chip-color, #7e57c2);
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    font-size: 13px;
    line-height: 1;
    color: #1f1f1f;
    white-space: nowrap;
}

/* Downward pin tip — its bottom vertex is the anchor point. */
.mw-map-chip-tail {
    width: 0;
    height: 0;
    margin-top: -1px;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 9px solid var(--mw-map-chip-color, #7e57c2);
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}

.mw-map-chip-avatar {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mw-map-chip-color, #7e57c2);
    color: #fff;
}

.mw-map-chip-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mw-map-chip-avatar svg {
    width: 100%;
    height: 100%;
    display: block;
}

.mw-map-chip-initials {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.mw-map-chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.mw-map-chip-status {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #43a047;
    box-shadow: 0 0 0 2px #fff;
}

/* "This is me" variant — pulsing ring around the chip. */
.mw-map-chip-me {
    border-color: #1e88e5;
    animation: mw-map-chip-pulse 2s infinite;
}

.mw-map-chip-me .mw-map-chip-avatar {
    background: #1e88e5;
}

@keyframes mw-map-chip-pulse {
    0% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(30, 136, 229, 0.5);
    }
    70% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), 0 0 0 12px rgba(30, 136, 229, 0);
    }
    100% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(30, 136, 229, 0);
    }
}

/* ─── Default teardrop pin ─────────────────────────────────────────────── */

.mw-map-pin {
    width: 30px;
    height: 30px;
    background: var(--mw-map-pin-color, #7e57c2);
    border: 2px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mw-map-pin > i {
    transform: rotate(45deg);
    color: #fff;
    font-size: 13px;
    line-height: 1;
}

.mw-map-pin > svg {
    transform: rotate(45deg);
    width: 14px;
    height: 14px;
    fill: #fff;
}

/* ─── Live user GPS dot ────────────────────────────────────────────────── */

.mw-map-userdot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #1e88e5;
    border: 3px solid #fff;
    box-shadow: 0 0 0 0 rgba(30, 136, 229, 0.5);
    animation: mw-map-pulse 2s infinite;
}

@keyframes mw-map-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(30, 136, 229, 0.5);
    }
    70% {
        box-shadow: 0 0 0 16px rgba(30, 136, 229, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(30, 136, 229, 0);
    }
}

.mw-map-accuracy {
    stroke: #1e88e5;
    stroke-opacity: 0.4;
    fill: #1e88e5;
    fill-opacity: 0.12;
}
