/**
 * SY Advanced Animations - Custom CSS Animations
 * Erweiterte Animationen und Hilfsstile
 */

/* Animation Wrapper Basis-Styles */
.sy-animation-wrapper {
    position: relative;
}

/* Prefers Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .sy-animation-wrapper,
    .sy-animation-wrapper * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    /* AOS Animationen deaktivieren */
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Custom CSS Animationen */
@keyframes syShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

@keyframes syWobble {
    0% { transform: translateX(0%); }
    15% { transform: translateX(-25%) rotate(-5deg); }
    30% { transform: translateX(20%) rotate(3deg); }
    45% { transform: translateX(-15%) rotate(-3deg); }
    60% { transform: translateX(10%) rotate(2deg); }
    75% { transform: translateX(-5%) rotate(-1deg); }
    100% { transform: translateX(0%); }
}

@keyframes sySwing {
    20% { transform: rotate(15deg); }
    40% { transform: rotate(-10deg); }
    60% { transform: rotate(5deg); }
    80% { transform: rotate(-5deg); }
    100% { transform: rotate(0deg); }
}

@keyframes syFlash {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0; }
}

@keyframes syRubberBand {
    0% { transform: scale(1); }
    30% { transform: scaleX(1.25) scaleY(0.75); }
    40% { transform: scaleX(0.75) scaleY(1.25); }
    50% { transform: scaleX(1.15) scaleY(0.85); }
    65% { transform: scaleX(0.95) scaleY(1.05); }
    75% { transform: scaleX(1.05) scaleY(0.95); }
    100% { transform: scale(1); }
}

@keyframes syJello {
    0%, 11.1%, 100% { transform: translate3d(0, 0, 0); }
    22.2% { transform: skewX(-12.5deg) skewY(-12.5deg); }
    33.3% { transform: skewX(6.25deg) skewY(6.25deg); }
    44.4% { transform: skewX(-3.125deg) skewY(-3.125deg); }
    55.5% { transform: skewX(1.5625deg) skewY(1.5625deg); }
    66.6% { transform: skewX(-0.78125deg) skewY(-0.78125deg); }
    77.7% { transform: skewX(0.390625deg) skewY(0.390625deg); }
    88.8% { transform: skewX(-0.1953125deg) skewY(-0.1953125deg); }
}

@keyframes syHeartBeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}

/* CSS Animation Klassen */
.animate__sy-shake {
    animation-name: syShake;
    animation-duration: 1s;
    animation-fill-mode: both;
}

.animate__sy-wobble {
    animation-name: syWobble;
    animation-duration: 1s;
    animation-fill-mode: both;
}

.animate__sy-swing {
    animation-name: sySwing;
    animation-duration: 1s;
    animation-fill-mode: both;
    transform-origin: top center;
}

.animate__sy-flash {
    animation-name: syFlash;
    animation-duration: 1s;
    animation-fill-mode: both;
}

.animate__sy-rubberBand {
    animation-name: syRubberBand;
    animation-duration: 1s;
    animation-fill-mode: both;
}

.animate__sy-jello {
    animation-name: syJello;
    animation-duration: 1s;
    animation-fill-mode: both;
    transform-origin: center;
}

.animate__sy-heartBeat {
    animation-name: syHeartBeat;
    animation-duration: 1.3s;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}

/* Animation Dauer Utilities */
.sy-animation-duration-fast { animation-duration: 0.5s !important; }
.sy-animation-duration-normal { animation-duration: 1s !important; }
.sy-animation-duration-slow { animation-duration: 2s !important; }

/* Animation Verzögerung Utilities */
.sy-animation-delay-100 { animation-delay: 0.1s !important; }
.sy-animation-delay-200 { animation-delay: 0.2s !important; }
.sy-animation-delay-300 { animation-delay: 0.3s !important; }
.sy-animation-delay-500 { animation-delay: 0.5s !important; }

/* Hover-Effekte für interaktive Animationen */
.sy-hover-animation:hover {
    animation-play-state: running;
}

.sy-hover-animation {
    animation-play-state: paused;
}

/* Intersection Observer Fallback */
.sy-animation-wrapper[data-animation-effect] {
    opacity: 0;
    transition: opacity 0.6s ease-out;
}

.sy-animation-wrapper.sy-animation-visible {
    opacity: 1;
}

/* Debug Mode - zeigt Animation-Bereiche */
.sy-debug-animations .sy-animation-wrapper {
    outline: 2px dashed rgba(255, 0, 0, 0.5) !important;
    outline-offset: 2px !important;
}

.sy-debug-animations .sy-animation-wrapper::before {
    content: attr(data-animation-effect) !important;
    position: absolute !important;
    top: -20px !important;
    left: 0 !important;
    background: rgba(255, 0, 0, 0.8) !important;
    color: white !important;
    font-size: 10px !important;
    padding: 2px 5px !important;
    border-radius: 3px !important;
    z-index: 9999 !important;
}
