/* ========================================
   ELITE DIGITAL AGENCY - ANIMATIONS
   GSAP & Custom CSS Animations
======================================== */

/* AOS (Animate On Scroll) Custom Styles */
[data-aos] {
    opacity: 0;
    transition-property: opacity, transform;
}

[data-aos].aos-animate {
    opacity: 1;
}

/* Fade Animations */
[data-aos="fade-up"] {
    transform: translateY(30px);
}

[data-aos="fade-up"].aos-animate {
    transform: translateY(0);
}

[data-aos="fade-down"] {
    transform: translateY(-30px);
}

[data-aos="fade-down"].aos-animate {
    transform: translateY(0);
}

[data-aos="fade-left"] {
    transform: translateX(30px);
}

[data-aos="fade-left"].aos-animate {
    transform: translateX(0);
}

[data-aos="fade-right"] {
    transform: translateX(-30px);
}

[data-aos="fade-right"].aos-animate {
    transform: translateX(0);
}

/* Zoom Animations */
[data-aos="zoom-in"] {
    transform: scale(0.8);
}

[data-aos="zoom-in"].aos-animate {
    transform: scale(1);
}

[data-aos="zoom-out"] {
    transform: scale(1.2);
}

[data-aos="zoom-out"].aos-animate {
    transform: scale(1);
}

/* Custom GSAP Animations */
.hero-title .gradient-text {
    background-size: 200% 200%;
    animation: gradient-shift 3s ease-in-out infinite;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Floating Elements Animation */
.floating-card {
    animation: floating-card 6s ease-in-out infinite;
}

@keyframes floating-card {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(1deg);
    }
    50% {
        transform: translateY(-5px) rotate(0deg);
    }
    75% {
        transform: translateY(-15px) rotate(-1deg);
    }
}

/* Tech Stack Icons Animation */
.tech-item {
    animation: tech-float 4s ease-in-out infinite;
}

@keyframes tech-float {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    50% {
        transform: translateY(-10px) scale(1.05);
    }
}

/* Hero Background Orbs */
.gradient-orb {
    animation: orb-float 20s ease-in-out infinite;
}

@keyframes orb-float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.6;
    }
    25% {
        transform: translate(30px, -30px) scale(1.1);
        opacity: 0.8;
    }
    50% {
        transform: translate(-20px, 20px) scale(0.9);
        opacity: 0.4;
    }
    75% {
        transform: translate(20px, -10px) scale(1.05);
        opacity: 0.7;
    }
}

/* Service Cards Hover Animation */
.service-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: var(--radius-lg);
}

.service-card:hover::before {
    opacity: 1;
}

/* Timeline Animation */
.timeline-item {
    opacity: 0;
    transform: translateY(50px);
    animation: timeline-appear 0.6s ease forwards;
}

@keyframes timeline-appear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.timeline-icon {
    animation: icon-pulse 2s ease-in-out infinite;
}

@keyframes icon-pulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    }
    50% {
        transform: translateX(-50%) scale(1.05);
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.6);
    }
}

/* Portfolio Items Animation */
.portfolio-item {
    overflow: hidden;
    position: relative;
}

.portfolio-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
    z-index: 1;
}

.portfolio-item:hover::before {
    left: 100%;
}

/* Counter Animation */
.stat-number {
    transition: all 0.3s ease;
}

/* Button Animations */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::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;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Navbar Animation */
.navbar {
    transition: all 0.3s ease;
}

.nav-logo .logo-glow {
    animation: logo-glow 2s ease-in-out infinite alternate;
}

@keyframes logo-glow {
    0% {
        opacity: 0.3;
        transform: translateY(-50%) scale(1);
    }
    100% {
        opacity: 0.6;
        transform: translateY(-50%) scale(1.1);
    }
}

/* Navigation Link Animation */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Loading Screen Animation */
.loading-progress {
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% 100%;
    animation: loading-gradient 2s ease-in-out infinite;
}

@keyframes loading-gradient {
    0% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 0%;
    }
    100% {
        background-position: 0% 0%;
    }
}

/* Testimonial Slider Animation */
.testimonial-slide {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-slide.active {
    animation: slide-in 0.5s ease-out;
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Social Links Animation */
.social-link {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-link:hover {
    transform: translateY(-3px) rotate(5deg);
}

/* Newsletter Form Animation */
.newsletter-input {
    transition: all 0.3s ease;
}

.newsletter-input:focus {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* Back to Top Button Animation */
.back-to-top {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-to-top:hover {
    transform: translateY(-3px) scale(1.1);
}

/* Feature Item Animation */
.feature-item {
    opacity: 0;
    transform: translateX(-30px);
    animation: feature-slide-in 0.6s ease forwards;
}

.feature-item:nth-child(2) {
    animation-delay: 0.1s;
}

.feature-item:nth-child(3) {
    animation-delay: 0.2s;
}

.feature-item:nth-child(4) {
    animation-delay: 0.3s;
}

@keyframes feature-slide-in {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Achievement Badge Animation */
.achievement-badge {
    animation: badge-glow 3s ease-in-out infinite;
}

@keyframes badge-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(56, 239, 125, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(56, 239, 125, 0.6);
    }
}

/* Section Background Animation */
.section-header {
    opacity: 0;
    transform: translateY(30px);
    animation: section-header-appear 0.8s ease forwards;
}

@keyframes section-header-appear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Gradient Text Animation */
.gradient-text {
    background-size: 200% 200%;
    animation: gradient-flow 3s ease-in-out infinite;
}

@keyframes gradient-flow {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--primary-gradient);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Parallax Effect */
.parallax-element {
    transform: translateZ(0);
    transition: transform 0.1s ease-out;
}

/* Magnetic Button Effect */
.magnetic-btn {
    transition: transform 0.2s ease;
}

/* Ripple Effect */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple-effect:active::before {
    width: 300px;
    height: 300px;
}

/* Stagger Animation for Lists */
.stagger-animation {
    opacity: 0;
    transform: translateY(20px);
}

.stagger-animation.animate {
    animation: stagger-appear 0.5s ease forwards;
}

@keyframes stagger-appear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typing Effect */
.typing-effect {
    overflow: hidden;
    border-right: 2px solid #667eea;
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: #667eea;
    }
}

/* Morphing Shape Animation */
.morphing-shape {
    animation: morph 8s ease-in-out infinite;
}

@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%;
    }
}

/* Text Reveal Animation */
.text-reveal {
    opacity: 0;
    transform: translateY(50px);
    animation: text-reveal 0.8s ease forwards;
}

@keyframes text-reveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card 3D Flip Effect */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* Smooth Page Transitions */
.page-transition {
    opacity: 0;
    transform: translateY(20px);
    animation: page-enter 0.6s ease forwards;
}

@keyframes page-enter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Animation Adjustments */
@media (max-width: 768px) {
    .hero-title .gradient-text {
        animation-duration: 2s;
    }
    
    .floating-card {
        animation-duration: 4s;
    }
    
    .gradient-orb {
        animation-duration: 15s;
    }
    
    .service-card:hover {
        transform: translateY(-5px) scale(1.01);
    }
}

@media (max-width: 480px) {
    [data-aos="fade-up"],
    [data-aos="fade-down"],
    [data-aos="fade-left"],
    [data-aos="fade-right"] {
        transform: none;
    }
    
    .floating-card {
        animation: none;
    }
    
    .tech-item {
        animation: none;
    }
    
    .gradient-orb {
        animation: none;
    }
}