/**
 * Numerology Pro - Animations & Effects
 * Beautiful mystical animations for a magical experience
 * 
 * @package Numerology_Pro
 * @author Saysix - Fernando Camargo Candido
 */

/* =================================================================
   Keyframe Animations
   ================================================================= */

/* Fade In Animations */
@keyframes np-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes np-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes np-fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes np-fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes np-fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale Animations */
@keyframes np-scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes np-scaleUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes np-bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Rotation Animations */
@keyframes np-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes np-spinSlow {
    to {
        transform: rotate(360deg);
    }
}

/* Pulse & Glow Effects */
@keyframes np-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes np-pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(124, 58, 237, 0.6);
    }
}

@keyframes np-pulseGoldGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(245, 158, 11, 0.6);
    }
}

@keyframes np-breathe {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* Floating Animation */
@keyframes np-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes np-floatRotate {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-5px) rotate(2deg);
    }
    50% {
        transform: translateY(-10px) rotate(0deg);
    }
    75% {
        transform: translateY(-5px) rotate(-2deg);
    }
}

/* Shimmer Effect */
@keyframes np-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Twinkle Effect */
@keyframes np-twinkle {
    0%, 100% {
        opacity: 0.2;
        transform: scale(1) rotate(0deg);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.2) rotate(15deg);
    }
}

@keyframes np-sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Gradient Animation */
@keyframes np-gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Number Count Animation */
@keyframes np-countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ripple Effect */
@keyframes np-ripple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Wave Animation */
@keyframes np-wave {
    0%, 100% {
        transform: translateX(0) translateY(0);
    }
    25% {
        transform: translateX(5px) translateY(-5px);
    }
    50% {
        transform: translateX(0) translateY(-10px);
    }
    75% {
        transform: translateX(-5px) translateY(-5px);
    }
}

/* Typing Animation */
@keyframes np-typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes np-blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* Particle Background */
@keyframes np-particleFloat {
    0% {
        transform: translateY(100%) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100%) translateX(50px) rotate(360deg);
        opacity: 0;
    }
}

/* =================================================================
   Animation Utility Classes
   ================================================================= */

/* Fade Animations */
.np-animate-fadeIn {
    animation: np-fadeIn 0.5s ease forwards;
}

.np-animate-fadeInUp {
    animation: np-fadeInUp 0.5s ease forwards;
}

.np-animate-fadeInDown {
    animation: np-fadeInDown 0.5s ease forwards;
}

.np-animate-fadeInLeft {
    animation: np-fadeInLeft 0.5s ease forwards;
}

.np-animate-fadeInRight {
    animation: np-fadeInRight 0.5s ease forwards;
}

/* Scale Animations */
.np-animate-scaleIn {
    animation: np-scaleIn 0.4s ease forwards;
}

.np-animate-scaleUp {
    animation: np-scaleUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.np-animate-bounceIn {
    animation: np-bounceIn 0.6s ease forwards;
}

/* Continuous Animations */
.np-animate-spin {
    animation: np-spin 1s linear infinite;
}

.np-animate-spinSlow {
    animation: np-spinSlow 10s linear infinite;
}

.np-animate-pulse {
    animation: np-pulse 2s ease-in-out infinite;
}

.np-animate-pulseGlow {
    animation: np-pulseGlow 2s ease-in-out infinite;
}

.np-animate-pulseGoldGlow {
    animation: np-pulseGoldGlow 2s ease-in-out infinite;
}

.np-animate-breathe {
    animation: np-breathe 4s ease-in-out infinite;
}

.np-animate-float {
    animation: np-float 3s ease-in-out infinite;
}

.np-animate-floatRotate {
    animation: np-floatRotate 6s ease-in-out infinite;
}

.np-animate-twinkle {
    animation: np-twinkle 3s ease-in-out infinite;
}

/* Shimmer Effect */
.np-shimmer {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: np-shimmer 2s linear infinite;
}

/* Gradient Animation */
.np-animate-gradient {
    background-size: 200% 200%;
    animation: np-gradientShift 5s ease infinite;
}

/* =================================================================
   Staggered Animation Delays
   ================================================================= */
.np-delay-1 { animation-delay: 0.1s; }
.np-delay-2 { animation-delay: 0.2s; }
.np-delay-3 { animation-delay: 0.3s; }
.np-delay-4 { animation-delay: 0.4s; }
.np-delay-5 { animation-delay: 0.5s; }
.np-delay-6 { animation-delay: 0.6s; }
.np-delay-7 { animation-delay: 0.7s; }
.np-delay-8 { animation-delay: 0.8s; }
.np-delay-9 { animation-delay: 0.9s; }
.np-delay-10 { animation-delay: 1s; }

/* =================================================================
   Animation Duration Modifiers
   ================================================================= */
.np-duration-fast { animation-duration: 0.2s; }
.np-duration-normal { animation-duration: 0.4s; }
.np-duration-slow { animation-duration: 0.8s; }
.np-duration-slower { animation-duration: 1.2s; }

/* =================================================================
   Hover Animations
   ================================================================= */
.np-hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.np-hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.np-hover-scale {
    transition: transform 0.3s ease;
}

.np-hover-scale:hover {
    transform: scale(1.05);
}

.np-hover-glow {
    transition: box-shadow 0.3s ease;
}

.np-hover-glow:hover {
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.4);
}

.np-hover-goldGlow {
    transition: box-shadow 0.3s ease;
}

.np-hover-goldGlow:hover {
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.4);
}

/* =================================================================
   Ripple Button Effect
   ================================================================= */
.np-ripple-effect {
    position: relative;
    overflow: hidden;
}

.np-ripple-effect::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.3) 10%, transparent 10%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10);
    opacity: 0;
    transition: transform 0.5s, opacity 0.5s;
}

.np-ripple-effect:active::after {
    transform: scale(0);
    opacity: 1;
    transition: 0s;
}

/* =================================================================
   Loading Skeleton Animation
   ================================================================= */
.np-skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: np-shimmer 1.5s infinite;
    border-radius: 8px;
}

.np-skeleton-text {
    height: 16px;
    margin-bottom: 10px;
}

.np-skeleton-title {
    height: 28px;
    width: 60%;
    margin-bottom: 16px;
}

.np-skeleton-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

/* =================================================================
   Number Reveal Animation
   ================================================================= */
.np-number-reveal {
    opacity: 0;
    transform: scale(0.5) rotateY(90deg);
    animation: np-numberReveal 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes np-numberReveal {
    0% {
        opacity: 0;
        transform: scale(0.5) rotateY(90deg);
    }
    50% {
        transform: scale(1.1) rotateY(-10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

/* =================================================================
   Card Reveal Animation
   ================================================================= */
.np-card-reveal {
    opacity: 0;
    transform: translateY(40px) rotateX(-10deg);
    animation: np-cardReveal 0.6s ease forwards;
}

@keyframes np-cardReveal {
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0deg);
    }
}

/* =================================================================
   Mystical Particles Background
   ================================================================= */
.np-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.np-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: np-particleFloat 8s linear infinite;
}

.np-particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 10s; }
.np-particle:nth-child(2) { left: 20%; animation-delay: 1s; animation-duration: 12s; }
.np-particle:nth-child(3) { left: 30%; animation-delay: 2s; animation-duration: 9s; }
.np-particle:nth-child(4) { left: 40%; animation-delay: 3s; animation-duration: 11s; }
.np-particle:nth-child(5) { left: 50%; animation-delay: 4s; animation-duration: 10s; }
.np-particle:nth-child(6) { left: 60%; animation-delay: 5s; animation-duration: 13s; }
.np-particle:nth-child(7) { left: 70%; animation-delay: 6s; animation-duration: 9s; }
.np-particle:nth-child(8) { left: 80%; animation-delay: 7s; animation-duration: 11s; }
.np-particle:nth-child(9) { left: 90%; animation-delay: 8s; animation-duration: 10s; }

/* =================================================================
   Star Field Background
   ================================================================= */
.np-starfield {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.np-star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: np-twinkle 3s ease-in-out infinite;
}

.np-star.small {
    width: 2px;
    height: 2px;
}

.np-star.medium {
    width: 3px;
    height: 3px;
}

.np-star.large {
    width: 4px;
    height: 4px;
}

/* =================================================================
   Reduce Motion Preference
   ================================================================= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =================================================================
   Print - Disable Animations
   ================================================================= */
@media print {
    * {
        animation: none !important;
        transition: none !important;
    }
}
