/* ═══════════════════════════════════════════════
   MizaDigital — Animations & Effects
   ═══════════════════════════════════════════════ */

/* ── Fade Animations ─────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ── Scroll-triggered Animations ─────────────── */
[data-aos] {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-aos="fade-up"] {
    transform: translateY(30px);
}

[data-aos="fade-down"] {
    transform: translateY(-30px);
}

[data-aos="fade-left"] {
    transform: translateX(30px);
}

[data-aos="fade-right"] {
    transform: translateX(-30px);
}

[data-aos="zoom-in"] {
    transform: scale(0.9);
}

[data-aos].aos-animate {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}

/* ── Glow & Pulse Effects ────────────────────── */
@keyframes neonPulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(108, 92, 231, 0.3),
                    0 0 15px rgba(108, 92, 231, 0.1);
    }
    50% {
        box-shadow: 0 0 10px rgba(108, 92, 231, 0.5),
                    0 0 30px rgba(108, 92, 231, 0.2),
                    0 0 60px rgba(108, 92, 231, 0.1);
    }
}

@keyframes borderGlow {
    0%, 100% {
        border-color: rgba(108, 92, 231, 0.15);
    }
    50% {
        border-color: rgba(108, 92, 231, 0.4);
    }
}

/* ── Floating Effect ─────────────────────────── */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

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

.shimmer {
    background: linear-gradient(
        90deg,
        var(--color-bg-card) 25%,
        rgba(108, 92, 231, 0.1) 50%,
        var(--color-bg-card) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* ── Counter Animation ───────────────────────── */
.counter-animate {
    transition: all 0.3s ease;
}

/* ── Card Entrance Stagger ───────────────────── */
.stagger-enter > * {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
}

.stagger-enter > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-enter > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-enter > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-enter > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-enter > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-enter > *:nth-child(6) { animation-delay: 0.6s; }

/* ── Typing Effect ───────────────────────────── */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.typing-cursor::after {
    content: '|';
    animation: blink 1s infinite;
    color: var(--color-primary);
}

/* ── Ripple Effect ───────────────────────────── */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 200px;
    height: 200px;
}

/* ── Scroll Progress Bar ─────────────────────── */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--gradient-primary);
    z-index: 9999;
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
}

/* ── Loading Animation ───────────────────────── */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ── Prefers Reduced Motion ──────────────────── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .particles {
        display: none;
    }
}
