/* Route map (assets/js/route_map.js), used by the Schedule page and the BL report of the Track & Trace:
   grey = completed, green = sailing now, GLS blue = pending */

/* animated dashes on the leg being sailed */
.rm-flow {
    animation: rmFlow 1.1s linear infinite;
}

@keyframes rmFlow {
    to { stroke-dashoffset: -16; }
}

/* port pins: call number(s) + name */
.rm-port {
    position: relative;
}

.rm-pin {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(-50%, -50%);
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    box-sizing: border-box;
    border-radius: 11px;
    border: 2px solid #fff;
    color: #fff;
    font: 800 11px/18px 'Lato', Arial, sans-serif;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .35);
}

.rm-pin.rm-done { background: #7b8798; }
.rm-pin.rm-now { background: #10b981; }
.rm-pin.rm-next { background: #1589FF; }
.rm-pin.rm-ts { background: #7B5CD6; }   /* transshipment: port where the cargo changes vessel and the TS vessel's calls */

.rm-name {
    position: absolute;
    left: 14px;
    top: -8px;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .9);
    color: #0f172a;
    font: 700 11px/14px 'Lato', Arial, sans-serif;
    white-space: nowrap;
    pointer-events: none;
}

/* vessel: green dot with a pulsing ring */
.rm-ship {
    position: relative;
}

.rm-ship-dot,
.rm-ship-ring {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

.rm-ship-dot {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #10b981;
    border: 3px solid #fff;
    box-sizing: border-box;
    box-shadow: 0 4px 12px rgba(16, 185, 129, .5);
}

.rm-ship-ring {
    width: 34px;
    height: 34px;
    background: rgba(16, 185, 129, .35);
    animation: rmPulse 1.8s ease-out infinite;
}

@keyframes rmPulse {
    from { width: 34px; height: 34px; opacity: .8; }
    to { width: 78px; height: 78px; opacity: 0; }
}

/* the map keeps Leaflet's layers (z-index 400–1000) inside its own box: menus and
   side bars of the page stay above it */
.leaflet-container {
    isolation: isolate;
}

/* fleet map (renderFleet: Team and Ships pages): one tag per vessel at sea */
.rmf-ship {
    position: relative;
}

.rmf-dot {
    position: absolute;
    left: -6px;
    top: -6px;
    width: 12px;
    height: 12px;
    box-sizing: border-box;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #1589FF;
    animation: rmfPing 2.4s ease-out infinite;
}

@keyframes rmfPing {
    0% { box-shadow: 0 0 0 0 rgba(79, 168, 255, .65); }
    80%, 100% { box-shadow: 0 0 0 12px rgba(79, 168, 255, 0); }
}

.rmf-tag {
    position: absolute;
    left: 14px;
    top: 0;
    translate: 0 -50%;
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 4px 9px 5px 8px;
    border-left: 3px solid #4FA8FF;
    border-radius: 3px 8px 8px 3px;
    background: rgba(12, 30, 48, .92);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
    color: #fff;
    font-family: 'Lato', Arial, sans-serif;
    white-space: nowrap;
    pointer-events: none;
    transition: transform .2s ease;
}

.rmf-tag b {
    font-size: 12px;
    font-weight: 800;
    line-height: 15px;
    letter-spacing: .02em;
}

.rmf-tag small {
    font-size: 11px;
    line-height: 13px;
    color: #9FB5CC;
}

.rmf-compact .rmf-tag {
    padding: 2px 7px 3px 6px;
}

.rmf-compact .rmf-tag small {
    display: none;
}

.rmf-ship.is-left .rmf-tag {
    left: auto;
    right: 14px;
    border-left: 0;
    border-right: 3px solid #4FA8FF;
    border-radius: 8px 3px 3px 8px;
    text-align: right;
}

/* printed report: no pulsing ring
*/
@media print {
    .rm-ship-ring { display: none; }
}