/* ===================================
   EasyDL - Dark Carnival Theme
   Animations Stylesheet
   =================================== */

/* === Flickering Lights === */
@keyframes flicker {
    0%, 100% { opacity: 1; }
    10% { opacity: 0.95; }
    20% { opacity: 1; }
    30% { opacity: 0.9; }
    40% { opacity: 1; }
    50% { opacity: 0.85; }
    60% { opacity: 1; }
    70% { opacity: 0.95; }
    80% { opacity: 1; }
    90% { opacity: 0.9; }
}

.flicker {
    animation: flicker 5s ease-in-out infinite;
}

/* === Floating Elements === */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

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

/* === Pulse Effect === */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* === Glitch Effect === */
@keyframes glitch {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
    100% {
        transform: translate(0);
    }
}

.glitch:hover {
    animation: glitch 0.3s ease-in-out;
}

/* === Glitch with Color Separation === */
@keyframes glitch-color {
    0% {
        text-shadow: 0 0 0 transparent;
    }
    25% {
        text-shadow: -2px 0 0 #ff00ff, 2px 0 0 #00ffff;
    }
    50% {
        text-shadow: 2px 0 0 #ff00ff, -2px 0 0 #00ffff;
    }
    75% {
        text-shadow: -2px 0 0 #00ffff, 2px 0 0 #ff00ff;
    }
    100% {
        text-shadow: 0 0 0 transparent;
    }
}

.glitch-color:hover {
    animation: glitch-color 0.5s ease-in-out;
}

/* === Fade In === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* === Slide In from Left === */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

/* === Slide In from Right === */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

/* === Spinning Loader === */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 2s linear infinite;
}

/* === Carousel Spin (for circus-themed loader) === */
@keyframes carousel-spin {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.1);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

.carousel-spin {
    animation: carousel-spin 3s ease-in-out infinite;
}

/* === Bounce === */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.bounce {
    animation: bounce 1s ease-in-out infinite;
}

/* === Shake === */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* === Glow Pulse === */
@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(212, 175, 55, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(212, 175, 55, 0.6), 0 0 30px rgba(212, 175, 55, 0.4);
    }
}

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

/* === Red Glow Pulse === */
@keyframes glow-pulse-red {
    0%, 100% {
        box-shadow: 0 0 5px rgba(139, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(139, 0, 0, 0.6), 0 0 30px rgba(139, 0, 0, 0.4);
    }
}

.glow-pulse-red {
    animation: glow-pulse-red 2s ease-in-out infinite;
}

/* === Rotate In === */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.5);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

.rotate-in {
    animation: rotateIn 0.6s ease-out;
}

/* === Zoom In === */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.zoom-in {
    animation: zoomIn 0.5s ease-out;
}

/* === Swing === */
@keyframes swing {
    0%, 100% {
        transform: rotate(0deg);
    }
    20% {
        transform: rotate(15deg);
    }
    40% {
        transform: rotate(-10deg);
    }
    60% {
        transform: rotate(5deg);
    }
    80% {
        transform: rotate(-5deg);
    }
}

.swing {
    transform-origin: top center;
    animation: swing 2s ease-in-out infinite;
}

/* === Typewriter Effect === */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.typewriter {
    overflow: hidden;
    white-space: nowrap;
    animation: typewriter 3s steps(40) 1s forwards;
}

/* === Blink (for cursor) === */
@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

.blink {
    animation: blink 1s step-end infinite;
}

/* === Confetti Fall === */
@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.confetti-fall {
    animation: confetti-fall 5s linear infinite;
}

/* === Neon Flicker === */
@keyframes neon-flicker {
    0%, 100% {
        text-shadow: 
            0 0 10px rgba(212, 175, 55, 0.8),
            0 0 20px rgba(212, 175, 55, 0.6),
            0 0 30px rgba(212, 175, 55, 0.4);
    }
    10%, 30%, 50%, 70%, 90% {
        text-shadow: 
            0 0 5px rgba(212, 175, 55, 0.4),
            0 0 10px rgba(212, 175, 55, 0.2);
    }
}

.neon-flicker {
    animation: neon-flicker 3s ease-in-out infinite;
}

/* === Heartbeat === */
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    10%, 30% {
        transform: scale(1.1);
    }
    20%, 40% {
        transform: scale(1);
    }
}

.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

/* === Page Load Animations === */
body {
    animation: fadeIn 0.5s ease-out;
}

/* === Stagger Animation for Lists === */
.stagger-item {
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }
.stagger-item:nth-child(7) { animation-delay: 0.7s; }
.stagger-item:nth-child(8) { animation-delay: 0.8s; }

/* === Reduced Motion Support === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .flicker,
    .float,
    .pulse,
    .spin,
    .carousel-spin,
    .bounce,
    .swing,
    .confetti-fall,
    .neon-flicker,
    .heartbeat {
        animation: none !important;
    }
}

/* === Hover Animations === */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.hover-scale {
    transition: transform 0.3s ease;
}

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

/* === Loading Spinner Variations === */
.spinner-dots {
    display: inline-flex;
    gap: 5px;
}

.spinner-dots span {
    width: 8px;
    height: 8px;
    background-color: var(--color-accent, #d4af37);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
}

.spinner-dots span:nth-child(1) { animation-delay: 0s; }
.spinner-dots span:nth-child(2) { animation-delay: 0.2s; }
.spinner-dots span:nth-child(3) { animation-delay: 0.4s; }

/* === Circus Tent Sway === */
@keyframes tent-sway {
    0%, 100% {
        transform: skewX(0deg);
    }
    25% {
        transform: skewX(2deg);
    }
    75% {
        transform: skewX(-2deg);
    }
}

.tent-sway {
    animation: tent-sway 4s ease-in-out infinite;
}
