/* =========================================================================
 * Flow-Up POST-optimization route markers
 *
 * Delivery: teal SVG teardrop + route stroke + white center + stop number.
 * Pickup: orange rounded square + number + fa-rotate (driver-app parity).
 *
 * Used by route-manager.js via L.divIcon({ className: 'route-number ...' }).
 * ========================================================================= */

.fu-route-pin {
    display: block;
    overflow: visible;
    filter: drop-shadow(0 2px 3px rgba(15, 23, 42, 0.35));
    transition: transform 0.12s ease;
    pointer-events: none;
    user-select: none;
}

.fu-route-pin--pickup {
    box-sizing: border-box;
    width: 30px;
    height: 30px;
    margin: 5px auto 0;
    border-radius: 8px;
    background: #ea580c;
    border: 2.5px solid #fdba74;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    line-height: 1;
    padding: 2px 0 1px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    filter: none;
}

.fu-route-pin--pickup .fu-route-pin__num {
    font-family: 'DM Sans', sans-serif;
    font-weight: 800;
    font-size: 11px;
    line-height: 1;
    color: #fff;
}

.fu-route-pin--pickup i {
    font-size: 8px;
    line-height: 1;
    margin-top: 1px;
    opacity: 0.95;
    color: #fff;
}

.leaflet-marker-icon:hover .fu-route-pin {
    transform: translateY(-1px) scale(1.05);
}

/* =========================================================================
 * Van endpoint markers (start / end / round-trip) — colored flow-pin-van
 * ========================================================================= */

.fu-van-endpoint {
    position: relative;
    width: 100%;
    height: 100%;
    line-height: 0;
    --driver-color: #2563EB;
}

.fu-van-endpoint .fu-van-pin {
    display: block;
    width: 100%;
    height: 100%;
}

.fu-van-endpoint__badge {
    position: absolute;
    bottom: -4px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #fff;
    color: #fff;
    font-family: 'DM Sans', inherit;
    font-weight: 800;
    font-size: 8px;
    line-height: 16px;
    text-align: center;
    border: 1.5px solid #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.35);
    z-index: 2;
    display: grid;
    place-items: center;
    pointer-events: none;
}

.fu-van-endpoint__badge i {
    font-size: 8px;
    line-height: 1;
}

.fu-van-endpoint__badge--start {
    background: #10b981;
}

.fu-van-endpoint__badge--end {
    background: #ef4444;
}

.fu-van-endpoint__badge--rt {
    background: #F59E0B;
    color: #fff;
    font-size: 7px;
    letter-spacing: 0.02em;
    min-width: 22px;
}

.leaflet-marker-icon:hover .fu-van-endpoint .fu-van-pin {
    transform: translateY(-1px) scale(1.05);
}

/* =========================================================================
 * Endpoint markers (start / end / round-trip)
 * White 36x36 disc; the role is encoded in the ring colour:
 *   - --start  -> green border 3px       + vehicle SVG
 *   - --end    -> red border 3px         + checkered flag (Font Awesome)
 *   - --rt     -> conic-gradient ring    + vehicle SVG + "A/R" pill badge
 * The disc is intentionally pure white so coloured SVGs read clean.
 * ========================================================================= */

.fu-route-endpoint {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.36);
    box-sizing: border-box;
    --endpoint-color: #10b981;
}

.fu-route-endpoint--start {
    border: 3px solid #10b981;
}

.fu-route-endpoint--end {
    border: 3px solid #ef4444;
}

.fu-route-endpoint--roundtrip {
    background: conic-gradient(#10b981 0 50%, #ef4444 50% 100%);
    border: none;
}

.fu-route-endpoint--roundtrip::before {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: #fff;
    z-index: 0;
}

.fu-route-endpoint__icon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 22px;
    height: 22px;
    transform: translate(-50%, -50%);
    z-index: 1;
    display: grid;
    place-items: center;
    line-height: 1;
}

.fu-route-endpoint__icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 1px 1px rgba(15, 23, 42, 0.2));
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.fu-route-endpoint__fa {
    color: var(--endpoint-color);
    font-size: 16px;
    line-height: 1;
}

.fu-route-endpoint__badge {
    position: absolute;
    top: -7px;
    right: -10px;
    min-width: 22px;
    padding: 2px 5px;
    border-radius: 999px;
    background: #F59E0B;
    color: #fff;
    font-family: 'DM Sans', inherit;
    font-weight: 800;
    font-size: 9px;
    line-height: 11px;
    letter-spacing: 0.02em;
    text-align: center;
    border: 1.5px solid #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.35);
    z-index: 2;
    text-transform: uppercase;
    white-space: nowrap;
}

.leaflet-marker-icon:hover .fu-route-endpoint {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.48);
}

[data-theme="dark"] .fu-route-endpoint {
    background: #F8FAFC;
}

[data-theme="dark"] .fu-route-endpoint--roundtrip::before {
    background: #F8FAFC;
}

/* Smooth dim/emphasis when one driver route is selected */
.leaflet-marker-icon {
    transition: opacity 0.15s ease;
}
