/* Animations and Transitions */

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* Apply animations to elements */
.hero-content {
    animation: fadeIn 1s ease-out;
}

.hero-title {
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-subtitle {
    animation: fadeInUp 1s ease-out 0.4s both;
}

.hero-description {
    animation: fadeInUp 1s ease-out 0.6s both;
}

.hero-buttons {
    animation: fadeInUp 1s ease-out 0.8s both;
}

.phone-mockup {
    animation: scaleIn 1s ease-out 0.5s both;
}

.step-card {
    animation: fadeInUp 0.8s ease-out both;
}

.step-card:nth-child(1) {
    animation-delay: 0.2s;
}

.step-card:nth-child(2) {
    animation-delay: 0.4s;
}

.step-card:nth-child(3) {
    animation-delay: 0.6s;
}

.feature-card {
    animation: fadeInUp 0.8s ease-out both;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }
.feature-card:nth-child(5) { animation-delay: 0.5s; }
.feature-card:nth-child(6) { animation-delay: 0.6s; }

.mockup-item {
    animation: scaleIn 0.8s ease-out both;
}

.mockup-item:nth-child(1) { animation-delay: 0.2s; }
.mockup-item:nth-child(2) { animation-delay: 0.4s; }
.mockup-item:nth-child(3) { animation-delay: 0.6s; }

.testimonial-card {
    animation: fadeInUp 0.8s ease-out both;
}

.testimonial-card:nth-child(1) { animation-delay: 0.2s; }
.testimonial-card:nth-child(2) { animation-delay: 0.4s; }
.testimonial-card:nth-child(3) { animation-delay: 0.6s; }

/* Floating animations */
.floating-motorcycle {
    animation: float 6s ease-in-out infinite;
}

.floating-map {
    animation: float 8s ease-in-out infinite;
    animation-delay: 2s;
}

.floating-compass {
    animation: rotate 20s linear infinite;
}

/* Hover animations */
.primary-btn:hover,
.secondary-btn:hover,
.download-btn:hover,
.cta-btn:hover {
    animation: pulse 0.3s ease-in-out;
}

.step-card:hover,
.feature-card:hover,
.testimonial-card:hover {
    animation: none;
}

/* Loading animations */
.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* Scroll-triggered animations */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.scroll-animate.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Button click animation */
.btn-click {
    animation: bounce 0.3s ease-in-out;
}

/* Navigation menu animation */
.nav-menu.active {
    animation: slideInUp 0.3s ease-out;
}

/* Mobile menu toggle animation */
.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Progress bar animation */
.progress-bar {
    animation: slideInUp 1s ease-out;
}

/* Counter animation */
.counter {
    animation: fadeInUp 0.8s ease-out;
}

/* Parallax effect */
.parallax {
    transition: transform 0.1s ease-out;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus animations for accessibility */
.primary-btn:focus,
.secondary-btn:focus,
.download-btn:focus,
.cta-btn:focus {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
}

/* Loading states */
.loading-spinner {
    animation: rotate 1s linear infinite;
}

/* Success animation */
.success-checkmark {
    animation: scaleIn 0.5s ease-out;
}

/* Error animation */
.error-shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Typing animation for hero title */
.typing-animation {
    overflow: hidden;
    border-right: 2px solid var(--primary-red);
    white-space: nowrap;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary-red); }
}

/* Gradient animation for CTA section */
.cta {
    background: linear-gradient(135deg, var(--primary-red), var(--primary-red-dark));
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Phone mockup animations */
.phone-mockup:hover {
    animation: float 2s ease-in-out infinite;
}

.app-content {
    animation: fadeIn 1s ease-out 1s both;
}

/* Route line animation */
.route-line {
    animation: drawLine 2s ease-out 1.5s both;
}

@keyframes drawLine {
    from { width: 0; }
    to { width: 80%; }
}

/* Location pin pulse */
.location-pin {
    animation: pulse 2s ease-in-out infinite;
}

/* Action buttons hover effect */
.action-btn:hover {
    animation: scaleIn 0.2s ease-out;
}

/* Feature icons rotation on hover */
.feature-icon:hover svg {
    animation: rotate 0.5s ease-out;
}

/* Testimonial cards stagger animation */
.testimonials-grid {
    animation: fadeInUp 1s ease-out 0.5s both;
}

/* Footer links hover animation */
.footer-links a:hover {
    animation: bounce 0.3s ease-in-out;
}

/* Download button special animation */
.download-btn:hover .download-icon {
    animation: bounce 0.5s ease-in-out;
}

/* Section headers animation */
.section-header {
    animation: fadeInUp 1s ease-out both;
}

/* App preview phone animation */
.preview-phone {
    animation: scaleIn 1s ease-out 0.8s both;
}

/* Stats counter animation */
.stat-value {
    animation: fadeInUp 0.8s ease-out both;
}

/* Navigation brand animation */
.nav-brand {
    animation: fadeInLeft 1s ease-out;
}

/* Mobile responsiveness animations */
@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .phone-mockup {
        margin-top: 2rem;
    }
    
    .nav-menu {
        position: fixed;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 2rem;
        box-shadow: var(--shadow);
        transform: translateY(-100%);
        transition: transform 0.3s ease;
    }
    
    .nav-menu.active {
        transform: translateY(0);
    }
    
    .nav-toggle {
        display: flex;
    }
}

/* Print styles */
@media print {
    .floating-elements,
    .nav-toggle,
    .download-btn {
        display: none;
    }
    
    * {
        animation: none !important;
        transition: none !important;
    }
} 