/* ========================================
   ANIMACIONES AVANZADAS - INTEGRALLSOFT
   ======================================== */

/* 🌟 PARTICLE SYSTEM */
.particle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: linear-gradient(45deg, #6366f1, #8b5cf6);
    border-radius: 50%;
    animation: float 6s infinite linear;
    opacity: 0.7;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* 🎭 MORPHING SHAPES */
.morphing-shape {
    position: relative;
    width: 200px;
    height: 200px;
    background: linear-gradient(45deg, #6366f1, #8b5cf6, #06b6d4);
    border-radius: 50% 50% 50% 50%;
    animation: morph 8s ease-in-out infinite;
    filter: blur(1px);
    opacity: 0.3;
}

@keyframes morph {
    0%, 100% {
        border-radius: 50% 50% 50% 50%;
        transform: rotate(0deg) scale(1);
    }
    25% {
        border-radius: 30% 70% 30% 70%;
        transform: rotate(90deg) scale(1.1);
    }
    50% {
        border-radius: 70% 30% 70% 30%;
        transform: rotate(180deg) scale(0.9);
    }
    75% {
        border-radius: 40% 60% 40% 60%;
        transform: rotate(270deg) scale(1.05);
    }
}

/* 🌊 LIQUID ANIMATION */
.liquid-bg {
    position: relative;
    overflow: hidden;
}

.liquid-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        rgba(99, 102, 241, 0.1) 0%,
        rgba(139, 92, 246, 0.1) 25%,
        rgba(6, 182, 212, 0.1) 50%,
        rgba(16, 185, 129, 0.1) 75%,
        rgba(99, 102, 241, 0.1) 100%);
    animation: liquid-flow 20s ease-in-out infinite;
    border-radius: 50%;
}

@keyframes liquid-flow {
    0%, 100% {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }
    25% {
        transform: translate(-30%, -70%) rotate(90deg) scale(1.2);
    }
    50% {
        transform: translate(-70%, -30%) rotate(180deg) scale(0.8);
    }
    75% {
        transform: translate(-30%, -30%) rotate(270deg) scale(1.1);
    }
}

/* 🎯 INTERACTIVE CURSOR */
.custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, #6366f1, #8b5cf6);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: all 0.3s ease;
    mix-blend-mode: difference;
}

.custom-cursor.hover {
    transform: scale(2);
    background: linear-gradient(45deg, #8b5cf6, #06b6d4);
}

/* 🌈 RAINBOW BORDER */
.rainbow-border {
    position: relative;
    background: linear-gradient(45deg, #6366f1, #8b5cf6, #06b6d4, #10b981, #f59e0b, #ef4444, #6366f1);
    background-size: 400% 400%;
    animation: rainbow-shift 3s ease infinite;
    padding: 2px;
    border-radius: var(--border-radius);
}

.rainbow-border::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: var(--bg-primary);
    border-radius: calc(var(--border-radius) - 2px);
    z-index: 1;
}

@keyframes rainbow-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 🎪 3D CARD FLIP */
.card-3d {
    perspective: 1000px;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.card-3d:hover {
    transform: rotateY(10deg) rotateX(5deg);
}

.card-3d .card-inner {
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.card-3d:hover .card-inner {
    transform: rotateY(-10deg) rotateX(-5deg);
}

/* 🌟 GLOW EFFECT */
.glow-effect {
    position: relative;
    overflow: hidden;
}

.glow-effect::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #6366f1, #8b5cf6, #06b6d4, #10b981);
    background-size: 400% 400%;
    animation: glow-pulse 2s ease-in-out infinite;
    border-radius: var(--border-radius);
    z-index: -1;
    filter: blur(8px);
    opacity: 0.7;
}

@keyframes glow-pulse {
    0%, 100% {
        background-position: 0% 50%;
        opacity: 0.7;
    }
    50% {
        background-position: 100% 50%;
        opacity: 1;
    }
}

/* 🎨 TEXT GRADIENT ANIMATION */
.text-gradient-animated {
    background: linear-gradient(45deg, #6366f1, #8b5cf6, #06b6d4, #10b981);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: text-gradient-flow 3s ease infinite;
}

@keyframes text-gradient-flow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* 🌊 WAVE ANIMATION */
.wave-container {
    position: relative;
    overflow: hidden;
    height: 100px;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100px;
    background: linear-gradient(45deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    animation: wave-motion 4s ease-in-out infinite;
}

.wave::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(6, 182, 212, 0.1), rgba(16, 185, 129, 0.1));
    animation: wave-motion 4s ease-in-out infinite reverse;
}

@keyframes wave-motion {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-20px);
    }
}

/* 🎭 MASONRY LAYOUT ANIMATION */
.masonry-item {
    opacity: 0;
    transform: translateY(50px);
    animation: masonry-fade-in 0.6s ease forwards;
}

.masonry-item:nth-child(1) { animation-delay: 0.1s; }
.masonry-item:nth-child(2) { animation-delay: 0.2s; }
.masonry-item:nth-child(3) { animation-delay: 0.3s; }
.masonry-item:nth-child(4) { animation-delay: 0.4s; }
.masonry-item:nth-child(5) { animation-delay: 0.5s; }
.masonry-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes masonry-fade-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 🎪 LOADING SPINNER ADVANCED */
.loading-spinner-advanced {
    position: relative;
    width: 60px;
    height: 60px;
}

.loading-spinner-advanced::before,
.loading-spinner-advanced::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    animation: spinner-advanced 2s linear infinite;
}

.loading-spinner-advanced::before {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top: 4px solid #6366f1;
    animation-duration: 1s;
}

.loading-spinner-advanced::after {
    width: 40px;
    height: 40px;
    top: 10px;
    left: 10px;
    border: 4px solid rgba(139, 92, 246, 0.2);
    border-top: 4px solid #8b5cf6;
    animation-duration: 1.5s;
    animation-direction: reverse;
}

@keyframes spinner-advanced {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 🎨 HOVER REVEAL EFFECT */
.hover-reveal {
    position: relative;
    overflow: hidden;
}

.hover-reveal::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.hover-reveal:hover::before {
    left: 100%;
}

/* 🌟 SCROLL PROGRESS */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #06b6d4);
    z-index: 9999;
    transition: width 0.3s ease;
}

/* 🎪 PARALLAX LAYERS */
.parallax-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    will-change: transform;
}

.parallax-bg {
    transform: translateZ(-1px) scale(2);
}

.parallax-mid {
    transform: translateZ(-0.5px) scale(1.5);
}

.parallax-front {
    transform: translateZ(0);
}

/* 🎭 TEXT REVEAL ANIMATION */
.text-reveal {
    overflow: hidden;
}

.text-reveal .text-line {
    display: block;
    transform: translateY(100%);
    animation: text-reveal-up 0.8s ease forwards;
}

.text-reveal .text-line:nth-child(1) { animation-delay: 0.1s; }
.text-reveal .text-line:nth-child(2) { animation-delay: 0.2s; }
.text-reveal .text-line:nth-child(3) { animation-delay: 0.3s; }

@keyframes text-reveal-up {
    to {
        transform: translateY(0);
    }
}

/* 🌈 COLOR SHIFT ANIMATION */
.color-shift {
    animation: color-shift 4s ease-in-out infinite;
}

@keyframes color-shift {
    0% { filter: hue-rotate(0deg); }
    25% { filter: hue-rotate(90deg); }
    50% { filter: hue-rotate(180deg); }
    75% { filter: hue-rotate(270deg); }
    100% { filter: hue-rotate(360deg); }
}

/* 🎪 INTERACTIVE BUTTON */
.interactive-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.interactive-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s ease;
}

.interactive-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* 🌟 FLOATING ELEMENTS */
.floating-element {
    animation: float-gentle 3s ease-in-out infinite;
}

@keyframes float-gentle {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* 🎨 GLASSMORPHISM ADVANCED */
.glass-advanced {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
}

.glass-advanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

/* 🎪 RESPONSIVE ANIMATIONS */
@media (max-width: 768px) {
    .particle {
        width: 2px;
        height: 2px;
    }
    
    .morphing-shape {
        width: 100px;
        height: 100px;
    }
    
    .custom-cursor {
        display: none;
    }
}

/* 🎨 PREFERS REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
