/**
 * Animaciones y Efectos - Kayros Sorteos Perú
 * Partículas, Scroll Reveal, Efectos Hover
 */

/* ============================================
   PARTÍCULAS FLOTANTES (Light Mode)
   ============================================ */
.particle {
    position: fixed;
    pointer-events: none;
    z-index: 1;
    opacity: 0.15;
}

.particle.icon {
    font-size: 20px;
}

.particle.color-red {
    color: var(--kayros-red);
}

.particle.color-blue {
    color: var(--kayros-blue);
}

.particle.color-gold {
    color: var(--kayros-gold);
}

@keyframes float-up {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.15;
    }
    90% {
        opacity: 0.15;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

.particle {
    animation: float-up linear infinite;
}

/* ============================================
   ICONOS FLOTANTES
   ============================================ */
.floating-icon {
    position: fixed;
    pointer-events: none;
    z-index: 2;
    opacity: 0.2;
    font-size: 24px;
}

@keyframes float-icon {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(10px, -10px) rotate(5deg);
    }
    50% {
        transform: translate(0, -20px) rotate(0deg);
    }
    75% {
        transform: translate(-10px, -10px) rotate(-5deg);
    }
}

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

/* ============================================
   ICONOS SOCIALES GRANDES (Reducidos vs Dark)
   ============================================ */
.big-social-icon {
    position: fixed;
    pointer-events: none;
    z-index: 1;
    opacity: 0.05;
    font-size: 120px;
}

@keyframes big-float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -30px) rotate(10deg);
    }
    66% {
        transform: translate(-30px, 30px) rotate(-10deg);
    }
}

.big-social-icon {
    animation: big-float 20s ease-in-out infinite;
}

/* ============================================
   SCROLL REVEAL
   ============================================ */
[data-scroll-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

[data-scroll-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

[data-scroll-reveal="fade-left"] {
    transform: translateX(-30px);
}

[data-scroll-reveal="fade-right"] {
    transform: translateX(30px);
}

[data-scroll-reveal="fade-up"] {
    transform: translateY(30px);
}

[data-scroll-reveal="zoom-in"] {
    transform: scale(0.9);
}

[data-scroll-reveal].revealed {
    transform: translateX(0) translateY(0) scale(1);
}

/* ============================================
   TEXT SHINE EFFECT
   ============================================ */
.text-shine {
    background: linear-gradient(
        90deg,
        var(--text-dark) 25%,
        var(--kayros-gold) 50%,
        var(--text-dark) 75%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: text-shine 3s ease-in-out infinite;
}

@keyframes text-shine {
    0%, 100% {
        background-position: 0% center;
    }
    50% {
        background-position: 200% center;
    }
}

/* ============================================
   GLOW EFFECT
   ============================================ */
.glow-red {
    animation: glow-red 2s ease-in-out infinite alternate;
}

@keyframes glow-red {
    from {
        box-shadow: 0 0 10px rgba(227, 28, 37, 0.3);
    }
    to {
        box-shadow: 0 0 25px rgba(227, 28, 37, 0.6);
    }
}

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

@keyframes glow-gold {
    from {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    }
    to {
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
    }
}

/* ============================================
   HOVER EFFECTS
   ============================================ */
.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
}

.hover-scale {
    transition: transform var(--transition-base);
}

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

.hover-rotate {
    transition: transform var(--transition-base);
}

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

/* ============================================
   PULSE ANIMATION
   ============================================ */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* ============================================
   BOUNCE ANIMATION
   ============================================ */
.bounce {
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(-5%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

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

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in-up {
    animation: fade-in-up 0.6s ease-out;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-down {
    animation: fade-in-down 0.6s ease-out;
}

@keyframes fade-in-down {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   FLIP IN ANIMATION (Countdown)
   ============================================ */
@keyframes flipIn {
    0% {
        transform: perspective(400px) rotateX(-90deg);
        opacity: 0;
    }
    40% {
        transform: perspective(400px) rotateX(20deg);
    }
    60% {
        transform: perspective(400px) rotateX(-10deg);
        opacity: 1;
    }
    80% {
        transform: perspective(400px) rotateX(5deg);
    }
    100% {
        transform: perspective(400px) rotateX(0deg);
        opacity: 1;
    }
}

/* ============================================
   SKELETON LOADING
   ============================================ */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-gray-200) 25%,
        var(--bg-gray-100) 50%,
        var(--bg-gray-200) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   PARALLAX EFFECT (Solo Desktop)
   ============================================ */
@media (min-width: 768px) and (hover: hover) {
    .parallax-container {
        perspective: 1000px;
    }

    .parallax-item {
        transition: transform 0.3s ease-out;
        transform-style: preserve-3d;
    }
}

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

    .particle,
    .floating-icon,
    .big-social-icon {
        display: none;
    }
}
