/**
 * Shared Animations CSS
 * Reusable animations for multiple pages
 * GPU-accelerated and performance optimized
 */

/* ============================================
   FADE IN ANIMATIONS
   ============================================ */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

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

.fade-in {
    animation: fade-in 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    will-change: opacity, transform;
}

.fade-in-up {
    opacity: 0;
    transform: translate3d(0, 40px, 0);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

.fade-in-up.animate {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    will-change: auto;
}

.fade-in-down {
    animation: fade-in-down 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    will-change: opacity, transform;
}

/* ============================================
   CARD HOVER EFFECTS
   ============================================ */
.card-hover-effect {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform, box-shadow;
}

.card-hover-effect:hover {
    transform: translate3d(0, -8px, 0) scale(1.02);
    box-shadow: 0 20px 60px rgba(57, 242, 255, 0.3),
                0 0 30px rgba(155, 93, 255, 0.2);
}

/* ============================================
   BUTTON ENHANCED EFFECTS
   ============================================ */
.btn-enhanced {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform, box-shadow;
}

.btn-enhanced:hover {
    transform: translate3d(0, -4px, 0) scale(1.05);
    box-shadow: 0 12px 40px rgba(57, 242, 255, 0.4),
                0 0 25px rgba(155, 93, 255, 0.3);
}

.btn-enhanced:active {
    transform: translate3d(0, -2px, 0) scale(1.02);
}

/* ============================================
   FORM FIELD ANIMATIONS
   ============================================ */
.form-field-enhanced {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: border-color, box-shadow, transform;
}

.form-field-enhanced:focus {
    transform: translate3d(0, -2px, 0);
    box-shadow: 0 8px 24px rgba(57, 242, 255, 0.2),
                0 0 0 3px rgba(57, 242, 255, 0.1);
}

/* ============================================
   PULSE & GLOW EFFECTS
   ============================================ */
@keyframes pulse-glow {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(57, 242, 255, 0.3),
                    0 0 40px rgba(155, 93, 255, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(57, 242, 255, 0.5),
                    0 0 60px rgba(155, 93, 255, 0.4);
    }
}

.pulse-glow {
    animation: pulse-glow 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    will-change: opacity, transform;
}

.glow-pulse {
    animation: glow-pulse 3s ease-in-out infinite;
    will-change: box-shadow;
}

/* ============================================
   SLIDE IN ANIMATIONS
   ============================================ */
@keyframes slide-in-left {
    from {
        opacity: 0;
        transform: translate3d(-50px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translate3d(50px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.slide-in-left {
    animation: slide-in-left 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    will-change: opacity, transform;
}

.slide-in-right {
    animation: slide-in-right 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    will-change: opacity, transform;
}

/* ============================================
   SCALE ANIMATIONS
   ============================================ */
@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    animation: scale-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    will-change: opacity, transform;
}

/* ============================================
   SHIMMER EFFECT
   ============================================ */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

/* ============================================
   RESPECT USER PREFERENCES
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .fade-in,
    .fade-in-up,
    .fade-in-down,
    .slide-in-left,
    .slide-in-right,
    .scale-in,
    .pulse-glow,
    .glow-pulse,
    .shimmer {
        animation: none;
        opacity: 1;
        transform: none;
        transition: none;
    }
    
    .card-hover-effect:hover,
    .btn-enhanced:hover {
        transform: none;
    }
}

