/* ============================================
   Compositing Engine - Animations Stylesheet
   Smooth & Interactive Animations
   Primary Color: #F97D41 (Orange)
   ============================================ */

/* ============================================
   1. KEYFRAME DEFINITIONS
   ============================================ */

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(2deg);
    }
}

@keyframes float-delayed {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(-2deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes rotate-slow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes bounce-subtle {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slide-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes draw-line {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

@keyframes wave {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-5px);
    }
    75% {
        transform: translateY(5px);
    }
}

@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%;
    }
}

@keyframes scroll-down {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(10px);
        opacity: 0;
    }
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   2. AOS (Animate On Scroll) ANIMATIONS
   ============================================ */

[data-aos] {
    opacity: 0;
    transition-property: opacity, transform, filter;
    transition-duration: 0.8s;
    transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

[data-aos="fade-up"] {
    transform: translate3d(0, 40px, 0);
}

[data-aos="fade-down"] {
    transform: translate3d(0, -40px, 0);
}

[data-aos="fade-left"] {
    transform: translate3d(40px, 0, 0);
}

[data-aos="fade-right"] {
    transform: translate3d(-40px, 0, 0);
}

[data-aos="fade-up-left"] {
    transform: translate3d(40px, 40px, 0);
}

[data-aos="fade-up-right"] {
    transform: translate3d(-40px, 40px, 0);
}

[data-aos="zoom-in"] {
    transform: scale3d(0.9, 0.9, 0.9);
}

[data-aos="zoom-in-up"] {
    transform: scale3d(0.9, 0.9, 0.9) translate3d(0, 40px, 0);
}

[data-aos="zoom-out"] {
    transform: scale3d(1.1, 1.1, 1.1);
}

[data-aos="flip-up"] {
    transform: perspective(1000px) rotateX(-15deg);
    transform-origin: center bottom;
}

[data-aos="flip-left"] {
    transform: perspective(1000px) rotateY(-15deg);
    transform-origin: right center;
}

[data-aos="flip-right"] {
    transform: perspective(1000px) rotateY(15deg);
    transform-origin: left center;
}

[data-aos="blur-in"] {
    filter: blur(10px);
    transform: scale(0.95);
}

/* AOS Animation States */
[data-aos].aos-animate {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale3d(1, 1, 1) rotate(0);
    filter: blur(0);
}

/* AOS Duration Modifiers */
[data-aos-duration="400"] { transition-duration: 0.4s; }
[data-aos-duration="600"] { transition-duration: 0.6s; }
[data-aos-duration="800"] { transition-duration: 0.8s; }
[data-aos-duration="1000"] { transition-duration: 1s; }
[data-aos-duration="1200"] { transition-duration: 1.2s; }

/* AOS Delay Modifiers */
[data-aos-delay="100"] { transition-delay: 0.1s; }
[data-aos-delay="200"] { transition-delay: 0.2s; }
[data-aos-delay="300"] { transition-delay: 0.3s; }
[data-aos-delay="400"] { transition-delay: 0.4s; }
[data-aos-delay="500"] { transition-delay: 0.5s; }
[data-aos-delay="600"] { transition-delay: 0.6s; }

/* AOS Easing */
[data-aos-easing="linear"] { transition-timing-function: linear; }
[data-aos-easing="ease"] { transition-timing-function: ease; }
[data-aos-easing="ease-out"] { transition-timing-function: ease-out; }
[data-aos-easing="ease-in-out"] { transition-timing-function: ease-in-out; }
[data-aos-easing="ease-out-back"] { transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275); }

/* ============================================
   3. HOVER EFFECTS & INTERACTIONS
   ============================================ */

/* Magnetic Button Effect */
.magnetic-btn {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.magnetic-btn:hover {
    transform: scale(1.05);
}

/* Card Hover Lift */
.hover-lift {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                box-shadow 0.4s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(249, 125, 65, 0.15);
}

/* Image Zoom on Hover */
.img-zoom {
    overflow: hidden;
}

.img-zoom img {
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.img-zoom:hover img {
    transform: scale(1.1);
}

/* Underline Animation */
.hover-underline {
    position: relative;
    display: inline-block;
}

.hover-underline::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: #F97D41;
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

.hover-underline:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Glow Effect */
.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(249, 125, 65, 0.4);
}

/* Rotate Icon on Hover */
.hover-rotate i {
    transition: transform 0.5s ease;
}

.hover-rotate:hover i {
    transform: rotate(360deg);
}

/* Border Draw Animation */
.border-draw {
    position: relative;
}

.border-draw::before,
.border-draw::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: #F97D41;
    transition: width 0.4s ease;
}

.border-draw::before {
    top: 0;
    left: 0;
}

.border-draw::after {
    bottom: 0;
    right: 0;
}

.border-draw:hover::before,
.border-draw:hover::after {
    width: 100%;
}

/* Shake Animation on Hover */
.hover-shake:hover {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ============================================
   4. LOADING & ENTRANCE ANIMATIONS
   ============================================ */

/* Page Load Sequence */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1A1A2E;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.loaded {
    opacity: 0;
    visibility: hidden;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(249, 125, 65, 0.2);
    border-top-color: #F97D41;
    border-radius: 50%;
    animation: spin-slow 1s linear infinite;
}

/* Stagger Children Animation */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    animation: slide-in-up 0.6s ease forwards;
}

.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; }

/* Text Reveal Animation */
.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
    animation: text-reveal 0.8s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

@keyframes text-reveal {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Gradient Text Animation */
.gradient-text-animated {
    background: linear-gradient(90deg, #F97D41, #ff9f70, #F97D41, #ff5722);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
}

/* ============================================
   5. SCROLL & PARALLAX EFFECTS
   ============================================ */

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Parallax Classes */
.parallax {
    will-change: transform;
    transition: transform 0.1s linear;
}

.parallax-slow {
    transform: translateZ(-1px) scale(1.5);
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #F97D41, #ff9f70);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Reveal on Scroll */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   6. SPECIALIZED COMPONENT ANIMATIONS
   ============================================ */

/* Service Card Icon Spin */
.service-card:hover .service-icon {
    animation: icon-spin 0.6s ease;
}

@keyframes icon-spin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

/* Portfolio Overlay Slide */
.portfolio-item .portfolio-overlay {
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.portfolio-item:hover .portfolio-overlay {
    transform: translateY(0);
}

/* Pricing Card Pulse */
.pricing-card.featured::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #F97D41, #ff9f70, #F97D41);
    border-radius: 22px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pricing-card.featured:hover::before {
    opacity: 1;
    animation: pulse-ring 2s infinite;
}

/* Navigation Link Underline Draw */
.nav-link::after {
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Hamburger Animation */
.hamburger.active .bar:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.hamburger .bar {
    transition: all 0.3s ease-in-out;
}

/* Button Ripple Effect */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    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 ease, height 0.6s ease;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

/* Floating Elements in Hero */
.float-card {
    animation: float 6s ease-in-out infinite;
}

.float-card:nth-child(2) {
    animation-delay: -2s;
    animation-duration: 5s;
}

.float-card:nth-child(3) {
    animation-delay: -4s;
    animation-duration: 7s;
}

/* Process Step Line Draw */
.step-line {
    position: relative;
    overflow: hidden;
}

.step-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #F97D41;
    animation: draw-line 1s ease forwards;
    animation-delay: 0.5s;
}

/* Form Input Focus Animation */
.form-group input:focus,
.form-group textarea:focus {
    animation: input-pulse 0.3s ease;
}

@keyframes input-pulse {
    0% { box-shadow: 0 0 0 0 rgba(249, 125, 65, 0.4); }
    100% { box-shadow: 0 0 0 4px rgba(249, 125, 65, 0); }
}

/* ============================================
   7. BACKGROUND & PARTICLE ANIMATIONS
   ============================================ */

/* Animated Gradient Background */
.animated-bg {
    background: linear-gradient(-45deg, #1A1A2E, #16213E, #F97D41, #1A1A2E);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

/* Particle Container */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    top: 0;
    left: 0;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: rgba(249, 125, 65, 0.3);
    border-radius: 50%;
    animation: particle-float 20s infinite linear;
}

@keyframes particle-float {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

/* Shimmer Loading Effect */
.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
}

/* ============================================
   8. MOBILE & RESPONSIVE ANIMATIONS
   ============================================ */

@media (max-width: 768px) {
    /* Reduce motion for mobile */
    [data-aos] {
        transition-duration: 0.6s;
    }
    
    .float-card {
        animation-duration: 8s;
    }
    
    /* Simpler hover effects for touch */
    .hover-lift:hover {
        transform: translateY(-5px);
    }
}

/* Respect Reduced 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;
    }
    
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ============================================
   9. UTILITY ANIMATION CLASSES
   ============================================ */

/* Infinite Animations */
.animate-float { animation: float 6s ease-in-out infinite; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-bounce { animation: bounce-subtle 2s ease-in-out infinite; }
.animate-spin { animation: spin-slow 3s linear infinite; }
.animate-morph { animation: morph 8s ease-in-out infinite; }
.animate-wave { animation: wave 2s ease-in-out infinite; }

/* Animation Delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* Play State */
.paused { animation-play-state: paused; }
.running { animation-play-state: running; }

/* Fill Modes */
.forwards { animation-fill-mode: forwards; }
.backwards { animation-fill-mode: backwards; }
.both { animation-fill-mode: both; }

/* ============================================
   10. PAGE TRANSITIONS
   ============================================ */

.page-transition-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.page-transition-exit {
    opacity: 1;
}

.page-transition-exit-active {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Smooth Page Load */
body {
    animation: page-load 0.8s ease-out;
}

@keyframes page-load {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}