/* public/assets/css/frontend/base/animations.css - Animationen und Effekte */

/* GRUNDLEGENDE ANIMATIONS-KLASSEN */
/* Basis-Fixes */
.usp-card, .prozess-step, .beispiele-card { opacity: 1 !important; }
.opacity-0 { opacity: 1 !important; }

/* Animation-Basisklassen */
.animate__animated { animation-duration: 1s; animation-fill-mode: both; }
.animate__fadeIn { animation-name: fadeIn; }
.animate__fadeInUp { animation-name: fadeInUp; }
.animate__fadeInDown { animation-name: fadeInDown; }

/* Basis-Keyframes */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp {
    from { opacity: 0; transform: translate3d(0, 30px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translate3d(0, -30px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}


/* ELEMENTSPEZIFISCHE ANIMATIONEN */
/* Hero-Animationen */
.hero__title { opacity: 0; animation: fadeInDown 0.8s ease 0.3s forwards; }
.hero__subtitle { opacity: 0; animation: fadeIn 0.8s ease 0.5s forwards; }
.hero__cta { opacity: 0; animation: fadeInUp 0.8s ease 0.7s forwards; }

/* CSP-konforme Hero Button Animationen */
.hero-animate-initial { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.hero-animate-visible { opacity: 1; transform: translateY(0); }
.no-motion-visible { opacity: 1 !important; transform: none !important; }

/* Image lazy loading fade-in */
.img-fade-in { transition: opacity 0.3s ease; opacity: 1; }

/* Contact Protection Animation Classes */
.protection-fade-out { opacity: 0; transition: opacity 300ms ease; }
.protection-fade-in-hidden { opacity: 0; transition: opacity 300ms ease; }
.protection-fade-in-visible { opacity: 1; }

/* Utility Classes */
.print-hidden { display: none !important; }
.tfa-input-focused { transform: scale(1.02); transition: transform 0.2s ease; }
.z-index-warning { z-index: 9999; }

/* Session Debug Overlay */
.session-debug-overlay {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 15px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 12px;
    max-width: 400px;
    z-index: 99999;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* USP-Karten-Animationen */
.usp-card { opacity: 0; transform: translateY(30px); }
.usp-card.visible { animation: fadeInUp 0.6s ease forwards; }
.usp-card:nth-child(1) { animation-delay: 0.1s; }
.usp-card:nth-child(2) { animation-delay: 0.2s; }
.usp-card:nth-child(3) { animation-delay: 0.3s; }
.usp-card:nth-child(4) { animation-delay: 0.4s; }

/* Prozess-Schritt-Animationen */
.prozess-step { opacity: 0; transform: translateY(30px); }
.prozess-step.visible { animation: fadeInUp 0.6s ease forwards; }
.prozess-step:nth-child(1) { animation-delay: 0.2s; }
.prozess-step:nth-child(2) { animation-delay: 0.4s; }
.prozess-step:nth-child(3) { animation-delay: 0.6s; }

/* Timeline-Animation */
.prozess-timeline__line { width: 0; transition: width 1.5s ease; animation: expandLine 1.5s ease forwards; }
.prozess-timeline__line.visible { width: 80%; }
@keyframes expandLine { to { width: 80%; } }

/* Beispiel-Karten-Animationen */
.beispiele-card { opacity: 0; transform: translateY(30px); }
.beispiele-card.visible { animation: fadeInUp 0.6s ease forwards; }

/* Vor/Nach-Labels */
.before-after__label { animation: slideInLeft 0.5s ease forwards; }
.before-after__label--after { animation: slideInRight 0.5s ease forwards; }
@keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Überschriften-Animation */
.section-title { position: relative; opacity: 0; animation: fadeInDown 0.8s ease forwards; }
.section-title::after { animation: expandWidth 0.8s ease 0.4s forwards; width: 0; }
@keyframes expandWidth { to { width: 60px; } }


/* SCROLLBASIERTE EFFEKTE */
/* Carousel-Steuerelemente */
.ueber-image-gallery .carousel-control-prev, .ueber-image-gallery .carousel-control-next { opacity: 0; transition: opacity 0.3s ease; }
.ueber-image-gallery:hover .carousel-control-prev, .ueber-image-gallery:hover .carousel-control-next { opacity: 1; }

/* Scroll-Reveal-Helferklassen */
[data-animate] { opacity: 0; transition: all 0.6s ease; }
[data-animate="fade-up"] { transform: translateY(30px); }
[data-animate="fade-up"].in-view { opacity: 1; transform: translateY(0); }
[data-animate="fade-in"] { opacity: 0; }
[data-animate="fade-in"].in-view { opacity: 1; }

/* Ladezustände */
@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
img[loading="lazy"]:not(.loaded)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

/* AOS Scroll Animation */
[data-aos] { opacity: 0; transition-property: opacity, transform; }
[data-aos].aos-animate { opacity: 1; }
[data-aos="fade-up"] { transform: translateY(30px); }
[data-aos="fade-up"].aos-animate { transform: translateY(0); }


/* HOVER-EFFEKTE */
/* Karten-Hover */
.card, .usp-card, .beispiele-card, .preise-card, .stat-card { transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); will-change: transform, box-shadow; }
.card:hover, .usp-card:hover, .beispiele-card:hover, .preise-card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1) !important; }
.stat-card:hover { transform: translateY(-5px); }

/* Button-Hover */
.btn { position: relative; overflow: hidden; transition: all 0.3s ease; }
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}
.btn:hover::before { width: 300px; height: 300px; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); }

/* Bild-Hover-Effekte */
.beispiele-card__img { overflow: hidden; border-radius: 8px; }
.beispiele-card__img img { transition: transform 0.4s ease, filter 0.4s ease; }
.beispiele-card:hover .beispiele-card__img img { transform: scale(1.1); filter: brightness(1.05); }


/* ZUSTANDS- & ÜBERGANGSANIMATIONEN */
/* Fade-In beim Scrollen */
.fade-in-up, .usp-card, .prozess-step, .beispiele-card { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in-up.visible, .usp-card.visible, .prozess-step.visible, .beispiele-card.visible { opacity: 1; transform: translateY(0); }

/* Accordion-Übergänge */
.accordion-collapse { transition: all 0.35s ease; }
.accordion-button { transition: all 0.3s ease; }
.accordion-button::after { transition: transform 0.3s ease; }
.accordion-button:not(.collapsed)::after { transform: rotate(180deg); }

/* Formularfeld-Animationen */
.form-control, .form-select { transition: all 0.3s ease; }
.form-control:focus, .form-select:focus { transform: translateY(-2px); box-shadow: 0 0 0 0.25rem rgba(38, 166, 154, 0.25), 0 8px 20px rgba(38, 166, 154, 0.1); }
/* Floating-Label-Animation */
.form-floating label { transition: all 0.2s ease; }

/* Ladezustände */
.loading { position: relative; pointer-events: none; opacity: 0.6; }
.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--accent-color);
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* BARRIEREFREIHEIT & PERFORMANCE */
/* Reduzierte Bewegung */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .card:hover, .usp-card:hover, .beispiele-card:hover, .btn:hover { transform: none !important; }
}