/* Futuristic Animation Keyframes */

:root {
    --animation-duration-fast: 200ms;
    --animation-duration-normal: 400ms;
    --animation-duration-slow: 800ms;
    --animation-duration-slower: 1200ms;
    --easing-smooth: cubic-bezier(0.22, 1, 0.36, 1);
    --easing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --easing-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* 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;
    }
}

/* Disable animations when user toggles them off */
[data-animations-disabled] *,
[data-animations-disabled] *::before,
[data-animations-disabled] *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transform: none !important;
}

/* Fade In Up Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Left Animation */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right Animation */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In Animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Glow Pulse Animation */
@keyframes glowPulse {
    0%, 100% {
        filter: drop-shadow(0 0 5px rgba(217, 70, 239, 0.5)) drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 15px rgba(217, 70, 239, 0.8)) drop-shadow(0 0 25px rgba(99, 102, 241, 0.8));
    }
}

/* Text Reveal Animation */
@keyframes textReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Holographic Gradient Animation */
@keyframes holographic {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Glitch Effect */
@keyframes glitch {
    0%, 100% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

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

/* Rotate Glow */
@keyframes rotateGlow {
    0% {
        filter: hue-rotate(0deg) brightness(1);
    }
    100% {
        filter: hue-rotate(360deg) brightness(1.2);
    }
}

/* Animation Initial States - Used by JavaScript */
.animation-initial-state {
    opacity: 0;
    transition: opacity var(--animation-duration-slow) var(--easing-smooth), transform var(--animation-duration-slow) var(--easing-smooth);
    will-change: opacity, transform;
}

.animation-fadeInUp {
    transform: translateY(30px);
}

.animation-fadeInLeft {
    transform: translateX(-30px);
}

.animation-fadeInRight {
    transform: translateX(30px);
}

.animation-scaleIn {
    transform: scale(0.9);
}

.animation-fadeIn {
    /* opacity already set by animation-initial-state */
    opacity: 0;
}

.animate-in {
    opacity: 1 !important;
    transform: none !important;
}

/* Text Reveal Classes */
.text-reveal-word {
    opacity: 0;
    display: inline-block;
}

.text-reveal-visible {
    opacity: 1;
}

/* Utility Classes */
.animate-fade-in-up {
    animation: fadeInUp var(--animation-duration-slow) var(--easing-smooth) forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft var(--animation-duration-slow) var(--easing-smooth) forwards;
}

.animate-fade-in-right {
    animation: fadeInRight var(--animation-duration-slow) var(--easing-smooth) forwards;
}

.animate-scale-in {
    animation: scaleIn var(--animation-duration-normal) var(--easing-smooth) forwards;
}

.animate-glow-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

.animate-holographic {
    background-size: 200% 200%;
    animation: holographic 3s ease infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, rgba(217, 70, 239, 1), rgba(99, 102, 241, 1));
    z-index: 9999;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(217, 70, 239, 0.5);
}

/* Section Indicator */
.section-indicator {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.section-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.section-indicator-dot.active {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 10px rgba(217, 70, 239, 0.8);
    transform: scale(1.5);
}

/* 3D Tilt Effect */
.tilt-3d {
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}

/* Magnetic Button Effect */
.magnetic-button {
    transition: transform 0.3s var(--easing-smooth);
}

.magnetic-button:hover {
    transform: scale(1.05);
}

/* Neon Glow on Hover */
.neon-glow {
    transition: text-shadow 0.3s ease, box-shadow 0.3s ease;
}

.neon-glow:hover {
    text-shadow: 0 0 10px rgba(217, 70, 239, 0.8), 0 0 20px rgba(217, 70, 239, 0.6), 0 0 30px rgba(217, 70, 239, 0.4);
    box-shadow: 0 0 20px rgba(217, 70, 239, 0.3);
}

/* Animation Toggle Button */
.animation-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 10000;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    padding: 0;
    margin: 0;
}

.animation-toggle:hover,
.animation-toggle-hover {
    background: rgba(0, 0, 0, 0.9) !important;
    transform: scale(1.1);
}

.animation-toggle-disabled {
    opacity: 0.5;
}

/* Header Scroll Effects */
.header-transition {
    transition: background-color var(--animation-duration-normal) ease, 
                backdrop-filter var(--animation-duration-normal) ease, 
                border-color var(--animation-duration-normal) ease, 
                box-shadow var(--animation-duration-normal) ease;
}

.header-scrolled {
    background-color: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(20px) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

.header-logo-glow {
    filter: drop-shadow(0 0 10px rgba(217, 70, 239, 0.5)) drop-shadow(0 0 20px rgba(99, 102, 241, 0.5)) !important;
    transition: filter 0.3s ease;
}

.header-nav-glow {
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5) !important;
    transition: text-shadow 0.3s ease;
}

/* Ripple Effect */
.ripple {
    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;
    }
}

button, a[href^="#"], .ripple-effect {
    position: relative;
    overflow: hidden;
}

/* 3D Tilt Effect */
.tilt-3d-active {
    transform: perspective(1000px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) scale3d(1.02, 1.02, 1.02) !important;
    transition: transform 0.3s ease;
}

/* Floating Labels */
.input-wrapper {
    position: relative;
}

.floating-label {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
}

.floating-label-active {
    top: 0.5rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
}

.input-has-value {
    padding-top: 1.5rem;
}

/* Parallax Image */
.parallax-image-active {
    transform: translate(var(--parallax-x, 0), var(--parallax-y, 0)) scale(1.05) !important;
    transition: transform 0.3s ease;
}

/* Magnetic Button */
.magnetic-button-active {
    transform: translate(var(--magnetic-x, 0), var(--magnetic-y, 0)) !important;
    transition: transform 0.3s var(--easing-smooth);
}

/* Form Validation */
.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

input.error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* Contact Form Input Hover Effects */
#contact input,
#contact textarea {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#contact input:hover:not(:focus):not(.error),
#contact textarea:hover:not(:focus):not(.error) {
    border-color: rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1),
                0 0 8px rgba(99, 102, 241, 0.2),
                0 0 12px rgba(217, 70, 239, 0.15) !important;
}

/* Ensure focus state still works properly */
#contact input:focus,
#contact textarea:focus {
    border-color: rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2),
                0 0 12px rgba(99, 102, 241, 0.3),
                0 0 16px rgba(217, 70, 239, 0.2) !important;
}

.success-message {
    color: #10b981;
    font-size: 1rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 0.5rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Services Section Optimizations */
.service-card-visible {
    opacity: 1;
    transform: translateY(0);
}

.service-card-hover {
    z-index: 10;
}

/* Optimized service card animations */
#services [data-stagger-item],
#services .group {
    will-change: transform, opacity;
}

#services [data-stagger-item]:hover,
#services .group:hover {
    will-change: transform;
}

/* Smooth transitions for service cards */
#services .rounded-2xl.border {
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                background-color 0.3s ease,
                border-color 0.3s ease;
}

/* Performance: Reduce repaints on scroll */
#services {
    contain: layout style paint;
}

/* Optimize backdrop blur for better performance */
#services .backdrop-blur {
    will-change: backdrop-filter;
}

/* Lazy loaded images */
#services img.loaded {
    opacity: 1;
    transition: opacity 0.3s ease;
}

#services img:not(.loaded) {
    opacity: 0;
}

/* Services Enhancement Styles */
.service-features {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1rem;
}

.service-features svg {
    flex-shrink: 0;
}

/* Enhanced service card hover */
#services [data-stagger-item]:hover .service-features,
#services .group:hover .service-features {
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* CTA button in service cards */
#services [data-stagger-item] a[href="#contact"],
#services .group a[href="#contact"] {
    transition: all 0.3s ease;
}

#services [data-stagger-item] a[href="#contact"]:hover,
#services .group a[href="#contact"]:hover {
    transform: translateX(4px);
}

/* Benefits section */
.services-benefits {
    animation: fadeInUp 0.6s ease-out forwards;
}

.services-benefits .rounded-xl {
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.services-benefits .rounded-xl:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

