/* Este archivo contendrá estilos para animaciones más complejas y efectos visuales */

/* Loader Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--dark-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease-out;
}

.loader-circle {
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loader-text {
    color: var(--light-text);
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 1px;
    opacity: 0;
    animation: fadeInText 1.5s forwards 0.5s;
}

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

@keyframes fadeInText {
    to { opacity: 1; }
}

/* Hero Section Background Elements */
.hero-background-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

/* Glitch Effect */
.glitch-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.1);
    opacity: 0.1;
    pointer-events: none;
    animation: subtleGlitch 10s infinite linear alternate;
}

@keyframes subtleGlitch {
    0%, 100% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%); }
    20% { clip-path: polygon(0 5%, 100% 0, 100% 95%, 0% 100%); }
    40% { clip-path: polygon(0 10%, 100% 15%, 100% 100%, 0% 90%); }
    60% { clip-path: polygon(0 0, 100% 10%, 100% 100%, 0% 90%); }
    80% { clip-path: polygon(0 15%, 100% 0, 100% 85%, 0% 100%); }
}

/* Gradient Overlay Animation */
.gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(37, 117, 252, 0.2), rgba(106, 17, 203, 0.2), rgba(0, 224, 255, 0.2));
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    opacity: 0.7;
    pointer-events: none;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Particles.js (handled by JS, but define a container) */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0; /* Asegurarse de que esté detrás del contenido */
}

/* Floating Shapes Group (Parallax Effect) */
.floating-shapes-group {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    perspective: 1000px; /* Para efectos 3D */
}

.shape {
    position: absolute;
    background-color: var(--primary-color);
    opacity: 0.1;
    border-radius: 50%;
    filter: blur(5px);
    animation: floatShape 15s infinite ease-in-out;
}

.shape-1 { width: 100px; height: 100px; top: 10%; left: 15%; animation-duration: 18s; background-color: var(--secondary-color); }
.shape-2 { width: 80px; height: 80px; bottom: 20%; right: 10%; animation-duration: 12s; }
.shape-3 { width: 120px; height: 120px; top: 30%; right: 25%; animation-duration: 20s; background-color: #00e0ff; }
.shape-4 { width: 70px; height: 70px; bottom: 5%; left: 30%; animation-duration: 16s; }

@keyframes floatShape {
    0%, 100% { transform: translateY(0) translateX(0) scale(1); }
    25% { transform: translateY(-20px) translateX(10px) scale(1.05); }
    50% { transform: translateY(0) translateX(-15px) scale(0.95); }
    75% { transform: translateY(15px) translateX(5px) scale(1); }
}

/* Hero Sparkles */
.hero-sparkles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Implementar con JS para mayor control (ej. generar div por cada sparkle) */
}

/* Text Gradient Highlight Animation */
.highlight-text {
    animation: textGradientPulse 4s infinite ease-in-out alternate;
    text-shadow: 0 0 10px rgba(0, 224, 255, 0.4), 0 0 20px rgba(167, 39, 255, 0.3);
}

@keyframes textGradientPulse {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}


/* Button Hover Effects */
.btn-animated {
    position: relative;
    overflow: hidden;
}
.btn-animated span {
    position: relative;
    z-index: 2;
}
.btn-animated .icon-animated {
    transition: transform 0.3s ease;
}

.btn-primary:hover .icon-animated {
    transform: translateX(5px);
}
.btn-secondary:hover .icon-animated {
    transform: translateX(5px);
}

/* Button 3D Hover (Conceptual - requires JS for true 3D tilt) */
.btn-hover-3d {
    transform-style: preserve-3d;
    transform: rotateX(0deg) rotateY(0deg);
}
/* JS would dynamically apply transforms like:
   transform: perspective(1000px) rotateX(var(--rotateX)) rotateY(var(--rotateY));
*/

/* Service Card Icon Pulse */
.service-card .icon-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--primary-color);
    opacity: 0;
    transform: scale(0.5);
    z-index: 0;
}
.service-card:hover .icon-pulse {
    animation: iconPulse 1s ease-out forwards;
}

@keyframes iconPulse {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); opacity: 0.3; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Service Card Hover Effect */
.service-card .service-hover-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(37, 117, 252, 0.1), rgba(106, 17, 203, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}
.service-card:hover .service-hover-effect {
    opacity: 1;
}

/* Vision Values Glow Effect */
.value-item .value-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(37, 117, 252, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: valueGlow 2s infinite alternate ease-in-out;
    pointer-events: none;
    z-index: 0;
}
.value-item:hover .value-glow {
    animation: valueGlow 2s infinite alternate ease-in-out;
}

@keyframes valueGlow {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.5; }
    100% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

/* Vision Image Glow Effect */
.vision-glow-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    max-width: 800px;
    max-height: 500px;
    background: radial-gradient(circle at center, rgba(37, 117, 252, 0.2), rgba(106, 17, 203, 0.1) 50%, transparent 80%);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(1.1);
    filter: blur(30px);
    opacity: 0.6;
    animation: heroGlow 8s infinite alternate ease-in-out;
    z-index: 1;
}

@keyframes heroGlow {
    0% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.6; }
}


/* Vision Cube Animation (Conceptual, will be complex JS/WebGL) */
.vision-cube-animation {
    position: absolute;
    top: 20%;
    left: 10%;
    width: 150px;
    height: 150px;
    background: transparent; /* No visible con CSS puro, solo para la estructura */
    /* This element would be controlled by Three.js or similar for 3D animation */
    /* For a placeholder, you can make it a simple rotating square */
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 15px var(--primary-color);
    animation: rotateCube 15s infinite linear;
    opacity: 0.2;
    z-index: 1;
}

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

/* Scroll Reveal (Handled by JS ScrollReveal.js) */
.reveal-section, .reveal-item {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal-section.is-revealed, .reveal-item.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Hover effect for Nav Links (defined in main.css as :before and :after) */
/* This is an example for how to make the hover effect more prominent */
.nav-link-hover {
    overflow: hidden;
}
.nav-link-hover:before {
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}
.nav-link-hover:hover:before {
    transform: translateY(0);
}

/* Example: Splitting.js for text animation */
.hero-title .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

/* Animating after JS Splitting.js and a delay */
.hero-title.animated .word {
    opacity: 1;
    transform: translateY(0);
}


/* General animations (if used with animate.css classes) */
.animate__animated {
    animation-duration: 1s;
    animation-fill-mode: both;
}

/* Hide content until JS loads it */
#main-content-wrapper {
    transition: opacity 1s ease-in-out;
}