/* ============================================================
   ANIMATIONS.CSS
   Portfolio Dark Tech Premium - Jessie Sarcinella
   Solo keyframes, transizioni e classi di animazione.
   ============================================================ */


/* ------------------------------------------------------------
   1. LOADER
   ------------------------------------------------------------ */

@keyframes loaderPulse {
    0%, 100% {
        text-shadow:
            0 0 20px rgba(108, 99, 255, 0),
            0 0 40px rgba(108, 99, 255, 0);
    }
    50% {
        text-shadow:
            0 0 20px rgba(108, 99, 255, 0.6),
            0 0 40px rgba(108, 99, 255, 0.3);
    }
}

@keyframes loaderBar {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

@keyframes loaderFadeOut {
    0% {
        opacity: 1;
        visibility: visible;
    }
    100% {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

.loader-logo {
    animation: loaderPulse 1.5s ease-in-out infinite;
}

.loader-bar-fill {
    animation: loaderBar 2s ease-in-out forwards;
}

.loader.loaded {
    animation: loaderFadeOut 0.6s ease-out forwards;
    pointer-events: none;
}


/* ------------------------------------------------------------
   2. BADGE DOT PULSANTE
   ------------------------------------------------------------ */

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.5);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

.badge-dot {
    position: relative;
}

.badge-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #22c55e;
    transform: translate(-50%, -50%);
    animation: pulse 2s ease-in-out infinite;
}


/* ------------------------------------------------------------
   3. SCROLL INDICATOR
   ------------------------------------------------------------ */

@keyframes scrollLine {
    0% {
        height: 0;
        opacity: 1;
    }
    50% {
        height: 24px;
        opacity: 1;
    }
    100% {
        height: 0;
        opacity: 0;
    }
}


/* ------------------------------------------------------------
   4. TEXT REVEAL (fallback CSS, GSAP override quando presente)
   ------------------------------------------------------------ */

/* Tutti gli elementi sempre visibili — nessuna animazione di reveal */
.reveal-text,
.reveal-card {
    opacity: 1 !important;
    transform: none !important;
}


/* ------------------------------------------------------------
   5. GLOW PULSANTE
   ------------------------------------------------------------ */

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(108, 99, 255, 0.15);
    }
    50% {
        box-shadow: 0 0 30px rgba(108, 99, 255, 0.4);
    }
}

.btn-glow {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    animation: glowPulse 3s ease-in-out infinite;
    pointer-events: none;
}

.logo-glow {
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    animation: glowPulse 3s ease-in-out infinite;
    pointer-events: none;
}


/* ------------------------------------------------------------
   7. AURORA GRADIENT (Contact Section)
   ------------------------------------------------------------ */

@keyframes aurora {
    0% {
        filter: hue-rotate(0deg);
        transform: rotate(0deg) scale(1.2);
    }
    100% {
        filter: hue-rotate(360deg);
        transform: rotate(360deg) scale(1.2);
    }
}

.contact-aurora {
    position: absolute;
    inset: -50%;
    background: conic-gradient(
        from 0deg,
        rgba(108, 99, 255, 0.08),
        rgba(0, 212, 255, 0.06),
        rgba(139, 92, 246, 0.08),
        rgba(108, 99, 255, 0.06),
        rgba(0, 212, 255, 0.08)
    );
    animation: aurora 15s linear infinite;
    pointer-events: none;
    z-index: 0;
}


/* ------------------------------------------------------------
   10. STAGGER DELAYS UTILITY
   ------------------------------------------------------------ */

.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }


/* ------------------------------------------------------------
   11. FLOATING ANIMATION
   ------------------------------------------------------------ */

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

.float {
    animation: float 6s ease-in-out infinite;
}


/* ------------------------------------------------------------
   12. MAGNETIC BUTTON HOVER
   ------------------------------------------------------------ */

.magnetic-btn {
    transition: transform 0.2s ease-out;
}


/* ------------------------------------------------------------
   REDUCED MOTION
   Rispetta le preferenze di accessibilita dell'utente.
   ------------------------------------------------------------ */

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

    .reveal-text,
    .reveal-card {
        opacity: 1;
        transform: none;
    }
}
