/* ============================================
   LAVELA Route Map - Complete Rewrite
   ============================================ */

.lavela-route-map-section {
    font-family: 'Montserrat', sans-serif;
    overflow: hidden;
}

/* The flex container holding timeline + map */
.lavela-route-map-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 64px;
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
    user-select: none;
    position: relative;
}

/* ---- Timeline ---- */
.lavela-route-map-timeline {
    width: 70px;
    flex-shrink: 0;
    position: relative;
    /* Height is set by JS to match the SVG container */
}

.lavela-route-map-line {
    position: absolute;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #111;
}

/* end cap ticks */
.lavela-route-map-line::before,
.lavela-route-map-line::after {
    content: '';
    position: absolute;
    left: 0;
    width: 10px;
    height: 2px;
    background: #111;
}
.lavela-route-map-line::before { top: 0; }
.lavela-route-map-line::after  { bottom: 0; }

.lavela-route-map-tick {
    position: absolute;
    left: 24px;
    width: 8px;
    height: 2px;
    background: #111;
}

.lavela-route-map-tick-label {
    position: absolute;
    left: 38px;
    transform: translateY(-50%);
    font-size: 20px;
    font-weight: 600;
    color: #111;
    white-space: nowrap;
}

/* ---- Draggable Boat ---- */
.lavela-route-map-boat {
    position: absolute;
    left: -6px; /* Moved slightly left of the timeline */
    /* top is set by JS */
    width: 20px;
    height: 36px;
    transform: translate(-50%, -50%); /* centre on (left, top) */
    background: #fff;
    border: 1.5px solid #bbb;
    border-radius: 10px 10px 5px 5px;
    cursor: grab;
    z-index: 30;
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none;
    transition: box-shadow 0.15s;
    animation: boatPulse 2s infinite;
}

@keyframes boatPulse {
    0%   { box-shadow: 0 3px 8px rgba(0,0,0,0.12), 0 0 0 0 rgba(41,182,246,0.3); }
    70%  { box-shadow: 0 3px 8px rgba(0,0,0,0.12), 0 0 0 10px rgba(41,182,246,0); }
    100% { box-shadow: 0 3px 8px rgba(0,0,0,0.12), 0 0 0 0 rgba(41,182,246,0); }
}

.lavela-scroll-text {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 700;
    color: #29b6f6;
    letter-spacing: 0.15em;
    pointer-events: none;
    white-space: nowrap;
}

.lavela-route-map-boat.dragging {
    cursor: grabbing;
    box-shadow: 0 6px 16px rgba(0,0,0,0.22);
    animation: none;
}


/* inner oval */
.lavela-route-map-boat::before {
    content: '';
    display: block;
    width: 10px;
    height: 16px;
    background: #e8e6e3;
    border-radius: 5px;
    border: 1px solid #aaa;
}

/* blue connector dot */
.lavela-route-map-boat::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -5px;
    transform: translateY(-50%);
    width: 9px;
    height: 9px;
    background: #29b6f6;
    border-radius: 50%;
}

/* ---- SVG Map Area ---- */
.lavela-route-map-svg-wrap {
    flex: 1;
    position: relative;
    width: 100%;
}

/* Force correct aspect ratio via padding-bottom trick */
.lavela-route-map-svg-wrap::before {
    content: '';
    display: block;
    /* SVG viewBox: 526.35 × 941.43  → ratio = 941.43/526.35 ≈ 1.789 */
    padding-bottom: 178.9%;
}

.lavela-route-map-svg-wrap svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.lavela-route-map-svg-wrap svg path {
    fill: #87d3f0;
}

/* ---- Markers ---- */
.lavela-route-map-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 10;
    pointer-events: none;
}

.lavela-route-map-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #bdbdbd;
    flex-shrink: 0;
    transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
}

.lavela-route-map-label {
    font-size: 11px;
    font-weight: 600;
    color: #222;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    line-height: 1;
}

.lavela-route-map-label.left {
    order: -1;
}

/* Visited state */
.lavela-route-map-marker.passed .lavela-route-map-dot {
    background: #e53935;
}

/* Active state */
.lavela-route-map-marker.active .lavela-route-map-dot {
    background: #e53935;
    transform: scale(1.4);
    box-shadow: 0 0 0 5px rgba(229, 57, 53, 0.22);
    animation: rmPulse 1.4s infinite;
}

.lavela-route-map-marker.active .lavela-route-map-label {
    font-weight: 700;
}

@keyframes rmPulse {
    0%   { box-shadow: 0 0 0 0   rgba(229,57,53,0.35); }
    70%  { box-shadow: 0 0 0 9px rgba(229,57,53,0);    }
    100% { box-shadow: 0 0 0 0   rgba(229,57,53,0);    }
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
    .lavela-route-map-container {
        gap: 8px;
    }
    .lavela-route-map-timeline {
        width: 50px;
    }
    .lavela-route-map-line {
        left: 16px;
    }
    .lavela-route-map-tick {
        left: 16px;
    }
    .lavela-route-map-tick-label {
        left: 26px;
        font-size: 18px;
    }
    .lavela-route-map-boat {
        left: 16px;
    }
    .lavela-route-map-label {
        font-size: 8px;
    }
    .lavela-route-map-dot {
        width: 10px;
        height: 10px;
    }
}
