/* custom-effects.css - Efectos visuales y animaciones personalizadas */

/* ========================================
   EFECTO DINÁMICO: SECCIONES bg-light-custom
   El fondo se vuelve más celeste según el scroll
   y se reinicia en cada sección
   ======================================== */
.bg-light-custom {
    /* Valores iniciales (se actualizan dinámicamente con JS) */
    --bg-alpha: 0.08;
    --bg-alpha-alt: 0.06;
    
    background: linear-gradient(180deg, 
        rgba(21,101,192,var(--bg-alpha)) 0%, 
        rgba(66,165,245,var(--bg-alpha-alt)) 100%);
    
    transition: background 110ms linear, 
                box-shadow 110ms linear, 
                transform 110ms linear;
    position: relative;
    z-index: 1;
}

.bg-light-custom::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: inherit;
    border-radius: inherit;
    transition: opacity 110ms linear;
}

.bg-light-custom > * {
    position: relative;
    z-index: 2;
}

/* Sombra ligera que se activa con el scroll para dar más feedback visual */
.bg-light-custom._lit {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(33,150,243,0.06);
}

/* ========================================
   CUSTOM CURSOR (Desktop)
   ======================================== */
.custom-cursor {
    width: 32px;
    height: 32px;
    border: 2px solid var(--secondary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    transition: transform 0.15s ease-out, border-color 0.2s;
    transform: translate(-50%, -50%);
}

.custom-cursor.hover {
    transform: translate(-50%, -50%) scale(1.5);
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.custom-cursor.click {
    transform: translate(-50%, -50%) scale(0.8);
}

.custom-cursor-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 10001;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease-out;
}

.custom-cursor-dot.hover {
    background: var(--secondary);
}

.cursor-trail {
    width: 6px;
    height: 6px;
    background: var(--light);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    animation: trail-fade 0.6s ease-out forwards;
}

@keyframes trail-fade {
    0% {
        opacity: 0.8;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.3);
    }
}

/* ========================================
   TOUCH EFFECTS (Mobile)
   ======================================== */
.touch-ripple {
    width: 40px;
    height: 40px;
    border: 3px solid var(--secondary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    animation: ripple-expand 0.8s ease-out forwards;
}

@keyframes ripple-expand {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(3);
    }
}

.touch-particle {
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    animation: particle-burst 0.8s ease-out forwards;
}

@keyframes particle-burst {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) scale(0.2);
    }
}

.touch-feedback {
    width: 60px;
    height: 60px;
    border: 4px solid var(--primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    animation: feedback-pulse 0.5s ease-out forwards;
}

@keyframes feedback-pulse {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.8);
    }
}

/* ========================================
   CTA PULSE ANIMATION
   ======================================== */
.cta-pulse {
    animation: cta-pulse-anim 2s ease-in-out infinite;
}

@keyframes cta-pulse-anim {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    }
    50% {
        box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
    }
}

/* ========================================
   ACCORDION ANIMATIONS
   ======================================== */
.accordion-reveal-fade-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.accordion-reveal-fade-up._visible {
    opacity: 1;
    transform: translateY(0);
}

.accordion-reveal-slide-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.accordion-reveal-slide-left._visible {
    opacity: 1;
    transform: translateX(0);
}

.accordion-reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

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

/* ========================================
   SERVICES CARDS POP ANIMATION
   ======================================== */
.services-pop {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.services-pop._visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ========================================
   SECTION TITLE REVEAL
   ======================================== */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal-up._visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   CONFETTI PIECES
   ======================================== */
.confetti-piece {
    position: fixed;
    width: 10px;
    height: 10px;
    pointer-events: none;
    z-index: 9999;
    animation: confetti-fall 2s ease-out forwards;
}

@keyframes confetti-fall {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(400px) rotate(720deg);
    }
}

/* ========================================
   MOBILE CTA BAR
   ======================================== */
.mobile-cta-bar {
    position: fixed;
    bottom: -100px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 1rem;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    z-index: 1040;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-cta-bar.visible {
    bottom: 0;
}

.mobile-cta-btn {
    display: block;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: white;
    color: var(--primary);
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.mobile-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* ========================================
   FADE IN ANIMATIONS
   ======================================== */
.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

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

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */
@media (max-width: 768px) {
    .custom-cursor,
    .custom-cursor-dot,
    .cursor-trail {
        display: none !important;
    }
    
    .cta-pulse {
        animation: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .bg-light-custom {
        transition: none !important;
    }
}
