/* Animation Classes */
.animate-fade-in {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

.animate-fade-in-delay {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease 0.2s forwards;
}

.animate-fade-in-delay-2 {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease 0.4s forwards;
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Keyframe Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    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 scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Floating Animation for Hero Elements */
.floating-card {
    animation: float 6s ease-in-out infinite;
}

.floating-card:nth-child(1) {
    animation-delay: 0s;
}

.floating-card:nth-child(2) {
    animation-delay: 1.5s;
}

.floating-card:nth-child(3) {
    animation-delay: 3s;
}

.floating-card:nth-child(4) {
    animation-delay: 4.5s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    25% {
        transform: translateY(-15px) rotate(2deg);
    }

    50% {
        transform: translateY(-25px) rotate(0deg);
    }

    75% {
        transform: translateY(-15px) rotate(-2deg);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Gradient Animation */
@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 3s ease infinite;
}

/* Typing Animation */
@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

.typing-animation {
    overflow: hidden;
    border-right: 2px solid var(--primary-color);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink 0.75s step-end infinite;
}

/* Hover Animations */
.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
    transition: transform 0.3s ease;
}

.work-item:hover .work-image {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* Button Hover Effects */
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.2);
}

/* Navigation Hover Effects */
.nav-link:hover {
    transform: translateY(-2px);
    transition: transform 0.3s ease;
}

/* Social Links Hover */
.social-links a:hover {
    transform: translateY(-3px) scale(1.1);
    transition: all 0.3s ease;
}

/* Stats Counter Animation */
.stat-number {
    transition: all 0.3s ease;
}

.stat-number.counting {
    animation: countUp 2s ease-out;
}

@keyframes countUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Testimonial Slider Animation */
.testimonial-item {
    transition: all 0.5s ease;
}

.testimonial-item.active {
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scroll Indicator Animation */
.scroll-indicator {
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Loading Animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading {
    animation: spin 1s linear infinite;
}

/* Parallax Effect */
.parallax {
    transform: translateZ(0);
    will-change: transform;
}

/* Smooth Transitions */
* {
    transition: all 0.3s ease;
}

/* Focus Animations for Accessibility */
.btn:focus,
.nav-link:focus,
.social-links a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .floating-card {
        animation: none;
    }

    .scroll-indicator {
        animation: none;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {

    .animate-fade-in,
    .animate-fade-in-delay,
    .animate-fade-in-delay-2 {
        animation-duration: 0.6s;
    }

    .floating-card {
        animation-duration: 4s;
    }
}