/* ================================
   BIOCARBON INDUSTRY - ANIMATIONS
   Framer-style Advanced Animations
   ================================ */

/* === FADE IN ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* === SCALE ANIMATIONS === */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* === SLIDE ANIMATIONS === */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* === GLOW ANIMATIONS === */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(216, 174, 105, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(216, 174, 105, 0.4);
    }
}

@keyframes glowPulse {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(216, 174, 105, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(216, 174, 105, 0.6));
    }
}

/* === ROTATE ANIMATIONS === */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

/* === SHIMMER EFFECT === */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        rgba(243, 240, 235, 0) 0%,
        rgba(216, 174, 105, 0.3) 50%,
        rgba(243, 240, 235, 0) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 3s infinite;
}

/* === GRADIENT SHIFT === */
@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* === BOUNCE ANIMATIONS === */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* === REVEAL ANIMATIONS === */
@keyframes revealLeft {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

@keyframes revealRight {
    from {
        clip-path: inset(0 0 0 100%);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

@keyframes revealBottom {
    from {
        clip-path: inset(100% 0 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

/* === BLUR ANIMATIONS === */
@keyframes blurIn {
    from {
        opacity: 0;
        filter: blur(20px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

/* === PARTICLE EFFECT === */
@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) rotate(360deg);
        opacity: 0;
    }
}

/* === TYPING EFFECT === */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

/* === WAVE ANIMATION === */
@keyframes wave {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-10px);
    }
    50% {
        transform: translateY(0);
    }
    75% {
        transform: translateY(10px);
    }
}

/* === UTILITY CLASSES === */
.animate-fadeIn {
    animation: fadeIn 0.8s ease-out forwards;
}

.animate-fadeInUp {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fadeInDown {
    animation: fadeInDown 0.8s ease-out forwards;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.8s ease-out forwards;
}

.animate-fadeInRight {
    animation: fadeInRight 0.8s ease-out forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.6s ease-out forwards;
}

.animate-slideInLeft {
    animation: slideInLeft 0.8s ease-out forwards;
}

.animate-slideInRight {
    animation: slideInRight 0.8s ease-out forwards;
}

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

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

.animate-rotate {
    animation: rotate 20s linear infinite;
}

/* === STAGGER DELAYS === */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* === SCROLL-TRIGGERED ANIMATIONS === */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* === HOVER EFFECTS === */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(216, 174, 105, 0.3);
}

.hover-glow {
    transition: filter 0.3s ease;
}

.hover-glow:hover {
    filter: drop-shadow(0 0 20px rgba(216, 174, 105, 0.5));
}

.hover-scale {
    transition: transform 0.3s ease;
}

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

.hover-rotate {
    transition: transform 0.5s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* === LOADING ANIMATIONS === */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(216, 174, 105, 0.2);
    border-top-color: #D8AE69;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* === PROGRESS BAR === */
@keyframes progressBar {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

.progress-bar {
    height: 4px;
    background: linear-gradient(90deg, #D8AE69 0%, #C9984A 100%);
    animation: progressBar 2s ease-out forwards;
}

/* === RIPPLE EFFECT === */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    background: rgba(216, 174, 105, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
}

.ripple-effect:active::after {
    animation: ripple 0.6s ease-out;
}

/* === TEXT GRADIENT ANIMATION === */
@keyframes textGradient {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.text-gradient-animated {
    background: linear-gradient(
        90deg,
        #F3F0EB 0%,
        #D8AE69 25%,
        #F3F0EB 50%,
        #D8AE69 75%,
        #F3F0EB 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textGradient 3s linear infinite;
}

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

.glitch {
    animation: glitch 0.3s ease-in-out;
}

/* === PARALLAX LAYERS === */
.parallax-slow {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.parallax-medium {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.parallax-fast {
    transition: transform 0.1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* === MAGNETIC HOVER === */
.magnetic {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* === MORPHING BORDER === */
@keyframes morphBorder {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

.morph-border {
    animation: morphBorder 8s ease-in-out infinite;
}

/* === FADE IN SEQUENCE === */
.fade-in-sequence > * {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-sequence > *:nth-child(1) { animation-delay: 0.1s; }
.fade-in-sequence > *:nth-child(2) { animation-delay: 0.2s; }
.fade-in-sequence > *:nth-child(3) { animation-delay: 0.3s; }
.fade-in-sequence > *:nth-child(4) { animation-delay: 0.4s; }
.fade-in-sequence > *:nth-child(5) { animation-delay: 0.5s; }
.fade-in-sequence > *:nth-child(6) { animation-delay: 0.6s; }

/* === SCROLL PROGRESS BAR === */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #D8AE69 0%, #C9984A 100%);
    transform-origin: left;
    z-index: 9999;
    transition: transform 0.1s ease-out;
}

/* === CURSOR FOLLOW === */
.cursor-follow {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid #D8AE69;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.15s ease, width 0.3s ease, height 0.3s ease;
    transform: translate(-50%, -50%);
}

.cursor-follow.hover {
    width: 40px;
    height: 40px;
    background: rgba(216, 174, 105, 0.1);
}

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

/* === GPU ACCELERATION === */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}
