/**
 * AIBridgeGap Enhanced Animation Styles
 * Sophisticated micro-interactions and scroll animations
 * Performance-optimized with GPU acceleration
 */

/* Scroll Animation Base Styles */
.will-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Button Ripple Effect */
.btn-primary,
.btn-secondary,
.demo-btn,
.contact-btn {
    position: relative;
    overflow: hidden;
    /* GPU acceleration */
    transform: translateZ(0);
    backface-visibility: hidden;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Card Hover 3D Effects */
.service-card,
.demo-card,
.testimonial-card {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* GPU acceleration */
    will-change: transform;
    transform-style: preserve-3d;
}

/* article-card animations removed - caused readability issues */

/* Navigation Hover Effects */
.nav-link {
    position: relative;
}

.nav-hover-line {
    position: absolute;
    bottom: -2px;
    left: 0;
    height: 2px;
    width: 0;
    background: var(--primary-blue);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Form Focus Effects */
.form-group {
    position: relative;
    transition: all 0.3s ease;
}

.form-group-focused label {
    transform: translateY(-8px) scale(0.9);
    color: var(--primary-blue);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1),
                0 4px 12px rgba(37, 99, 235, 0.15);
    transform: translateY(-1px);
}

/* Service Icon Hover Animation */
.service-icon {
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    /* GPU acceleration */
    will-change: transform;
}

/* Stat Counter Animation */
.stat-number {
    display: inline-block;
    /* Optimize for animation */
    will-change: contents;
}

/* Parallax Elements */
.hero-image,
.value-visual {
    /* GPU acceleration for parallax */
    will-change: transform;
    transform: translateZ(0);
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .will-animate {
        opacity: 1;
        transform: none;
        transition: none;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Loading State Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Fade-in animations with different delays */
.fade-in-1 { animation: fadeIn 0.6s ease-out 0.1s both; }
.fade-in-2 { animation: fadeIn 0.6s ease-out 0.2s both; }
.fade-in-3 { animation: fadeIn 0.6s ease-out 0.3s both; }
.fade-in-4 { animation: fadeIn 0.6s ease-out 0.4s both; }

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

/* Scale-in animation */
.scale-in {
    animation: scaleIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
}

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

/* Slide-in animations */
.slide-in-left {
    animation: slideInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.slide-in-right {
    animation: slideInRight 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

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

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

/* Reveal animations */
.reveal-up {
    animation: revealUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(40px);
        clip-path: inset(100% 0 0 0);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        clip-path: inset(0 0 0 0);
    }
}

/* Gradient text animation (for accents) */
.gradient-animate {
    background: linear-gradient(
        90deg,
        var(--primary-blue),
        var(--accent-cyan),
        var(--accent-purple),
        var(--primary-blue)
    );
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 8s ease infinite;
}

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

/* Glow effect for important elements */
.glow-on-hover {
    transition: box-shadow 0.3s ease;
}

.glow-on-hover:hover {
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.4),
                0 0 40px rgba(37, 99, 235, 0.2);
}

/* Progress bar animation */
.progress-bar {
    position: relative;
    overflow: hidden;
    background: var(--light-gray);
    border-radius: var(--radius-md);
    height: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-cyan));
    border-radius: var(--radius-md);
    transform: translateX(-100%);
    transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill.active {
    transform: translateX(0);
}

/* Skeleton loading animation */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--light-gray) 0%,
        #e2e8f0 50%,
        var(--light-gray) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

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

/* Bounce attention animation */
.bounce-attention {
    animation: bounceAttention 2s ease-in-out infinite;
}

@keyframes bounceAttention {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Rotation animation for loading spinners */
.rotate-infinite {
    animation: rotate 1s linear infinite;
}

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

/* Performance optimization: Hardware acceleration */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: transform, opacity;
}

/* Reduce animation complexity on lower-end devices */
@media (prefers-reduced-motion: no-preference) and (max-width: 768px) {
    .service-card,
    .demo-card {
        /* Simplify 3D transforms on mobile */
        transform-style: flat;
    }

    .parallax {
        /* Disable parallax on mobile for performance */
        transform: none !important;
    }
}