/* Velocity and Agility Visual Elements */

/* Speed Lines Animation */
.speed-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.6;
}

.speed-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #667eea 50%, transparent 100%);
    animation: speedRush 2s linear infinite;
}

.speed-line:nth-child(1) { top: 20%; width: 200px; animation-delay: 0s; }
.speed-line:nth-child(2) { top: 40%; width: 150px; animation-delay: 0.3s; }
.speed-line:nth-child(3) { top: 60%; width: 180px; animation-delay: 0.6s; }
.speed-line:nth-child(4) { top: 80%; width: 120px; animation-delay: 0.9s; }

@keyframes speedRush {
    0% { 
        transform: translateX(-100%); 
        opacity: 0; 
    }
    10% { 
        opacity: 1; 
    }
    90% { 
        opacity: 1; 
    }
    100% { 
        transform: translateX(calc(100vw + 100px)); 
        opacity: 0; 
    }
}

/* Velocity Arrows */
.velocity-arrows {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.velocity-arrow {
    width: 0;
    height: 0;
    border-left: 15px solid #667eea;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    animation: arrowPulse 1.5s ease-in-out infinite;
}

.velocity-arrow:nth-child(1) { animation-delay: 0s; }
.velocity-arrow:nth-child(2) { animation-delay: 0.2s; }
.velocity-arrow:nth-child(3) { animation-delay: 0.4s; }

@keyframes arrowPulse {
    0%, 100% { 
        opacity: 0.3; 
        transform: scale(1); 
    }
    50% { 
        opacity: 1; 
        transform: scale(1.2); 
    }
}

/* Agility Spiral */
.agility-spiral {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 80px;
    height: 80px;
}

.spiral-element {
    position: absolute;
    border: 2px solid #764ba2;
    border-radius: 50%;
    animation: spiralRotate 3s linear infinite;
}

.spiral-element:nth-child(1) {
    width: 20px;
    height: 20px;
    top: 30px;
    left: 30px;
    animation-duration: 2s;
}

.spiral-element:nth-child(2) {
    width: 40px;
    height: 40px;
    top: 20px;
    left: 20px;
    animation-duration: 3s;
    animation-direction: reverse;
}

.spiral-element:nth-child(3) {
    width: 60px;
    height: 60px;
    top: 10px;
    left: 10px;
    animation-duration: 4s;
}

@keyframes spiralRotate {
    0% { transform: rotate(0deg) scale(1); opacity: 0.7; }
    50% { transform: rotate(180deg) scale(1.1); opacity: 1; }
    100% { transform: rotate(360deg) scale(1); opacity: 0.7; }
}

/* Dynamic Progress Bars */
.velocity-meter {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.velocity-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #00ff88 100%);
    border-radius: 4px;
    animation: velocityFill 3s ease-in-out infinite;
    position: relative;
}

.velocity-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.8) 100%);
    animation: velocityGlow 1s ease-in-out infinite;
}

@keyframes velocityFill {
    0% { width: 20%; }
    50% { width: 95%; }
    100% { width: 20%; }
}

@keyframes velocityGlow {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Agility Particles */
.agility-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.agility-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #00ff88;
    border-radius: 50%;
    animation: particleAgility 4s ease-in-out infinite;
}

.agility-particle:nth-child(1) {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.agility-particle:nth-child(2) {
    top: 30%;
    left: 80%;
    animation-delay: 1s;
}

.agility-particle:nth-child(3) {
    top: 70%;
    left: 20%;
    animation-delay: 2s;
}

.agility-particle:nth-child(4) {
    top: 90%;
    left: 70%;
    animation-delay: 3s;
}

@keyframes particleAgility {
    0% { 
        transform: translate(0, 0) scale(0.5); 
        opacity: 0; 
    }
    25% { 
        transform: translate(50px, -30px) scale(1); 
        opacity: 1; 
    }
    50% { 
        transform: translate(-20px, -60px) scale(1.2); 
        opacity: 0.8; 
    }
    75% { 
        transform: translate(30px, -90px) scale(0.8); 
        opacity: 0.6; 
    }
    100% { 
        transform: translate(0, -120px) scale(0); 
        opacity: 0; 
    }
}

/* Lightning Bolt Effect */
.lightning-bolt {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 40px;
    opacity: 0;
    animation: lightningStrike 4s ease-in-out infinite;
}

.lightning-bolt::before {
    content: '⚡';
    font-size: 30px;
    color: #ffaa00;
    text-shadow: 0 0 10px #ffaa00;
    animation: lightningGlow 0.1s ease-in-out infinite alternate;
}

@keyframes lightningStrike {
    0%, 90% { opacity: 0; }
    91%, 93% { opacity: 1; }
    94%, 96% { opacity: 0; }
    97%, 99% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes lightningGlow {
    0% { text-shadow: 0 0 10px #ffaa00; }
    100% { text-shadow: 0 0 20px #ffaa00, 0 0 30px #ffaa00; }
}

/* Rapid Pulse Indicators */
.rapid-pulse {
    position: relative;
    display: inline-block;
}

.rapid-pulse::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 2px solid #667eea;
    border-radius: inherit;
    animation: rapidPulse 1s ease-in-out infinite;
}

.rapid-pulse::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 1px solid #764ba2;
    border-radius: inherit;
    animation: rapidPulse 1s ease-in-out infinite 0.5s;
}

@keyframes rapidPulse {
    0% { 
        opacity: 1; 
        transform: scale(1); 
    }
    100% { 
        opacity: 0; 
        transform: scale(1.3); 
    }
}

/* Velocity Streaks */
.velocity-streaks {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.velocity-streak {
    position: absolute;
    width: 100px;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(102, 126, 234, 0.8) 30%, 
        rgba(118, 75, 162, 0.8) 70%, 
        transparent 100%);
    animation: streakMove 1.5s linear infinite;
}

.velocity-streak:nth-child(1) { 
    top: 25%; 
    animation-delay: 0s; 
    animation-duration: 1.2s;
}
.velocity-streak:nth-child(2) { 
    top: 45%; 
    animation-delay: 0.3s; 
    animation-duration: 1.8s;
}
.velocity-streak:nth-child(3) { 
    top: 65%; 
    animation-delay: 0.6s; 
    animation-duration: 1.4s;
}

@keyframes streakMove {
    0% { 
        transform: translateX(-120px) scaleX(0.5); 
        opacity: 0; 
    }
    10% { 
        opacity: 1; 
        transform: scaleX(1);
    }
    90% { 
        opacity: 1; 
    }
    100% { 
        transform: translateX(calc(100vw + 120px)) scaleX(0.5); 
        opacity: 0; 
    }
}

/* Agility Indicator */
.agility-indicator {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 25px;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.agility-dot {
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    animation: agilityBlink 0.8s ease-in-out infinite;
}

.agility-dot:nth-child(1) { animation-delay: 0s; }
.agility-dot:nth-child(2) { animation-delay: 0.2s; }
.agility-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes agilityBlink {
    0%, 100% { 
        opacity: 0.3; 
        transform: scale(0.8); 
    }
    50% { 
        opacity: 1; 
        transform: scale(1.2); 
    }
}

/* Speed Gauge */
.speed-gauge {
    position: relative;
    width: 100px;
    height: 50px;
    border: 3px solid #667eea;
    border-bottom: none;
    border-radius: 100px 100px 0 0;
    margin: 20px auto;
}

.speed-needle {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 2px;
    height: 40px;
    background: #ff0066;
    transform-origin: bottom center;
    animation: speedGauge 3s ease-in-out infinite;
}

.speed-needle::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: -3px;
    width: 8px;
    height: 8px;
    background: #ff0066;
    border-radius: 50%;
}

@keyframes speedGauge {
    0% { transform: translateX(-50%) rotate(-45deg); }
    50% { transform: translateX(-50%) rotate(45deg); }
    100% { transform: translateX(-50%) rotate(-45deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .velocity-arrows {
        right: 10px;
    }
    
    .agility-spiral {
        width: 60px;
        height: 60px;
    }
    
    .spiral-element:nth-child(1) {
        width: 15px;
        height: 15px;
        top: 22px;
        left: 22px;
    }
    
    .spiral-element:nth-child(2) {
        width: 30px;
        height: 30px;
        top: 15px;
        left: 15px;
    }
    
    .spiral-element:nth-child(3) {
        width: 45px;
        height: 45px;
        top: 7px;
        left: 7px;
    }
    
    .speed-line {
        width: 100px !important;
    }
    
    .lightning-bolt::before {
        font-size: 20px;
    }
}

/* Performance Optimizations */
.speed-lines,
.velocity-streaks,
.agility-particles {
    will-change: transform;
    backface-visibility: hidden;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .speed-line,
    .velocity-arrow,
    .spiral-element,
    .velocity-fill,
    .agility-particle,
    .lightning-bolt,
    .rapid-pulse::before,
    .rapid-pulse::after,
    .velocity-streak,
    .agility-dot,
    .speed-needle {
        animation: none;
    }
    
    .velocity-fill {
        width: 80%;
    }
    
    .agility-dot {
        opacity: 1;
    }
}
