/* ========================================
   Sparkle Animations - Cubes & Circles
   ======================================== */

/* Sparkle Container */
.sparkle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

/* ========================================
   Sparkle Cubes - 3D Rotating
   ======================================== */
.sparkle-cube {
    position: absolute;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.1) 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    animation: cubeFloat 20s ease-in-out infinite, cubeRotate 15s linear infinite;
    backdrop-filter: blur(2px);
    box-shadow:
        0 0 10px rgba(255, 255, 255, 0.2),
        inset 0 0 10px rgba(255, 255, 255, 0.1);
}

.sparkle-cube::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.5) 50%, transparent 60%);
    animation: shimmer 3s ease-in-out infinite;
}

/* Cube Variants */
.sparkle-cube.cube-sm {
    width: 12px;
    height: 12px;
    animation-duration: 25s, 20s;
}

.sparkle-cube.cube-lg {
    width: 30px;
    height: 30px;
    animation-duration: 18s, 12s;
}

.sparkle-cube.cube-1 {
    top: 10%;
    left: 5%;
    animation-delay: 0s, 0s;
}

.sparkle-cube.cube-2 {
    top: 15%;
    right: 10%;
    animation-delay: -3s, -2s;
}

.sparkle-cube.cube-3 {
    top: 60%;
    left: 15%;
    animation-delay: -5s, -4s;
}

.sparkle-cube.cube-4 {
    top: 70%;
    right: 8%;
    animation-delay: -7s, -6s;
}

.sparkle-cube.cube-5 {
    top: 30%;
    left: 85%;
    animation-delay: -2s, -1s;
}

.sparkle-cube.cube-6 {
    top: 80%;
    left: 50%;
    animation-delay: -4s, -3s;
}

.sparkle-cube.cube-7 {
    top: 5%;
    left: 40%;
    animation-delay: -6s, -5s;
}

.sparkle-cube.cube-8 {
    top: 45%;
    right: 3%;
    animation-delay: -8s, -7s;
}

@keyframes cubeRotate {
    0% {
        transform: rotate(0deg) rotateX(0deg) rotateY(0deg);
    }

    25% {
        transform: rotate(90deg) rotateX(90deg) rotateY(45deg);
    }

    50% {
        transform: rotate(180deg) rotateX(180deg) rotateY(90deg);
    }

    75% {
        transform: rotate(270deg) rotateX(270deg) rotateY(135deg);
    }

    100% {
        transform: rotate(360deg) rotateX(360deg) rotateY(180deg);
    }
}

@keyframes cubeFloat {

    0%,
    100% {
        transform: translateY(0) translateX(0);
    }

    25% {
        transform: translateY(-15px) translateX(10px);
    }

    50% {
        transform: translateY(-5px) translateX(-8px);
    }

    75% {
        transform: translateY(-20px) translateX(5px);
    }
}

/* ========================================
   Sparkle Circles - Pulsing & Rotating
   ======================================== */
.sparkle-circle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.1) 60%, transparent 70%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    animation: circleOrbit 30s linear infinite, circlePulse 4s ease-in-out infinite;
    box-shadow:
        0 0 20px rgba(255, 255, 255, 0.15),
        inset 0 0 15px rgba(255, 255, 255, 0.1);
}

.sparkle-circle::after {
    content: '';
    position: absolute;
    top: 10%;
    left: 20%;
    width: 30%;
    height: 20%;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    filter: blur(2px);
}

/* Circle Variants */
.sparkle-circle.circle-sm {
    width: 16px;
    height: 16px;
}

.sparkle-circle.circle-md {
    width: 24px;
    height: 24px;
}

.sparkle-circle.circle-lg {
    width: 36px;
    height: 36px;
}

.sparkle-circle.circle-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s, 0s;
}

.sparkle-circle.circle-2 {
    top: 50%;
    right: 15%;
    animation-delay: -5s, -1s;
}

.sparkle-circle.circle-3 {
    top: 75%;
    left: 25%;
    animation-delay: -10s, -2s;
}

.sparkle-circle.circle-4 {
    top: 35%;
    right: 5%;
    animation-delay: -15s, -3s;
}

.sparkle-circle.circle-5 {
    top: 10%;
    left: 60%;
    animation-delay: -8s, -1.5s;
}

.sparkle-circle.circle-6 {
    top: 85%;
    right: 30%;
    animation-delay: -12s, -2.5s;
}

@keyframes circleOrbit {
    0% {
        transform: rotate(0deg) translateX(5px) rotate(0deg);
    }

    100% {
        transform: rotate(360deg) translateX(5px) rotate(-360deg);
    }
}

@keyframes circlePulse {

    0%,
    100% {
        opacity: 0.6;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* ========================================
   Shimmer Effect
   ======================================== */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* ========================================
   Floating Particles
   ======================================== */
.sparkle-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: particleFloat 15s ease-in-out infinite, particleFade 3s ease-in-out infinite;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
}

.sparkle-particle.particle-1 {
    top: 25%;
    left: 20%;
    animation-delay: 0s, 0s;
}

.sparkle-particle.particle-2 {
    top: 45%;
    left: 75%;
    animation-delay: -2s, -0.5s;
}

.sparkle-particle.particle-3 {
    top: 65%;
    left: 35%;
    animation-delay: -4s, -1s;
}

.sparkle-particle.particle-4 {
    top: 15%;
    left: 55%;
    animation-delay: -6s, -1.5s;
}

.sparkle-particle.particle-5 {
    top: 80%;
    left: 80%;
    animation-delay: -8s, -2s;
}

.sparkle-particle.particle-6 {
    top: 55%;
    left: 10%;
    animation-delay: -3s, -0.75s;
}

.sparkle-particle.particle-7 {
    top: 35%;
    left: 90%;
    animation-delay: -5s, -1.25s;
}

.sparkle-particle.particle-8 {
    top: 90%;
    left: 45%;
    animation-delay: -7s, -1.75s;
}

@keyframes particleFloat {

    0%,
    100% {
        transform: translateY(0) translateX(0);
    }

    25% {
        transform: translateY(-30px) translateX(15px);
    }

    50% {
        transform: translateY(-10px) translateX(-10px);
    }

    75% {
        transform: translateY(-25px) translateX(8px);
    }
}

@keyframes particleFade {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

/* ========================================
   Star Sparkle Effect
   ======================================== */
.sparkle-star {
    position: absolute;
    width: 8px;
    height: 8px;
    animation: starTwinkle 2s ease-in-out infinite;
}

.sparkle-star::before,
.sparkle-star::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
}

.sparkle-star::before {
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    transform: translateY(-50%);
    border-radius: 1px;
}

.sparkle-star::after {
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    transform: translateX(-50%);
    border-radius: 1px;
}

.sparkle-star.star-1 {
    top: 30%;
    left: 15%;
    animation-delay: 0s;
}

.sparkle-star.star-2 {
    top: 60%;
    right: 20%;
    animation-delay: -0.5s;
}

.sparkle-star.star-3 {
    top: 20%;
    right: 35%;
    animation-delay: -1s;
}

.sparkle-star.star-4 {
    top: 70%;
    left: 40%;
    animation-delay: -1.5s;
}

.sparkle-star.star-5 {
    top: 40%;
    left: 70%;
    animation-delay: -0.75s;
}

@keyframes starTwinkle {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(0.8) rotate(0deg);
    }

    50% {
        opacity: 1;
        transform: scale(1.2) rotate(45deg);
    }
}

/* ========================================
   Glowing Ring Effect
   ======================================== */
.sparkle-ring {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: ringPulse 4s ease-in-out infinite, ringRotate 20s linear infinite;
}

.sparkle-ring.ring-sm {
    width: 40px;
    height: 40px;
}

.sparkle-ring.ring-md {
    width: 60px;
    height: 60px;
}

.sparkle-ring.ring-lg {
    width: 80px;
    height: 80px;
}

.sparkle-ring.ring-1 {
    top: 20%;
    left: 5%;
    animation-delay: 0s, 0s;
}

.sparkle-ring.ring-2 {
    bottom: 25%;
    right: 10%;
    animation-delay: -2s, -5s;
}

.sparkle-ring.ring-3 {
    top: 50%;
    right: 25%;
    animation-delay: -1s, -10s;
}

@keyframes ringPulse {

    0%,
    100% {
        opacity: 0.2;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

@keyframes ringRotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ========================================
   Reduce Motion for Accessibility
   ======================================== */
@media (prefers-reduced-motion: reduce) {

    .sparkle-cube,
    .sparkle-circle,
    .sparkle-particle,
    .sparkle-star,
    .sparkle-ring {
        animation: none;
    }
}