/* ===== ZENZ AGENCY - COMPREHENSIVE ANIMATION SYSTEM ===== */

/* Global Animation Variables */
:root {
    --animation-speed-fast: 0.3s;
    --animation-speed-normal: 0.6s;
    --anim/* Additional utility classes for enhanced animations */
.hover-shine {
    position: relative;
    overflow: hidden;
}

.hover-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.hover-shine:hover::before {
    left: 100%;
}

/* Enhanced spin animation for slower rotation */
.animate-spin-slow {
    animation: spin 8s linear infinite;
}

/* Float shape animation for geometric elements */
@keyframes float-shape {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-20px) rotate(120deg);
    }
    66% {
        transform: translateY(10px) rotate(240deg);
    }
}

.animate-float-shape {
    animation: float-shape 8s ease-in-out infinite;
}

/* Counter animation */
@keyframes counter-up {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.counter-animate {
    animation: counter-up 2s ease-out;
}

/* Enhanced glow effect */
@keyframes enhanced-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(59, 130, 246, 0.6), 0 0 60px rgba(147, 51, 234, 0.3);
    }
}

.animate-enhanced-glow {
    animation: enhanced-glow 3s ease-in-out infinite;
}

/* Stagger animation delays for multiple elements */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; };
    --animation-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --animation-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ===== SCROLL-TRIGGERED ANIMATIONS ===== */

/* Fade in from bottom */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Fade in from top */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Fade in from left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translate3d(-40px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Fade in from right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translate3d(40px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Scale in animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
    50% {
        opacity: 1;
    }
    to {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

/* Rotate in animation */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate3d(0, 0, 1, -200deg);
        transform-origin: center;
    }
    to {
        opacity: 1;
        transform: rotate3d(0, 0, 1, 0deg);
        transform-origin: center;
    }
}

/* Flip in animation */
@keyframes flipInX {
    from {
        opacity: 0;
        transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
        animation-timing-function: ease-in;
    }
    40% {
        transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
        animation-timing-function: ease-in;
    }
    60% {
        opacity: 1;
        transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
    }
    80% {
        transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px);
    }
}

/* ===== UTILITY ANIMATION CLASSES ===== */

.animate-fadeInUp {
    animation: fadeInUp var(--animation-speed-normal) var(--animation-ease) both;
}

.animate-fadeInDown {
    animation: fadeInDown var(--animation-speed-normal) var(--animation-ease) both;
}

.animate-fadeInLeft {
    animation: fadeInLeft var(--animation-speed-normal) var(--animation-ease) both;
}

.animate-fadeInRight {
    animation: fadeInRight var(--animation-speed-normal) var(--animation-ease) both;
}

.animate-scaleIn {
    animation: scaleIn var(--animation-speed-normal) var(--animation-bounce) both;
}

.animate-rotateIn {
    animation: rotateIn var(--animation-speed-slow) var(--animation-ease) both;
}

.animate-flipInX {
    animation: flipInX var(--animation-speed-slow) var(--animation-bounce) both;
}

/* Animation delays */
.animate-delay-100 { animation-delay: 0.1s; }
.animate-delay-200 { animation-delay: 0.2s; }
.animate-delay-300 { animation-delay: 0.3s; }
.animate-delay-500 { animation-delay: 0.5s; }
.animate-delay-700 { animation-delay: 0.7s; }
.animate-delay-1000 { animation-delay: 1s; }

/* ===== HOVER ANIMATIONS ===== */

/* Glow effect */
.hover-glow {
    transition: all var(--animation-speed-normal) ease;
}

.hover-glow:hover {
    filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.5));
    transform: translateY(-2px);
}

/* Scale on hover */
.hover-scale {
    transition: transform var(--animation-speed-fast) ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Bounce on hover */
.hover-bounce {
    transition: transform var(--animation-speed-fast) var(--animation-bounce);
}

.hover-bounce:hover {
    transform: translateY(-5px);
}

/* Rotate on hover */
.hover-rotate {
    transition: transform var(--animation-speed-normal) ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* Shine effect */
.hover-shine {
    position: relative;
    overflow: hidden;
}

.hover-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.hover-shine:hover::before {
    left: 100%;
}

/* ===== LOADING ANIMATIONS ===== */

/* Pulse animation */
@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
}

.animate-pulse-glow {
    animation: pulse-glow 2s infinite;
}

/* Skeleton loading */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton-loader {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s infinite;
}

/* ===== SCROLL INDICATORS ===== */

@keyframes scroll-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.scroll-indicator {
    animation: scroll-bounce 2s infinite;
}

/* ===== BACKGROUND ANIMATIONS ===== */

/* Gradient animation */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 8s ease infinite;
}

/* Floating particles */
@keyframes particle-float {
    0% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.7;
    }
    33% {
        transform: translateY(-30px) rotate(120deg);
        opacity: 1;
    }
    66% {
        transform: translateY(-60px) rotate(240deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

.particle {
    animation: particle-float 6s linear infinite;
}

/* ===== TEXT ANIMATIONS ===== */

/* Typewriter effect */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid;
    white-space: nowrap;
    animation: typewriter 3s steps(40, end), cursor-blink 0.75s step-end infinite;
}

@keyframes cursor-blink {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: black;
    }
}

/* Text reveal animation */
@keyframes text-reveal {
    0% {
        clip-path: polygon(0 0, 0 0, 0 100%, 0% 100%);
    }
    100% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

.text-reveal {
    animation: text-reveal 1s ease-out both;
}

/* ===== STAGGER ANIMATIONS ===== */

/* Stagger children animation */
.stagger-children > * {
    animation: fadeInUp 0.6s ease both;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }

/* ===== RESPONSIVE ANIMATIONS ===== */

/* Reduce animations on mobile for better performance */
@media (max-width: 768px) {
    .animate-fadeInUp,
    .animate-fadeInDown,
    .animate-fadeInLeft,
    .animate-fadeInRight {
        animation-duration: 0.4s;
    }
    
    .animate-scaleIn,
    .animate-rotateIn,
    .animate-flipInX {
        animation-duration: 0.6s;
    }
}

/* Respect user's motion preferences */
@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;
    }
    
    .animate-gradient,
    .particle,
    .scroll-indicator {
        animation: none !important;
    }
}

/* ===== INTERSECTION OBSERVER CLASSES ===== */

/* Elements start invisible and animate in when observed */
.observe-fadeInUp {
    opacity: 0;
    transform: translate3d(0, 40px, 0);
    transition: all 0.8s var(--animation-ease);
}

.observe-fadeInUp.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.observe-scaleIn {
    opacity: 0;
    transform: scale3d(0.3, 0.3, 0.3);
    transition: all 0.8s var(--animation-bounce);
}

.observe-scaleIn.is-visible {
    opacity: 1;
    transform: scale3d(1, 1, 1);
}

.observe-slideInLeft {
    opacity: 0;
    transform: translate3d(-100px, 0, 0);
    transition: all 0.8s var(--animation-ease);
}

.observe-slideInLeft.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.observe-slideInRight {
    opacity: 0;
    transform: translate3d(100px, 0, 0);
    transition: all 0.8s var(--animation-ease);
}

.observe-slideInRight.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */

/* Use transform and opacity for better performance */
.animate-optimized {
    will-change: transform, opacity;
}

/* Force hardware acceleration */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* ===== CUSTOM EASING FUNCTIONS ===== */
.ease-out-back {
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ease-out-elastic {
    animation-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.ease-out-expo {
    animation-timing-function: cubic-bezier(0.19, 1, 0.22, 1);
}