/* Allied World Delivery Services - Background Animations */

/* Animation Container */
.animation-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
    opacity: 0.2;
}

/* Ensure content is above animations */
header,
main,
footer,
.hero {
    position: relative;
    z-index: 10;
}

/* Airplane Animations */
.airplane {
    position: absolute;
    width: 120px;
    height: 60px;
    animation: flyAcross 25s linear infinite;
}

.airplane-1 {
    top: 15%;
    animation-delay: 0s;
}

.airplane-2 {
    top: 25%;
    animation-delay: 8s;
}

.airplane-3 {
    top: 35%;
    animation-delay: 16s;
}

@keyframes flyAcross {
    0% {
        transform: translateX(100vw) rotate(-5deg);
    }
    100% {
        transform: translateX(-150px) rotate(-5deg);
    }
}

/* Truck Animations */
.truck {
    position: absolute;
    width: 100px;
    height: 60px;
    bottom: 15%;
    animation: driveTruck 20s linear infinite;
}

.truck-1 {
    animation-delay: 0s;
    bottom: 15%;
}

.truck-2 {
    animation-delay: 10s;
    bottom: 20%;
}

.truck-3 {
    animation-delay: 15s;
    bottom: 25%;
}

@keyframes driveTruck {
    0% {
        transform: translateX(-150px);
    }
    100% {
        transform: translateX(100vw);
    }
}

/* Ship Animations */
.ship {
    position: absolute;
    width: 140px;
    height: 80px;
    animation: sailShip 35s linear infinite, bobShip 3s ease-in-out infinite;
}

.ship-1 {
    top: 45%;
    animation-delay: 0s;
}

.ship-2 {
    top: 55%;
    animation-delay: 18s;
}

@keyframes sailShip {
    0% {
        transform: translateX(-150px);
    }
    100% {
        transform: translateX(100vw);
    }
}

@keyframes bobShip {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Delivery Worker Animations */
.delivery-worker {
    position: absolute;
    width: 50px;
    height: 70px;
    animation: walkWorker 15s linear infinite;
}

.worker-1 {
    top: 60%;
    animation-delay: 0s;
}

.worker-2 {
    top: 65%;
    animation-delay: 7s;
}

.worker-3 {
    top: 70%;
    animation-delay: 12s;
}

@keyframes walkWorker {
    0% {
        transform: translateX(-80px);
    }
    100% {
        transform: translateX(100vw);
    }
}

/* Performance Optimization */
.airplane,
.truck,
.ship,
.delivery-worker {
    will-change: transform;
    backface-visibility: hidden;
}

/* Accessibility - Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .animation-container {
        display: none;
    }
}

/* Mobile Optimization - Reduce number of animations on smaller screens */
@media (max-width: 768px) {
    .airplane-2,
    .airplane-3,
    .truck-3,
    .ship-2,
    .worker-2,
    .worker-3 {
        display: none;
    }

    .animation-container {
        opacity: 0.15;
    }
}

@media (max-width: 480px) {
    .airplane {
        width: 80px;
        height: 40px;
    }

    .truck {
        width: 70px;
        height: 45px;
    }

    .ship {
        width: 100px;
        height: 60px;
    }

    .delivery-worker {
        width: 40px;
        height: 55px;
    }
}
