/* Tuguang Logistics - Animations Stylesheet */
/* Rich, Dynamic Animations inspired by Mazda */

/* ==================== Scroll Reveal Animations ==================== */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Staggered reveal for grids */
.services-grid .service-card:nth-child(1) { transition-delay: 0.1s; }
.services-grid .service-card:nth-child(2) { transition-delay: 0.2s; }
.services-grid .service-card:nth-child(3) { transition-delay: 0.3s; }
.services-grid .service-card:nth-child(4) { transition-delay: 0.4s; }
.services-grid .service-card:nth-child(5) { transition-delay: 0.5s; }
.services-grid .service-card:nth-child(6) { transition-delay: 0.6s; }

.stats-grid .stat-card:nth-child(1) { transition-delay: 0.1s; }
.stats-grid .stat-card:nth-child(2) { transition-delay: 0.2s; }
.stats-grid .stat-card:nth-child(3) { transition-delay: 0.3s; }
.stats-grid .stat-card:nth-child(4) { transition-delay: 0.4s; }

.news-grid .news-card:nth-child(1) { transition-delay: 0.1s; }
.news-grid .news-card:nth-child(2) { transition-delay: 0.2s; }
.news-grid .news-card:nth-child(3) { transition-delay: 0.3s; }
.news-grid .news-card:nth-child(4) { transition-delay: 0.4s; }
.news-grid .news-card:nth-child(5) { transition-delay: 0.5s; }
.news-grid .news-card:nth-child(6) { transition-delay: 0.6s; }

.values-grid .value-card:nth-child(1) { transition-delay: 0.1s; }
.values-grid .value-card:nth-child(2) { transition-delay: 0.2s; }
.values-grid .value-card:nth-child(3) { transition-delay: 0.3s; }
.values-grid .value-card:nth-child(4) { transition-delay: 0.4s; }
.values-grid .value-card:nth-child(5) { transition-delay: 0.5s; }
.values-grid .value-card:nth-child(6) { transition-delay: 0.6s; }

/* ==================== Floating Animation ==================== */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.float {
    animation: float 6s ease-in-out infinite;
}

.float-slow {
    animation: float 8s ease-in-out infinite;
}

.float-fast {
    animation: float 4s ease-in-out infinite;
}

/* ==================== Pulse Animation ==================== */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ==================== Glow Animation ==================== */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 102, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 102, 255, 0.6);
    }
}

.glow {
    animation: glow 3s ease-in-out infinite;
}

/* ==================== Rotate Animation ==================== */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rotate {
    animation: rotate 20s linear infinite;
}

.rotate-slow {
    animation: rotate 30s linear infinite;
}

/* ==================== Slide Animations ==================== */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.8s ease forwards;
}

.slide-in-right {
    animation: slideInRight 0.8s ease forwards;
}

.slide-in-up {
    animation: slideInUp 0.8s ease forwards;
}

.slide-in-down {
    animation: slideInDown 0.8s ease forwards;
}

/* ==================== Bounce Animation ==================== */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-30px);
    }
    60% {
        transform: translateY(-15px);
    }
}

.bounce {
    animation: bounce 2s ease infinite;
}

/* ==================== Shake Animation ==================== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake:hover {
    animation: shake 0.5s ease;
}

/* ==================== Zoom Animation ==================== */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes zoomOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.5);
    }
}

.zoom-in {
    animation: zoomIn 0.6s ease forwards;
}

.zoom-out {
    animation: zoomOut 0.6s ease forwards;
}

/* ==================== Fade Animations ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.fade-in {
    animation: fadeIn 1s ease forwards;
}

.fade-out {
    animation: fadeOut 1s ease forwards;
}

/* ==================== Text Animations ==================== */
@keyframes textReveal {
    0% {
        clip-path: inset(0 100% 0 0);
    }
    100% {
        clip-path: inset(0 0 0 0);
    }
}

.text-reveal {
    animation: textReveal 1.5s ease forwards;
}

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.typewriter {
    overflow: hidden;
    white-space: nowrap;
    animation: typewriter 3s steps(40) forwards;
}

/* ==================== Ripple Effect ==================== */
@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

.ripple:active::after {
    animation: ripple 1s ease-out;
}

/* ==================== Loading Animation ==================== */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 102, 255, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes dotsLoading {
    0%, 20% { opacity: 0; }
    40% { opacity: 1; }
    60%, 100% { opacity: 0; }
}

.dots-loading span {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin: 0 5px;
    background: var(--primary-color);
    border-radius: 50%;
}

.dots-loading span:nth-child(1) { animation: dotsLoading 1.4s infinite 0s; }
.dots-loading span:nth-child(2) { animation: dotsLoading 1.4s infinite 0.2s; }
.dots-loading span:nth-child(3) { animation: dotsLoading 1.4s infinite 0.4s; }

/* ==================== Hover Effects ==================== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 102, 255, 0.2);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(0, 102, 255, 0.4);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* ==================== Background Animations ==================== */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animate {
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(10px, -10px);
    }
    50% {
        transform: translate(-5px, 5px);
    }
    75% {
        transform: translate(-10px, -5px);
    }
}

.particle {
    animation: particleFloat 10s ease-in-out infinite;
}

/* ==================== Counter Animation ==================== */
.counter-value {
    display: inline-block;
}

/* ==================== Parallax Effect ==================== */
.parallax {
    transform: translateZ(0);
    will-change: transform;
}

/* ==================== Loading States ==================== */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ==================== Page Transitions ==================== */
.page-transition {
    animation: fadeIn 0.5s ease;
}

/* ==================== Morphing Animation ==================== */
@keyframes morph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

.morph {
    animation: morph 8s ease-in-out infinite;
}

/* ==================== Wave Animation ==================== */
@keyframes wave {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(-25px);
    }
}

.wave {
    animation: wave 1.5s ease-in-out infinite;
}

.wave:nth-child(2) { animation-delay: 0.1s; }
.wave:nth-child(3) { animation-delay: 0.2s; }
.wave:nth-child(4) { animation-delay: 0.3s; }
.wave:nth-child(5) { animation-delay: 0.4s; }

/* ==================== Scroll Progress ==================== */
@keyframes progressBar {
    from {
        width: 0%;
    }
    to {
        width: var(--progress);
    }
}

.scroll-progress {
    height: 3px;
    background: var(--gradient-primary);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    animation: progressBar linear;
}

/* ==================== Icon Animations ==================== */
.icon-spin-hover:hover svg {
    animation: spin 1s linear infinite;
}

.icon-bounce-hover:hover svg {
    animation: bounce 0.5s ease;
}

.icon-pulse-hover:hover svg {
    animation: pulse 1s ease-in-out infinite;
}