/**
 * Taxi Wave Animation Styles
 * Enhanced animations for the taxi riding on the wave
 */

/* Hide buttons initially */
.feature-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease, background-color 0.3s ease;
    position: relative;
    overflow: hidden;
    border-radius: 50px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        rgba(255,255,255,0) 0%, 
        rgba(255,255,255,0.2) 50%, 
        rgba(255,255,255,0) 100%
    );
    transition: left 0.5s ease;
    z-index: -1;
}

.feature-item.visible {
    opacity: 1;
    transform: translateY(0);
    background-color: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.2);
}

.feature-item.visible::before {
    left: 100%;
    transition: left 0.8s ease;
}

.feature-item:nth-child(1).visible {
    transition-delay: 0.1s;
}

.feature-item:nth-child(2).visible {
    transition-delay: 0.2s;
}

.feature-item:nth-child(3).visible {
    transition-delay: 0.3s;
}

.feature-item:nth-child(1).visible i {
    color: #ff9800;
}

.feature-item:nth-child(2).visible i {
    color: #4caf50;
}

.feature-item:nth-child(3).visible i {
    color: #2196f3;
}

.feature-item i {
    transition: transform 0.3s ease, color 0.3s ease;
}

.feature-item.visible i {
    transform: scale(1.2);
}

/* Taxi logo driving on the wave */
.taxi-on-wave {
    position: absolute;
    bottom: 130px; /* Position exactly on the wave line */
    left: -100px; /* Start from outside the visible area */
    z-index: 10; /* Increased z-index to ensure it appears above the wave */
    width: 80px;
    height: auto;
    animation: driveOnWavePath 15s linear infinite;
    filter: drop-shadow(3px 5px 2px rgba(0, 0, 0, 0.4));
    cursor: pointer;
    transition: transform 0.2s ease;
    display: block !important; /* Force display */
}

.taxi-on-wave:hover {
    transform: scale(1.1) rotate(-5deg);
}

/* Add headlight flash effect */
.taxi-headlight-flash {
    position: absolute;
    bottom: 90px;
    left: 0;
    width: 100%;
    height: 120px;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 200, 0.7) 0%, rgba(255, 255, 200, 0) 70%);
    z-index: 3;
    animation: flashFade 0.5s ease-out forwards;
    pointer-events: none;
}

@keyframes flashFade {
    0% { opacity: 0.7; }
    100% { opacity: 0; }
}

/* Pulse animation for buttons */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.4);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(234, 179, 8, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(234, 179, 8, 0);
    }
}

/* New animation that follows precisely along the red line on the wave */
@keyframes driveOnWavePath {
    /* Start */
    0% {
        left: -100px;
        bottom: 130px;
        transform: rotate(0deg);
    }
    /* First rise */
    5% {
        left: 5%;
        bottom: 132px;
        transform: rotate(2deg);
    }
    10% {
        left: 10%;
        bottom: 134px;
        transform: rotate(3deg);
    }
    15% {
        left: 15%;
        bottom: 137px;
        transform: rotate(4deg);
    }
    /* First peak */
    20% {
        left: 20%;
        bottom: 142px;
        transform: rotate(2deg);
    }
    25% {
        left: 25%;
        bottom: 146px;
        transform: rotate(0deg);
    }
    /* Descending from peak */
    30% {
        left: 30%;
        bottom: 143px;
        transform: rotate(-2deg);
    }
    35% {
        left: 35%;
        bottom: 138px;
        transform: rotate(-3deg);
    }
    40% {
        left: 40%;
        bottom: 133px;
        transform: rotate(-3deg);
    }
    /* Middle dip */
    45% {
        left: 45%;
        bottom: 130px;
        transform: rotate(-1deg);
    }
    50% {
        left: 50%;
        bottom: 129px;
        transform: rotate(0deg);
    }
    /* Second rise */
    55% {
        left: 55%;
        bottom: 132px;
        transform: rotate(2deg);
    }
    60% {
        left: 60%;
        bottom: 137px;
        transform: rotate(3deg);
    }
    /* Second peak */
    65% {
        left: 65%;
        bottom: 142px;
        transform: rotate(1deg);
    }
    70% {
        left: 70%;
        bottom: 144px;
        transform: rotate(0deg);
    }
    /* Final descent */
    75% {
        left: 75%;
        bottom: 141px;
        transform: rotate(-2deg);
    }
    80% {
        left: 80%;
        bottom: 138px;
        transform: rotate(-3deg);
    }
    85% {
        left: 85%;
        bottom: 134px;
        transform: rotate(-3deg);
    }
    90% {
        left: 90%;
        bottom: 132px;
        transform: rotate(-2deg);
    }
    95% {
        left: 95%;
        bottom: 130px;
        transform: rotate(-1deg);
    }
    /* Exit */
    100% {
        left: 110%;
        bottom: 129px;
        transform: rotate(0deg);
    }
}

/* Bouncier animation variation triggered by JS */
@keyframes driveOnWaveBouncyPath {
    /* Start */
    0% {
        left: -100px;
        bottom: 130px;
        transform: rotate(0deg) scale(1);
    }
    /* First rise */
    5% {
        left: 5%;
        bottom: 132px;
        transform: rotate(3deg) scale(1.05);
    }
    10% {
        left: 10%;
        bottom: 134px;
        transform: rotate(4deg) scale(1.1);
    }
    15% {
        left: 15%;
        bottom: 137px;
        transform: rotate(5deg) scale(1.05);
    }
    /* First peak */
    20% {
        left: 20%;
        bottom: 142px;
        transform: rotate(3deg) scale(1);
    }
    25% {
        left: 25%;
        bottom: 146px;
        transform: rotate(0deg) scale(1.05);
    }
    /* Descending from peak */
    30% {
        left: 30%;
        bottom: 143px;
        transform: rotate(-3deg) scale(1.1);
    }
    35% {
        left: 35%;
        bottom: 138px;
        transform: rotate(-4deg) scale(1.05);
    }
    40% {
        left: 40%;
        bottom: 133px;
        transform: rotate(-4deg) scale(1);
    }
    /* Middle dip */
    45% {
        left: 45%;
        bottom: 130px;
        transform: rotate(-2deg) scale(1.05);
    }
    50% {
        left: 50%;
        bottom: 129px;
        transform: rotate(0deg) scale(1.1);
    }
    /* Second rise */
    55% {
        left: 55%;
        bottom: 132px;
        transform: rotate(3deg) scale(1.05);
    }
    60% {
        left: 60%;
        bottom: 137px;
        transform: rotate(4deg) scale(1);
    }
    /* Second peak */
    65% {
        left: 65%;
        bottom: 142px;
        transform: rotate(2deg) scale(1.05);
    }
    70% {
        left: 70%;
        bottom: 144px;
        transform: rotate(0deg) scale(1.1);
    }
    /* Final descent */
    75% {
        left: 75%;
        bottom: 141px;
        transform: rotate(-3deg) scale(1.05);
    }
    80% {
        left: 80%;
        bottom: 138px;
        transform: rotate(-4deg) scale(1);
    }
    85% {
        left: 85%;
        bottom: 134px;
        transform: rotate(-4deg) scale(1.05);
    }
    90% {
        left: 90%;
        bottom: 132px;
        transform: rotate(-3deg) scale(1.1);
    }
    95% {
        left: 95%;
        bottom: 130px;
        transform: rotate(-1deg) scale(1.05);
    }
    /* Exit */
    100% {
        left: 110%;
        bottom: 129px;
        transform: rotate(0deg) scale(1);
    }
}

/* Responsive adjustments for the taxi */
@media (max-width: 768px) {
    .taxi-on-wave {
        width: 60px;
        bottom: 100px; /* Adjusted for mobile screens */
    }
    
    .taxi-headlight-flash {
        bottom: 70px;
        height: 100px;
    }
    
    @keyframes driveOnWavePath {
        /* Start */
        0% {
            left: -100px;
            bottom: 100px;
            transform: rotate(0deg);
        }
        /* First rise */
        5% {
            left: 5%;
            bottom: 102px;
            transform: rotate(2deg);
        }
        10% {
            left: 10%;
            bottom: 104px;
            transform: rotate(3deg);
        }
        15% {
            left: 15%;
            bottom: 107px;
            transform: rotate(4deg);
        }
        /* First peak */
        20% {
            left: 20%;
            bottom: 112px;
            transform: rotate(2deg);
        }
        25% {
            left: 25%;
            bottom: 116px;
            transform: rotate(0deg);
        }
        /* Descending from peak */
        30% {
            left: 30%;
            bottom: 113px;
            transform: rotate(-2deg);
        }
        35% {
            left: 35%;
            bottom: 108px;
            transform: rotate(-3deg);
        }
        40% {
            left: 40%;
            bottom: 103px;
            transform: rotate(-3deg);
        }
        /* Middle dip */
        45% {
            left: 45%;
            bottom: 100px;
            transform: rotate(-1deg);
        }
        50% {
            left: 50%;
            bottom: 99px;
            transform: rotate(0deg);
        }
        /* Second rise */
        55% {
            left: 55%;
            bottom: 102px;
            transform: rotate(2deg);
        }
        60% {
            left: 60%;
            bottom: 107px;
            transform: rotate(3deg);
        }
        /* Second peak */
        65% {
            left: 65%;
            bottom: 112px;
            transform: rotate(1deg);
        }
        70% {
            left: 70%;
            bottom: 114px;
            transform: rotate(0deg);
        }
        /* Final descent */
        75% {
            left: 75%;
            bottom: 111px;
            transform: rotate(-2deg);
        }
        80% {
            left: 80%;
            bottom: 108px;
            transform: rotate(-3deg);
        }
        85% {
            left: 85%;
            bottom: 104px;
            transform: rotate(-3deg);
        }
        90% {
            left: 90%;
            bottom: 102px;
            transform: rotate(-2deg);
        }
        95% {
            left: 95%;
            bottom: 100px;
            transform: rotate(-1deg);
        }
        /* Exit */
        100% {
            left: 110%;
            bottom: 99px;
            transform: rotate(0deg);
        }
    }
    
    @keyframes driveOnWaveBouncyPath {
        /* Start */
        0% {
            left: -100px;
            bottom: 100px;
            transform: rotate(0deg) scale(1);
        }
        /* First rise */
        5% {
            left: 5%;
            bottom: 102px;
            transform: rotate(3deg) scale(1.05);
        }
        10% {
            left: 10%;
            bottom: 104px;
            transform: rotate(4deg) scale(1.1);
        }
        15% {
            left: 15%;
            bottom: 107px;
            transform: rotate(5deg) scale(1.05);
        }
        /* First peak */
        20% {
            left: 20%;
            bottom: 112px;
            transform: rotate(3deg) scale(1);
        }
        25% {
            left: 25%;
            bottom: 116px;
            transform: rotate(0deg) scale(1.05);
        }
        /* Descending from peak */
        30% {
            left: 30%;
            bottom: 113px;
            transform: rotate(-3deg) scale(1.1);
        }
        35% {
            left: 35%;
            bottom: 108px;
            transform: rotate(-4deg) scale(1.05);
        }
        40% {
            left: 40%;
            bottom: 103px;
            transform: rotate(-4deg) scale(1);
        }
        /* Middle dip */
        45% {
            left: 45%;
            bottom: 100px;
            transform: rotate(-2deg) scale(1.05);
        }
        50% {
            left: 50%;
            bottom: 99px;
            transform: rotate(0deg) scale(1.1);
        }
        /* Second rise */
        55% {
            left: 55%;
            bottom: 102px;
            transform: rotate(3deg) scale(1.05);
        }
        60% {
            left: 60%;
            bottom: 107px;
            transform: rotate(4deg) scale(1);
        }
        /* Second peak */
        65% {
            left: 65%;
            bottom: 112px;
            transform: rotate(2deg) scale(1.05);
        }
        70% {
            left: 70%;
            bottom: 114px;
            transform: rotate(0deg) scale(1.1);
        }
        /* Final descent */
        75% {
            left: 75%;
            bottom: 111px;
            transform: rotate(-3deg) scale(1.05);
        }
        80% {
            left: 80%;
            bottom: 108px;
            transform: rotate(-4deg) scale(1);
        }
        85% {
            left: 85%;
            bottom: 104px;
            transform: rotate(-4deg) scale(1.05);
        }
        90% {
            left: 90%;
            bottom: 102px;
            transform: rotate(-3deg) scale(1.1);
        }
        95% {
            left: 95%;
            bottom: 100px;
            transform: rotate(-1deg) scale(1.05);
        }
        /* Exit */
        100% {
            left: 110%;
            bottom: 99px;
            transform: rotate(0deg) scale(1);
        }
    }
}

@media (min-width: 1200px) {
    .taxi-on-wave {
        width: 160px;
        bottom: 160px; /* Adjusted for large screens */
    }
    
    .taxi-headlight-flash {
        height: 150px;
    }
    
    @keyframes driveOnWavePath {
        /* Start */
        0% {
            left: -100px;
            bottom: 160px;
            transform: rotate(0deg);
        }
        /* First rise */
        5% {
            left: 5%;
            bottom: 162px;
            transform: rotate(2deg);
        }
        10% {
            left: 10%;
            bottom: 164px;
            transform: rotate(3deg);
        }
        15% {
            left: 15%;
            bottom: 167px;
            transform: rotate(4deg);
        }
        /* First peak */
        20% {
            left: 20%;
            bottom: 172px;
            transform: rotate(2deg);
        }
        25% {
            left: 25%;
            bottom: 176px;
            transform: rotate(0deg);
        }
        /* Descending from peak */
        30% {
            left: 30%;
            bottom: 173px;
            transform: rotate(-2deg);
        }
        35% {
            left: 35%;
            bottom: 168px;
            transform: rotate(-3deg);
        }
        40% {
            left: 40%;
            bottom: 163px;
            transform: rotate(-3deg);
        }
        /* Middle dip */
        45% {
            left: 45%;
            bottom: 160px;
            transform: rotate(-1deg);
        }
        50% {
            left: 50%;
            bottom: 159px;
            transform: rotate(0deg);
        }
        /* Second rise */
        55% {
            left: 55%;
            bottom: 162px;
            transform: rotate(2deg);
        }
        60% {
            left: 60%;
            bottom: 167px;
            transform: rotate(3deg);
        }
        /* Second peak */
        65% {
            left: 65%;
            bottom: 172px;
            transform: rotate(1deg);
        }
        70% {
            left: 70%;
            bottom: 174px;
            transform: rotate(0deg);
        }
        /* Final descent */
        75% {
            left: 75%;
            bottom: 171px;
            transform: rotate(-2deg);
        }
        80% {
            left: 80%;
            bottom: 168px;
            transform: rotate(-3deg);
        }
        85% {
            left: 85%;
            bottom: 164px;
            transform: rotate(-3deg);
        }
        90% {
            left: 90%;
            bottom: 162px;
            transform: rotate(-2deg);
        }
        95% {
            left: 95%;
            bottom: 160px;
            transform: rotate(-1deg);
        }
        /* Exit */
        100% {
            left: 110%;
            bottom: 159px;
            transform: rotate(0deg);
        }
    }
    
    @keyframes driveOnWaveBouncyPath {
        /* Start */
        0% {
            left: -100px;
            bottom: 160px;
            transform: rotate(0deg) scale(1);
        }
        /* First rise */
        5% {
            left: 5%;
            bottom: 162px;
            transform: rotate(3deg) scale(1.05);
        }
        10% {
            left: 10%;
            bottom: 164px;
            transform: rotate(4deg) scale(1.1);
        }
        15% {
            left: 15%;
            bottom: 167px;
            transform: rotate(5deg) scale(1.05);
        }
        /* First peak */
        20% {
            left: 20%;
            bottom: 172px;
            transform: rotate(3deg) scale(1);
        }
        25% {
            left: 25%;
            bottom: 176px;
            transform: rotate(0deg) scale(1.05);
        }
        /* Descending from peak */
        30% {
            left: 30%;
            bottom: 173px;
            transform: rotate(-3deg) scale(1.1);
        }
        35% {
            left: 35%;
            bottom: 168px;
            transform: rotate(-4deg) scale(1.05);
        }
        40% {
            left: 40%;
            bottom: 163px;
            transform: rotate(-4deg) scale(1);
        }
        /* Middle dip */
        45% {
            left: 45%;
            bottom: 160px;
            transform: rotate(-2deg) scale(1.05);
        }
        50% {
            left: 50%;
            bottom: 159px;
            transform: rotate(0deg) scale(1.1);
        }
        /* Second rise */
        55% {
            left: 55%;
            bottom: 162px;
            transform: rotate(3deg) scale(1.05);
        }
        60% {
            left: 60%;
            bottom: 167px;
            transform: rotate(4deg) scale(1);
        }
        /* Second peak */
        65% {
            left: 65%;
            bottom: 172px;
            transform: rotate(2deg) scale(1.05);
        }
        70% {
            left: 70%;
            bottom: 174px;
            transform: rotate(0deg) scale(1.1);
        }
        /* Final descent */
        75% {
            left: 75%;
            bottom: 171px;
            transform: rotate(-3deg) scale(1.05);
        }
        80% {
            left: 80%;
            bottom: 168px;
            transform: rotate(-4deg) scale(1);
        }
        85% {
            left: 85%;
            bottom: 164px;
            transform: rotate(-4deg) scale(1.05);
        }
        90% {
            left: 90%;
            bottom: 162px;
            transform: rotate(-3deg) scale(1.1);
        }
        95% {
            left: 95%;
            bottom: 160px;
            transform: rotate(-1deg) scale(1.05);
        }
        /* Exit */
        100% {
            left: 110%;
            bottom: 159px;
            transform: rotate(0deg) scale(1);
        }
    }
}

.wave-container svg {
    width: 100%;
    height: 150px; /* Or whatever the original height is */
    display: block;
    position: relative;
    transform: translateY(1px); /* Ensure no gap between wave and next section */
}

.wave-line {
    stroke-dasharray: 1500; /* Approximate length of the path, adjust as needed */
    stroke-dashoffset: 1500;
    animation: drawWaveLine 15s linear infinite;
}

@keyframes drawWaveLine {
    to {
        stroke-dashoffset: 0;
    }
} 