/* ==========================================================================
   Nextzen Services - Animations
   ========================================================================== */

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

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

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

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes blob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

@keyframes bounce-in {
    0% { opacity: 0; transform: scale(0.3); }
    50% { opacity: 1; transform: scale(1.05); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

@keyframes wave {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(20deg); }
    75% { transform: rotate(-15deg); }
}

/* AOS-style scroll animations (lightweight)
   ========================================================================== */
[data-animate] {
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-animate="fade-up"] { transform: translateY(40px); }
[data-animate="fade-down"] { transform: translateY(-40px); }
[data-animate="fade-left"] { transform: translateX(-40px); }
[data-animate="fade-right"] { transform: translateX(40px); }
[data-animate="scale"] { transform: scale(0.9); }
[data-animate="rotate"] { transform: rotate(-15deg) scale(0.9); }

[data-animate].animated {
    opacity: 1;
    transform: translate(0) scale(1) rotate(0);
}

/* Staggered children animations
   ========================================================================== */
[data-stagger] > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-stagger].animated > *:nth-child(1) { transition-delay: 0.05s; }
[data-stagger].animated > *:nth-child(2) { transition-delay: 0.15s; }
[data-stagger].animated > *:nth-child(3) { transition-delay: 0.25s; }
[data-stagger].animated > *:nth-child(4) { transition-delay: 0.35s; }
[data-stagger].animated > *:nth-child(5) { transition-delay: 0.45s; }
[data-stagger].animated > *:nth-child(6) { transition-delay: 0.55s; }
[data-stagger].animated > *:nth-child(7) { transition-delay: 0.65s; }
[data-stagger].animated > *:nth-child(8) { transition-delay: 0.75s; }
[data-stagger].animated > *:nth-child(9) { transition-delay: 0.85s; }
[data-stagger].animated > *:nth-child(10) { transition-delay: 0.95s; }

[data-stagger].animated > * {
    opacity: 1;
    transform: translateY(0);
}

/* On-load animations (no scroll trigger)
   ========================================================================== */
.animate-on-load {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }

/* Animated gradient background
   ========================================================================== */
.gradient-animated {
    background: linear-gradient(135deg, #1E5BFF, #2DD4D4, #A78BFA, #1E5BFF);
    background-size: 300% 300%;
    animation: gradient-shift 8s ease infinite;
}

/* Blob backgrounds (decorative)
   ========================================================================== */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    animation: blob 12s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--color-teal);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 350px;
    height: 350px;
    background: var(--color-purple);
    bottom: -100px;
    right: -100px;
    animation-delay: 4s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: var(--color-primary);
    top: 50%;
    right: 20%;
    animation-delay: 8s;
}

/* Hover effects
   ========================================================================== */
.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.hover-glow {
    transition: all var(--transition-base);
}

.hover-glow:hover {
    box-shadow: 0 0 0 4px rgba(30, 91, 255, 0.15), var(--shadow-lg);
}

/* Icon spin on hover
   ========================================================================== */
.spin-hover {
    transition: transform var(--transition-base);
}

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

/* Tilt on hover (3D card)
   ========================================================================== */
.tilt-hover {
    transition: transform 0.4s ease;
    transform-style: preserve-3d;
}

/* Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
