/* VO2 event route explorer */
.vo2-route-explorer {
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(145deg, #1a1f2b 0%, #2d3748 100%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    color: #fff;
    margin-bottom: 1.25rem;
}

.vo2-route-explorer--loading [data-route-map] {
    visibility: hidden;
}

.vo2-route-explorer__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.15rem 0.5rem;
}

.vo2-route-explorer__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.vo2-route-explorer__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.vo2-route-badge {
    background: rgba(231, 16, 104, 0.2);
    border: 1px solid rgba(231, 16, 104, 0.45);
    color: #ffb8d9;
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.vo2-route-explorer__map-wrap {
    position: relative;
    direction: ltr;
}

.vo2-route-map-loader {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    background: rgba(26, 31, 43, 0.92);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
}

.vo2-route-map-loader[hidden] {
    display: none !important;
}

.vo2-route-map-loader__spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: #e71068;
    border-radius: 50%;
    animation: vo2-route-spin 0.85s linear infinite;
}

@keyframes vo2-route-spin {
    to {
        transform: rotate(360deg);
    }
}

.vo2-route-explorer [data-route-map] {
    height: min(52vh, 420px);
    min-height: 280px;
    width: 100%;
}

.vo2-route-explorer .maplibregl-map {
    background: #cbd5e0;
    font-family: inherit;
}

.vo2-route-explorer .maplibregl-ctrl-group {
    border-radius: 8px;
    overflow: hidden;
}

.vo2-route-explorer__controls {
    padding: 0.85rem 1.15rem 1.15rem;
    direction: rtl;
}

.vo2-route-scrubber {
    margin-bottom: 0.75rem;
}

.vo2-route-scrubber__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.82);
}

.vo2-route-scrubber__edge {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.vo2-route-km-value {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    color: #ffb8d9;
    font-size: 0.85rem;
    text-align: center;
}

.vo2-route-km-value [data-route-km-label] {
    color: #e71068;
}

.vo2-route-ele-value {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 0.1rem;
}

.vo2-route-ele-value:not([hidden])::before {
    content: '↑ ';
    opacity: 0.7;
}

.vo2-route-slider {
    width: 100%;
    accent-color: #e71068;
    height: 8px;
    direction: ltr;
}

.vo2-route-elevation__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.85);
}

.vo2-route-elevation__stats {
    font-variant-numeric: tabular-nums;
    color: #ffb8d9;
}

.vo2-route-elevation__hint {
    margin: 0.35rem 0 0;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.5;
}

.vo2-route-profile {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 56px;
    margin-bottom: 0.85rem;
    padding: 0 2px;
    direction: ltr;
}

.vo2-route-profile--elevation {
    display: block;
    height: auto;
    min-height: 112px;
    padding: 0;
    margin-bottom: 0.85rem;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.vo2-route-profile__chart-wrap {
    position: relative;
    width: 100%;
    height: 112px;
    cursor: crosshair;
    touch-action: none;
}

.vo2-route-profile__canvas {
    display: block;
    width: 100%;
    height: 112px;
}

.vo2-route-profile__canvas--cursor {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.vo2-route-profile--grade {
    display: flex;
    height: 56px;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    padding: 0 2px;
}

.vo2-route-profile__segment {
    flex: 1;
    min-width: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    gap: 2px;
}

.vo2-route-profile__bar {
    width: 100%;
    min-height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px 2px 0 0;
    transition: background 0.15s ease, transform 0.15s ease;
}

.vo2-route-profile__bar.is-active,
.vo2-route-profile__segment.is-active .vo2-route-profile__bar {
    background: linear-gradient(180deg, #ff6eb4 0%, #e71068 100%);
    transform: scaleY(1.02);
}

.vo2-route-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.vo2-route-actions__end {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-inline-start: auto;
}

.vo2-route-actions .nm-btn,
.vo2-route-actions .btn {
    font-size: 0.8rem;
}

.vo2-route-actions [data-route-3d].is-active {
    background: #e71068 !important;
    border-color: #e71068 !important;
    color: #fff !important;
}

.vo2-route-actions [data-route-share].is-copied {
    background: #16a34a !important;
    border-color: #16a34a !important;
}

.vo2-route-pin {
    pointer-events: none;
}

.vo2-route-pin span {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.vo2-route-pin--start span {
    background: #16a34a;
}

.vo2-route-pin--finish span {
    background: #e71068;
}

.vo2-route-rider {
    pointer-events: none;
}

.vo2-route-rider__dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #e71068;
    box-shadow: 0 0 0 4px rgba(231, 16, 104, 0.35);
    animation: vo2-rider-pulse 1.2s ease-in-out infinite;
}

@keyframes vo2-rider-pulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

.vo2-route-teaser {
    margin-top: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(231, 16, 104, 0.35);
    text-align: center;
}

.vo2-route-teaser__svg {
    width: 100%;
    max-width: 200px;
    height: 72px;
    display: block;
    margin: 0 auto 0.35rem;
}

.vo2-route-teaser__line {
    fill: none;
    stroke: url(#vo2RouteGrad);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 6px rgba(231, 16, 104, 0.6));
}

.vo2-route-teaser__meta {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0.45rem;
}

.vo2-route-explorer--error [data-route-error] {
    padding: 2rem;
    text-align: center;
    color: #fca5a5;
}
