/* XTaxi24 Animation Library - Taxi-themed animations */

/* ========================================
   KEYFRAME ANIMATIONS
   ======================================== */

/* Taxi driving across screen */
@keyframes taxiDrive {
    0% {
        transform: translateX(-100px);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateX(calc(100vw + 100px));
        opacity: 0;
    }
}

/* Taxi arriving animation */
@keyframes taxiArrive {
    0% {
        transform: translateX(-150px) scale(0.8);
        opacity: 0;
    }
    60% {
        transform: translateX(20px) scale(1.05);
        opacity: 1;
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

/* Route line drawing animation */
@keyframes drawRoute {
    0% {
        stroke-dashoffset: 1000;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

/* Pulsing availability indicator */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.7;
    }
}

/* Ripple effect for coverage area */
@keyframes ripple {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Fade in from bottom */
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade in from left */
@keyframes fadeInLeft {
    0% {
        opacity: 0;
        transform: translateX(-40px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade in from right */
@keyframes fadeInRight {
    0% {
        opacity: 0;
        transform: translateX(40px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale in */
@keyframes scaleIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Number counter animation */
@keyframes countUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bounce subtle */
@keyframes bounceSubtle {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Glow effect */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 107, 53, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 107, 53, 0.8), 0 0 30px rgba(255, 107, 53, 0.4);
    }
}

/* Shimmer effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Rotating wheel */
@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Blink indicator */
@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* Slide in from top */
@keyframes slideInTop {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Pin drop animation */
@keyframes pinDrop {
    0% {
        transform: translateY(-300px) scale(0.5);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    60% {
        transform: translateY(10px) scale(1.1);
    }
    80% {
        transform: translateY(-5px) scale(0.95);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Basic animations with delays */
.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s ease-out forwards;
    opacity: 0;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s ease-out forwards;
    opacity: 0;
}

.animate-scale-in {
    animation: scaleIn 0.6s ease-out forwards;
    opacity: 0;
}

/* Delay classes */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }

/* Taxi-specific classes */
.taxi-drive {
    animation: taxiDrive 8s linear infinite;
}

.taxi-arrive {
    animation: taxiArrive 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.pulse-icon {
    animation: pulse 2s ease-in-out infinite;
}

.ripple-effect {
    animation: ripple 2s ease-out infinite;
}

.bounce-icon {
    animation: bounceSubtle 2s ease-in-out infinite;
}

.glow-cta {
    animation: glow 2s ease-in-out infinite;
}

.rotate-wheel {
    animation: rotate 2s linear infinite;
}

.blink-indicator {
    animation: blink 1.5s ease-in-out infinite;
}

.pin-drop {
    animation: pinDrop 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ========================================
   SCROLL-TRIGGERED ANIMATIONS
   ======================================== */

/* Elements hidden until scrolled into view */
.scroll-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* ========================================
   ROUTE LINE ANIMATION
   ======================================== */

.route-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

.route-line.animate {
    animation: drawRoute 2s ease-out forwards;
}

/* ========================================
   HOVER EFFECTS
   ======================================== */

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.6);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* ========================================
   LOADING ANIMATIONS
   ======================================== */

.spinner {
    animation: rotate 1s linear infinite;
}

.shimmer-bg {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ========================================
   COUNTER ANIMATION
   ======================================== */

.counter {
    animation: countUp 0.6s ease-out forwards;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
    /* Reduce motion on mobile for performance */
    .taxi-drive {
        animation-duration: 6s;
    }
    
    .scroll-reveal,
    .scroll-reveal-left,
    .scroll-reveal-right,
    .scroll-reveal-scale {
        transform: none;
        opacity: 0.95;
    }
    
    .scroll-reveal.revealed,
    .scroll-reveal-left.revealed,
    .scroll-reveal-right.revealed,
    .scroll-reveal-scale.revealed {
        opacity: 1;
    }
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .taxi-drive,
    .pulse-icon,
    .ripple-effect,
    .bounce-icon,
    .glow-cta,
    .rotate-wheel,
    .blink-indicator {
        animation: none;
    }
}

/* ========================================
   TAXI ICON SVG (for use in HTML)
   ======================================== */

/* Use this markup for animated taxi:
<svg class="taxi-icon" viewBox="0 0 100 50">
    <rect x="10" y="20" width="50" height="20" rx="3" fill="#FFD700"/>
    <rect x="20" y="10" width="30" height="15" rx="2" fill="#FFD700"/>
    <circle cx="20" cy="42" r="5" fill="#333" class="wheel-left"/>
    <circle cx="50" cy="42" r="5" fill="#333" class="wheel-right"/>
    <rect x="25" y="12" width="8" height="8" rx="1" fill="#87CEEB"/>
    <rect x="37" y="12" width="8" height="8" rx="1" fill="#87CEEB"/>
</svg>

Add class "rotate-wheel" to circles for spinning wheels
*/

/* ========================================
   LOCATION PIN SVG
   ======================================== */

/* Use this markup for animated location pin:
<svg class="pin-icon pin-drop" viewBox="0 0 24 24">
    <path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z" 
          fill="#FF6B35"/>
    <circle cx="12" cy="9" r="2.5" fill="white"/>
</svg>
*/
