/* Prometheus Fuels - Advanced Animations */

/* Scroll-triggered animations - Hardware accelerated */
.animate-on-scroll {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* Stagger animation delays */
.animate-on-scroll:nth-child(1) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(2) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.4s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.5s; }
.animate-on-scroll:nth-child(6) { transition-delay: 0.6s; }

/* Parallax elements - Hardware accelerated */
.parallax-element {
    will-change: transform;
    transform: translate3d(0, 0, 0); /* Force hardware acceleration */
    backface-visibility: hidden;
}

/* Advanced hover effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 35px rgba(231, 72, 51, 0.2);
}

.hover-glow {
    position: relative;
    overflow: hidden;
}

.hover-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(253, 240, 225, 0.3), transparent);
    transition: left 0.6s ease;
}

.hover-glow:hover::before {
    left: 100%;
}

/* Floating animations - Optimized with hardware acceleration */
.float-animation {
    animation: float 8s ease-in-out infinite;
    will-change: transform;
    transform: translate3d(0, 0, 0); /* Force hardware acceleration */
}

.float-animation:nth-child(2n) {
    animation-delay: -3s;
}

.float-animation:nth-child(3n) {
    animation-delay: -5s;
}

@keyframes float {
    0%, 100% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(0, -15px, 0);
    }
}

/* Pulse animations - Optimized */
.pulse-glow {
    animation: pulseGlow 4s ease-in-out infinite;
    will-change: box-shadow;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(231, 72, 51, 0.2);
    }
    50% {
        box-shadow: 0 0 25px rgba(231, 72, 51, 0.4);
    }
}

/* Text animations */
.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.text-reveal.animate span {
    opacity: 1;
    transform: translateY(0);
}

.text-reveal span:nth-child(1) { transition-delay: 0.1s; }
.text-reveal span:nth-child(2) { transition-delay: 0.2s; }
.text-reveal span:nth-child(3) { transition-delay: 0.3s; }
.text-reveal span:nth-child(4) { transition-delay: 0.4s; }
.text-reveal span:nth-child(5) { transition-delay: 0.5s; }

/* Counter animation */
.counter {
    display: inline-block;
}

.counter.animate {
    animation: countUp 2s ease-out;
}

@keyframes countUp {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

/* Morphing shapes - Optimized */
.morph-shape {
    animation: morphShape 12s ease-in-out infinite;
    will-change: transform, border-radius;
}

@keyframes morphShape {
    0%, 100% {
        border-radius: 50%;
        transform: rotate3d(0, 0, 1, 0deg);
    }
    50% {
        border-radius: 40% 60%;
        transform: rotate3d(0, 0, 1, 180deg);
    }
}

/* Particle effects - Simplified for performance */
.particle-effect {
    position: relative;
    overflow: hidden;
}

.particle-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(1px 1px at 20% 30%, rgba(253, 240, 225, 0.2), transparent),
        radial-gradient(1px 1px at 80% 70%, rgba(253, 240, 225, 0.2), transparent);
    background-size: 150px 150px;
    animation: particleFloat 20s linear infinite;
    will-change: transform;
}

@keyframes particleFloat {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(30px, -60px, 0); }
}

/* Loading states */
.skeleton {
    background: linear-gradient(90deg, 
        rgba(253, 240, 225, 0.1) 25%, 
        rgba(253, 240, 225, 0.3) 50%, 
        rgba(253, 240, 225, 0.1) 75%);
    background-size: 200% 100%;
    animation: skeleton 2s infinite;
}

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

/* Smooth scroll snap */
.scroll-snap-container {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

.scroll-snap-item {
    scroll-snap-align: start;
}

/* 3D transformations */
.card-3d {
    perspective: 1000px;
    transform-style: preserve-3d;
}

.card-3d:hover {
    transform: rotateY(10deg) rotateX(5deg);
}

.flip-card {
    perspective: 1000px;
    width: 100%;
    height: 200px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    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;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flip-card-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
}

/* Progress indicators */
.progress-ring {
    transform: rotate(-90deg);
    transition: stroke-dasharray 1s ease-in-out;
}

.progress-ring circle {
    fill: none;
    stroke: var(--color-primary);
    stroke-width: 4;
    stroke-linecap: round;
}

/* Intersection observer animations */
.fade-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease;
}

.fade-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.fade-in-down {
    opacity: 0;
    transform: translateY(-50px);
    transition: all 0.8s ease;
}

.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s ease;
}

.rotate-in {
    opacity: 0;
    transform: rotate(45deg) scale(0.8);
    transition: all 0.8s ease;
}

/* When elements become visible */
.fade-in-left.visible,
.fade-in-right.visible,
.fade-in-up.visible,
.fade-in-down.visible,
.scale-in.visible,
.rotate-in.visible {
    opacity: 1;
    transform: translate(0) scale(1) rotate(0);
}

/* Page transition animations */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-background);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
}

.page-transition.active {
    opacity: 1;
    visibility: visible;
}

.page-transition::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        var(--color-primary), 
        transparent);
    animation: slideIn 1s ease-in-out;
}

@keyframes slideIn {
    0% { left: -100%; }
    50% { left: 0; }
    100% { left: 100%; }
}

/* Mouse follower effects */
.cursor-follower {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary);
    pointer-events: none;
    mix-blend-mode: difference;
    z-index: 9999;
    transition: transform 0.1s ease;
    opacity: 0;
}

.cursor-follower.active {
    opacity: 0.8;
}

.cursor-follower.hover {
    transform: scale(2);
    background: var(--color-accent);
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(253, 240, 225, 0.3);
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Elastic animations */
.elastic-hover {
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.elastic-hover:hover {
    transform: scale(1.1);
}

.elastic-bounce {
    animation: elasticBounce 2s ease-in-out infinite;
}

@keyframes elasticBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

/* Wobble effect */
.wobble {
    animation: wobble 1s ease-in-out;
}

@keyframes wobble {
    0% { transform: rotate(0deg); }
    15% { transform: rotate(-5deg); }
    30% { transform: rotate(3deg); }
    45% { transform: rotate(-3deg); }
    60% { transform: rotate(2deg); }
    75% { transform: rotate(-1deg); }
    100% { transform: rotate(0deg); }
}

/* Typewriter effect */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--color-primary);
    white-space: nowrap;
    animation: typewriter 3s steps(40, end), blink 0.8s infinite;
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    from, to { border-color: transparent; }
    50% { border-color: var(--color-primary); }
}

/* Responsive animations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mobile optimizations - Disable heavy animations */
@media (max-width: 768px) {
    .float-animation {
        animation: none;
        transform: translate3d(0, 0, 0);
    }
    
    .morph-shape {
        animation: none;
        border-radius: 50%;
    }
    
    .particle-effect::before {
        animation: none;
        opacity: 0.5;
    }
    
    .pulse-glow {
        animation-duration: 6s;
    }
    
    /* Disable 3D effects on mobile */
    .card-3d:hover {
        transform: none;
    }
    
    .flip-card:hover .flip-card-inner {
        transform: none;
    }
    
    /* Simplify hover effects for touch devices */
    .hover-lift:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(231, 72, 51, 0.1);
    }
    
    .hover-glow:hover::before {
        animation: none;
    }
    
    /* Disable cursor follower on mobile */
    .cursor-follower {
        display: none;
    }
}