/**
 * DICE Mobility - Rich Motion & Keyframe Animations
 */

/* 1. Sonar Radar Pulse for Driver Matching */
@keyframes radarPing {
  0% {
    transform: scale(0.5);
    opacity: 0.9;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    transform: scale(3.2);
    opacity: 0;
  }
}

.radar-ring {
  position: absolute;
  border-radius: 9999px;
  border: 2px solid rgba(16, 185, 129, 0.6);
  background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0) 70%);
  animation: radarPing 2.8s cubic-bezier(0.2, 0.8, 0.4, 1) infinite;
  pointer-events: none;
}
.radar-ring-1 { animation-delay: 0s; }
.radar-ring-2 { animation-delay: 0.9s; }
.radar-ring-3 { animation-delay: 1.8s; }

/* 2. Safe Arrival Beacon Neon Edge Glow (Dual Screens Sync Glow) */
@keyframes beaconEdgeBreathing {
  0%, 100% {
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4), inset 0 0 15px rgba(245, 158, 11, 0.3);
    border-color: rgba(245, 158, 11, 0.7);
  }
  50% {
    box-shadow: 0 0 35px rgba(245, 158, 11, 0.95), 0 0 60px rgba(245, 158, 11, 0.5), inset 0 0 25px rgba(245, 158, 11, 0.6);
    border-color: #F59E0B;
  }
}

.beacon-active-glow {
  animation: beaconEdgeBreathing 1.5s ease-in-out infinite !important;
}

/* 3. PIN Pop & Flip Keyframes */
@keyframes pinNumberPop {
  0% {
    transform: scale(0.7);
    opacity: 0;
  }
  70% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.pin-digit-pop {
  animation: pinNumberPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* 4. Spring Physics Bottom Sheet Transition */
.spring-sheet {
  transition: transform 0.48s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  will-change: transform, opacity;
}

.spring-sheet-enter {
  transform: translateY(100%);
  opacity: 0;
}

.spring-sheet-show {
  transform: translateY(0%);
  opacity: 1;
}

/* 5. Dynamic Island Expand/Contract */
.dynamic-island {
  transition: width 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), height 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), border-radius 0.35s ease, background 0.3s ease;
}

.dynamic-island.expanded {
  width: 92% !important;
  height: 64px !important;
  border-radius: 26px !important;
  background: rgba(10, 14, 26, 0.98) !important;
}

/* 6. Glowing Shimmer Effect */
@keyframes shimmerWave {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.shimmer-element {
  position: relative;
  overflow: hidden;
}

.shimmer-element::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  transform: translateX(-100%);
  animation: shimmerWave 2.4s infinite;
}

/* 7. Pulse Pin Marker */
@keyframes pinPulse {
  0% {
    transform: scale(1);
    opacity: 0.9;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

.dice-pin-pulse {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 9999px;
  border: 2px solid #10B981;
  animation: pinPulse 1.8s ease-out infinite;
}

/* 8. Pulse Dot */
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.animate-pulse-dot {
  animation: pulseDot 1.6s ease-in-out infinite;
}

/* 9. Incoming Ride Countdown Ring */
@keyframes countdownRing {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: 283; }
}

.countdown-svg-circle {
  stroke-dasharray: 283;
  animation: countdownRing 15s linear forwards;
}

/* 10. SOS Emergency Alert Flash */
@keyframes sosFlash {
  0%, 100% { background-color: rgba(239, 68, 68, 0.2); }
  50% { background-color: rgba(239, 68, 68, 0.45); }
}

.sos-flashing {
  animation: sosFlash 1s ease-in-out infinite;
}

/* 11. High-Visibility User GPS Location Pulse Beacon */
@keyframes userGpsPulse {
  0% { transform: scale(0.6); opacity: 0.95; }
  60% { opacity: 0.4; }
  100% { transform: scale(3.2); opacity: 0; }
}

.user-location-marker-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
}

.user-location-pulse {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  background: rgba(0, 208, 132, 0.28);
  border: 1.5px solid rgba(0, 208, 132, 0.8);
  animation: userGpsPulse 2s cubic-bezier(0.2, 0.8, 0.4, 1) infinite;
  pointer-events: none;
}

.user-location-core {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  background: #00D084;
  border: 3.5px solid #FFFFFF;
  box-shadow: 0 0 16px rgba(0, 208, 132, 0.9), 0 3px 8px rgba(0, 0, 0, 0.6);
  z-index: 2;
}

.user-location-callout {
  position: absolute;
  bottom: 42px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid #00D084;
  backdrop-filter: blur(16px);
  padding: 4px 10px;
  border-radius: 9999px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  z-index: 10;
  pointer-events: none;
}

.user-location-callout .callout-text {
  font-size: 11px;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: 0.02em;
}

/* Locate button bounce feedback */
@keyframes locateBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

.locate-active-ping {
  animation: locateBounce 0.4s ease;
}

/* 12. Emergency Alert Shake */
@keyframes iosAlertShake {
  0%, 100% { transform: scale(1) translateX(0); }
  20%, 60% { transform: scale(1.02) translateX(-4px); }
  40%, 80% { transform: scale(1.02) translateX(4px); }
}

.animate-shake {
  animation: iosAlertShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* 13. 3D Hardware Floating Levitation */
.phone-floating-left {
  animation: floatPhoneLeft 6.5s ease-in-out infinite alternate;
}
.phone-floating-right {
  animation: floatPhoneRight 7s ease-in-out infinite alternate -3s;
}
.ipad-floating {
  animation: floatIpadConsole 8s ease-in-out infinite alternate;
}

@keyframes floatPhoneLeft {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-7px) rotate(-0.3deg); }
  100% { transform: translateY(3px) rotate(0.2deg); }
}

@keyframes floatPhoneRight {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(0.3deg); }
  100% { transform: translateY(2px) rotate(-0.2deg); }
}

@keyframes floatIpadConsole {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(2px); }
}

/* 14. Dynamic Island Audio Equalizer Wave */
@keyframes waveBarMotion {
  0%, 100% { height: 4px; }
  50% { height: 14px; }
}

.wave-bar-1 { animation: waveBarMotion 0.8s ease-in-out infinite; }
.wave-bar-2 { animation: waveBarMotion 0.6s ease-in-out infinite 0.2s; }
.wave-bar-3 { animation: waveBarMotion 0.9s ease-in-out infinite 0.4s; }

/* 15. Real-time Metric Glow Pulse */
@keyframes metricGlowPing {
  0%, 100% { text-shadow: none; }
  50% { text-shadow: 0 0 16px rgba(0, 208, 132, 0.65); }
}

.metric-live-glow {
  animation: metricGlowPing 2.5s ease-in-out infinite;
}

/* 16. Staggered Entrance Slide-Up */
@keyframes springSlideUp {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.animate-spring-in {
  animation: springSlideUp 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }
.delay-4 { animation-delay: 0.32s; }

