/**
 * DeutschGuide — CSS Animations
 * Keyframes, page transition setups, bounce/glow states and scroll triggers.
 */

/* ─── Keyframe Animations ─────────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

@keyframes shimmer {
    100% {
        background-position: -200% 0;
    }
}

/* ─── Helper Classes ──────────────────────────────────────────────────────── */
.animate-fade-in { animation: fadeIn var(--transition-normal) forwards; }
.animate-fade-in-up { animation: fadeInUp var(--transition-normal) forwards; }
.animate-fade-in-down { animation: fadeInDown var(--transition-normal) forwards; }

.delay-1 { animation-delay: 100ms; }
.delay-2 { animation-delay: 200ms; }
.delay-3 { animation-delay: 300ms; }
.delay-4 { animation-delay: 400ms; }

/* ─── Page Transitions ────────────────────────────────────────────────────── */
.page-container {
    animation: fadeIn var(--transition-normal) ease-in-out;
}

/* ─── Scroll Triggered Animations ─────────────────────────────────────────── */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Reduced Motion preferences */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-delay: -1ms !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        background-attachment: scroll !important;
        scroll-behavior: auto !important;
        transition-duration: 0s !important;
        transition-delay: 0s !important;
    }
    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }
}
