/* ==================== MALEREIBETRIEB MÜLLER – ADVANCED ANIMATIONS ==================== */
/* Hardware-Accelerated, Performance-Optimized, Accessibility-Compliant */

/* ==================== KEYFRAME ANIMATIONS ==================== */

/* Fade Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

/* Scale Animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleInBounce {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    70% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Pulse & Glow */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(232, 120, 22, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(232, 120, 22, 0.6);
    }
}

@keyframes glowPulse {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(232, 120, 22, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 25px rgba(232, 120, 22, 0.8));
    }
}

/* Float Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes floatSlow {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(2deg);
    }
    50% {
        transform: translateY(-20px) rotate(0deg);
    }
    75% {
        transform: translateY(-10px) rotate(-2deg);
    }
}

/* Bounce */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-15px);
    }
    60% {
        transform: translateY(-7px);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Shake */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Slide */
@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Paint Brush Stroke Animation */
@keyframes brushStroke {
    0% {
        transform: scaleX(0);
        transform-origin: left;
    }
    100% {
        transform: scaleX(1);
        transform-origin: left;
    }
}

@keyframes brushReveal {
    0% {
        clip-path: inset(0 100% 0 0);
    }
    100% {
        clip-path: inset(0 0 0 0);
    }
}

/* Paint Drip Animation */
@keyframes drip {
    0% {
        height: 0;
        opacity: 1;
    }
    70% {
        height: 100px;
        opacity: 1;
    }
    100% {
        height: 100px;
        opacity: 0;
    }
}

/* Color Fill */
@keyframes colorFill {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: 0 0;
    }
}

/* Gradient Shift */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Text Reveal */
@keyframes textReveal {
    0% {
        clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
    }
    100% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    0%, 100% { border-color: transparent; }
    50% { border-color: var(--primary-500); }
}

/* Line Draw */
@keyframes drawLine {
    from {
        stroke-dashoffset: 1000;
    }
    to {
        stroke-dashoffset: 0;
    }
}

/* Counter Animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Morph */
@keyframes morph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

/* Background Movement */
@keyframes backgroundPan {
    from {
        background-position: 0% 50%;
    }
    to {
        background-position: 100% 50%;
    }
}

/* Parallax Float */
@keyframes parallaxFloat {
    0%, 100% {
        transform: translate3d(0, 0, 0);
    }
    25% {
        transform: translate3d(10px, -15px, 0);
    }
    50% {
        transform: translate3d(0, -25px, 0);
    }
    75% {
        transform: translate3d(-10px, -15px, 0);
    }
}

/* ==================== ANIMATION CLASSES ==================== */

/* Basic Animations */
.animate-fadeIn {
    animation: fadeIn 0.6s ease-out forwards;
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fadeInDown {
    animation: fadeInDown 0.6s ease-out forwards;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.6s ease-out forwards;
}

.animate-fadeInRight {
    animation: fadeInRight 0.6s ease-out forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.5s ease-out forwards;
}

.animate-bounceIn {
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

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

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-spinSlow {
    animation: spinSlow 8s linear infinite;
}

.animate-bounce {
    animation: bounce 2s ease-in-out infinite;
}

.animate-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

/* Delayed Animations */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }
.delay-900 { animation-delay: 0.9s; }
.delay-1000 { animation-delay: 1s; }

/* Animation Durations */
.duration-300 { animation-duration: 0.3s; }
.duration-500 { animation-duration: 0.5s; }
.duration-700 { animation-duration: 0.7s; }
.duration-1000 { animation-duration: 1s; }
.duration-1500 { animation-duration: 1.5s; }
.duration-2000 { animation-duration: 2s; }

/* ==================== HERO ANIMATIONS ==================== */

.hero-title .word {
    opacity: 0;
    transform: translateY(100%);
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.hero-title .word:nth-child(1) { animation-delay: 0.2s; }
.hero-title .word:nth-child(2) { animation-delay: 0.3s; }
.hero-title .word:nth-child(3) { animation-delay: 0.4s; }
.hero-title .word:nth-child(4) { animation-delay: 0.5s; }
.hero-title .word:nth-child(5) { animation-delay: 0.6s; }
.hero-title .word:nth-child(6) { animation-delay: 0.7s; }
.hero-title .word:nth-child(7) { animation-delay: 0.8s; }

.hero-title .highlight::after {
    animation: brushStroke 0.8s ease-out forwards;
    animation-delay: 1s;
}

.hero-subtitle {
    animation: fadeInUp 0.8s ease-out forwards;
    animation-delay: 0.8s;
}

.hero-ctas {
    animation: fadeInUp 0.8s ease-out forwards;
    animation-delay: 1s;
}

.hero-stats {
    animation: fadeInUp 0.8s ease-out forwards;
    animation-delay: 1.2s;
}

/* ==================== CANVAS PAINT EFFECT ==================== */

.paint-canvas {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.paint-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    animation: morph 8s ease-in-out infinite, parallaxFloat 6s ease-in-out infinite;
}

.paint-blob:nth-child(1) {
    width: 500px;
    height: 500px;
    background: var(--primary-500);
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.paint-blob:nth-child(2) {
    width: 400px;
    height: 400px;
    background: var(--secondary-600);
    top: 50%;
    right: -10%;
    animation-delay: -2s;
}

.paint-blob:nth-child(3) {
    width: 300px;
    height: 300px;
    background: var(--primary-700);
    bottom: -5%;
    left: 30%;
    animation-delay: -4s;
}

/* ==================== CARD HOVER EFFECTS ==================== */

.service-card {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--gradient-primary);
    border-radius: inherit;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.5s;
}

.service-card:hover::after {
    opacity: 0.3;
    animation: pulseGlow 2s ease-in-out infinite;
}

/* ==================== GALLERY ANIMATIONS ==================== */

.gallery-item {
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-500) 0%, transparent 100%);
    opacity: 0;
    z-index: 1;
    transition: opacity 0.4s ease;
}

.gallery-item:hover::before {
    opacity: 0.3;
}

.gallery-item:hover {
    transform: scale(1.02);
    z-index: 10;
}

/* Before/After Slider Effect */
.before-after-slider {
    position: relative;
    overflow: hidden;
    cursor: ew-resize;
}

.before-after-slider::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background: var(--neutral-0);
    z-index: 10;
    transform: translateX(-50%);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.before-after-slider::after {
    content: '⟷';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: var(--neutral-0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--neutral-900);
    z-index: 11;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ==================== TESTIMONIAL ANIMATIONS ==================== */

.testimonial-card {
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-card.active {
    animation: scaleIn 0.6s ease-out forwards;
}

.testimonial-quote-icon {
    animation: float 4s ease-in-out infinite;
}

/* ==================== BUTTON ANIMATIONS ==================== */

.btn {
    position: relative;
    overflow: hidden;
}

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

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    transition: all 0.3s, box-shadow 0.5s;
}

.btn-primary:hover {
    animation: pulseGlow 1.5s ease-in-out infinite;
}

/* Magnetic Button Effect */
.magnetic-btn {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== SCROLL PROGRESS ==================== */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform-origin: left;
    transform: scaleX(0);
    z-index: 9999;
    transition: transform 0.1s linear;
}

/* ==================== PAGE TRANSITIONS ==================== */

.page-transition-overlay {
    position: fixed;
    inset: 0;
    background: var(--neutral-950);
    z-index: 9998;
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-transition-overlay.active {
    transform: translateY(0);
}

/* ==================== TEXT ANIMATIONS ==================== */

.split-text .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(50px) rotateX(-90deg);
    animation: charReveal 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes charReveal {
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

.split-text .char:nth-child(1) { animation-delay: 0.02s; }
.split-text .char:nth-child(2) { animation-delay: 0.04s; }
.split-text .char:nth-child(3) { animation-delay: 0.06s; }
.split-text .char:nth-child(4) { animation-delay: 0.08s; }
.split-text .char:nth-child(5) { animation-delay: 0.1s; }
.split-text .char:nth-child(6) { animation-delay: 0.12s; }
.split-text .char:nth-child(7) { animation-delay: 0.14s; }
.split-text .char:nth-child(8) { animation-delay: 0.16s; }
.split-text .char:nth-child(9) { animation-delay: 0.18s; }
.split-text .char:nth-child(10) { animation-delay: 0.2s; }

/* ==================== NUMBER COUNTER ==================== */

.counter {
    display: inline-block;
    position: relative;
}

.counter.counting {
    animation: countUp 0.4s ease-out;
}

/* ==================== PAINT SPLATTER ==================== */

.paint-splatter {
    position: absolute;
    width: 100px;
    height: 100px;
    background: var(--primary-500);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0);
    animation: splatter 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes splatter {
    0% {
        opacity: 1;
        transform: scale(0);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.2);
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

/* ==================== RIBBON ANIMATION ==================== */

.ribbon {
    position: absolute;
    width: 150px;
    height: 30px;
    background: var(--gradient-primary);
    transform: rotate(-45deg);
    animation: ribbonWave 3s ease-in-out infinite;
}

@keyframes ribbonWave {
    0%, 100% {
        transform: rotate(-45deg) translateY(0);
    }
    50% {
        transform: rotate(-45deg) translateY(-5px);
    }
}

/* ==================== PARTICLE EFFECTS ==================== */

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-500);
    border-radius: 50%;
    pointer-events: none;
    animation: particleFloat 3s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }
    10% {
        opacity: 1;
        transform: translateY(-20px) scale(1);
    }
    90% {
        opacity: 1;
        transform: translateY(-100px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-120px) scale(0);
    }
}

/* ==================== ACCESSIBILITY ==================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .paint-blob,
    .animate-float,
    .animate-pulse,
    .animate-spin,
    .animate-bounce {
        animation: none !important;
    }
}

/* ==================== INTERSECTION OBSERVER TRIGGERS ==================== */

[data-animate] {
    opacity: 0;
}

[data-animate="fadeIn"].animated { animation: fadeIn 0.6s ease-out forwards; }
[data-animate="fadeInUp"].animated { animation: fadeInUp 0.6s ease-out forwards; }
[data-animate="fadeInDown"].animated { animation: fadeInDown 0.6s ease-out forwards; }
[data-animate="fadeInLeft"].animated { animation: fadeInLeft 0.6s ease-out forwards; }
[data-animate="fadeInRight"].animated { animation: fadeInRight 0.6s ease-out forwards; }
[data-animate="scaleIn"].animated { animation: scaleIn 0.6s ease-out forwards; }
[data-animate="bounceIn"].animated { animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards; }

/* ==================== LOADING STATES ==================== */

.skeleton {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.05) 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
}

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==================== 3D TRANSFORMS ==================== */

.perspective-container {
    perspective: 1000px;
}

.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-3d:hover {
    transform: rotateY(10deg) rotateX(5deg);
}

.card-3d-content {
    transform: translateZ(50px);
}
