/* Metrics Animation Styles */
.heart-rate-metric,
.pace-metric {
    position: absolute;
    left: 0;
    width: 100%;
    height: 100px;
    overflow: visible;
    pointer-events: none;
}

.heart-rate-metric {
    bottom: 15%;
}

.pace-metric {
    bottom: 25%;
}

.zigzag-path,
.curve-path {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.5;
}

.zigzag-path path,
.curve-path path {
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 5000;
    animation: drawPath 2s linear forwards;
}

.heart-icon,
.pace-icon {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0;
    animation-delay: 2s;
}

.heart-icon {
    animation: followHeartPath 15s linear infinite;
    animation-delay: 2s;
}

.pace-icon {
    animation: followPacePath 15s linear infinite;
    animation-delay: 2s;
}

.heart-icon svg,
.pace-icon svg {
    width: 24px;
    height: 24px;
    transform-origin: center center;
    overflow: visible;
    padding: 2px;
}

.heart-icon svg {
    animation: heartbeat 1s ease-in-out infinite;
}

.pace-icon svg {
    animation: bounce 2s ease-in-out infinite;
}

.metric-value {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.value-wrapper {
    display: flex;
    flex-direction: column;
    animation: slideValues 15s steps(6) infinite;
    animation-delay: 2s;
}

.value {
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
    height: 20px;
    transition: opacity 0.5s ease;
}

.unit {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    opacity: 0.8;
    letter-spacing: 0.5px;
}

.heart-icon .metric-value {
    color: #FF5252;
    text-shadow: 0 0 10px rgba(255, 82, 82, 0.3);
}

.pace-icon .metric-value {
    color: #4CAF50;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

@keyframes followHeartPath {
    0% {
        opacity: 1;
        offset-path: path('M0,50 L100,50 L150,50 L200,20 L250,80 L300,50 L400,50 L500,50 L550,50 L600,20 L650,80 L700,50 L800,50 L900,50 L950,50 L1000,20 L1050,80 L1100,50 L1200,50 L1300,50 L1350,50 L1400,20 L1450,80 L1500,50 L1600,50 L1700,50 L1750,50 L1800,20 L1850,80 L1900,50 L2000,50');
        offset-distance: 0%;
    }
    100% {
        opacity: 1;
        offset-path: path('M0,50 L100,50 L150,50 L200,20 L250,80 L300,50 L400,50 L500,50 L550,50 L600,20 L650,80 L700,50 L800,50 L900,50 L950,50 L1000,20 L1050,80 L1100,50 L1200,50 L1300,50 L1350,50 L1400,20 L1450,80 L1500,50 L1600,50 L1700,50 L1750,50 L1800,20 L1850,80 L1900,50 L2000,50');
        offset-distance: 100%;
    }
}

@keyframes followPacePath {
    0% {
        opacity: 1;
        offset-path: path('M0,50 Q500,20 1000,70 T2000,50');
        offset-distance: 0%;
    }
    100% {
        opacity: 1;
        offset-path: path('M0,50 Q500,20 1000,70 T2000,50');
        offset-distance: 100%;
    }
}

@keyframes drawPath {
    from {
        stroke-dashoffset: 5000;
    }
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    15% { transform: scale(1.15); }
    30% { transform: scale(1); }
    45% { transform: scale(1.1); }
    60% { transform: scale(1); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

@keyframes slideValues {
    0% { transform: translateY(0); }
    20% { transform: translateY(-20px); }
    40% { transform: translateY(-40px); }
    60% { transform: translateY(-60px); }
    80% { transform: translateY(-80px); }
    100% { transform: translateY(-100px); }
}
