/* =========================================
   DAUS GAMING - Animations Stylesheet
   Reusable keyframes & scroll-triggered effects
   ========================================= */

/* Fade in animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Staggered children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.5s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.6s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(7) { transition-delay: 0.7s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(8) { transition-delay: 0.8s; opacity: 1; transform: translateY(0); }

/* Hover glow effect */
.hover-glow {
    transition: all var(--transition-base);
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.5), 0 0 60px rgba(236, 72, 153, 0.3);
}

/* Glitch effect for special text */
.glitch {
    position: relative;
    animation: glitch-skew 1s infinite linear alternate-reverse;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ec4899;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
    animation: glitch-anim 2s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #06b6d4;
    clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%);
    animation: glitch-anim2 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%); }
    100% { clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%); }
}

@keyframes glitch-anim2 {
    0% { clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%); }
    100% { clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%); }
}

@keyframes glitch-skew {
    0% { transform: skew(0deg); }
    20% { transform: skew(-1deg); }
    40% { transform: skew(0.5deg); }
    60% { transform: skew(-0.5deg); }
    80% { transform: skew(0.8deg); }
    100% { transform: skew(0deg); }
}

/* Tilt effect */
.tilt {
    transition: transform 0.3s ease;
}

/* Neon pulse */
.neon-pulse {
    animation: neonPulse 2s ease-in-out infinite;
}

@keyframes neonPulse {
    0%, 100% {
        text-shadow:
            0 0 5px rgba(124, 58, 237, 0.8),
            0 0 10px rgba(124, 58, 237, 0.6),
            0 0 20px rgba(124, 58, 237, 0.4);
    }
    50% {
        text-shadow:
            0 0 10px rgba(236, 72, 153, 0.8),
            0 0 20px rgba(236, 72, 153, 0.6),
            0 0 40px rgba(236, 72, 153, 0.4);
    }
}

/* 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;
}

/* Pop in */
@keyframes pop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.pop {
    animation: pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

/* Slide up */
@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.slide-up {
    animation: slideUp 0.6s ease-out backwards;
}

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

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

/* Rainbow */
.rainbow {
    background: linear-gradient(90deg,
        #ef4444, #f59e0b, #10b981, #06b6d4, #7c3aed, #ec4899, #ef4444);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: rainbow 4s linear infinite;
}

@keyframes rainbow {
    to { background-position: 200% center; }
}

/* Loading dots */
.loading-dots span {
    display: inline-block;
    animation: dotPulse 1.4s ease-in-out infinite;
}

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

@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Confetti animation for special actions */
@keyframes confettiFall {
    0% { transform: translateY(-100px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    pointer-events: none;
    z-index: 9999;
    animation: confettiFall 3s linear forwards;
}
