/* =====================================================
   PEBEKA CONTRACTOR WEBSITE - ANIMATIONS
   ===================================================== */

/* Fade In Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in-up.animate {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in-left.animate {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in-right.animate {
    opacity: 1;
    transform: translateX(0);
}

.fade-in {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in.animate {
    opacity: 1;
}

/* Scale In Animation */
.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scale-in.animate {
    opacity: 1;
    transform: scale(1);
}

/* Stagger Animation Delays */
.fade-in-up[data-delay="0"] { transition-delay: 0s; }
.fade-in-up[data-delay="100"] { transition-delay: 0.1s; }
.fade-in-up[data-delay="200"] { transition-delay: 0.2s; }
.fade-in-up[data-delay="300"] { transition-delay: 0.3s; }
.fade-in-up[data-delay="400"] { transition-delay: 0.4s; }
.fade-in-up[data-delay="500"] { transition-delay: 0.5s; }

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

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

/* Pulse Animation */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

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

/* Glow Effect */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(244, 185, 66, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(244, 185, 66, 0.6);
    }
}

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

/* Typewriter Effect */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary-color); }
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--primary-color);
    white-space: nowrap;
    margin: 0 auto;
    animation: 
        typing 3.5s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

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

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

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

/* Counter Animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Button Hover Effects */
.btn-hover-fill {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-hover-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
    z-index: -1;
}

.btn-hover-fill:hover::before {
    left: 100%;
}

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

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-20px);
    }
    70% {
        transform: translateY(-10px);
    }
    90% {
        transform: translateY(-4px);
    }
}

.bounce {
    animation: bounce 1s ease;
}

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rotate {
    animation: rotate 2s linear infinite;
}

/* Flip Animation */
@keyframes flipInX {
    from {
        transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
        opacity: 0;
    }
    40% {
        transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
    }
    60% {
        transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
    }
    80% {
        transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
    }
    to {
        transform: perspective(400px);
        opacity: 1;
    }
}

.flip-in-x {
    animation: flipInX 1s ease-in;
}

/* Zoom In Animation */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
    50% {
        opacity: 1;
    }
}

.zoom-in {
    animation: zoomIn 0.6s ease-out;
}

/* Slide Up Animation */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-up {
    animation: slideUp 0.6s ease-out;
}

/* Progress Bar Animation */
@keyframes progressBar {
    from {
        width: 0%;
    }
    to {
        width: var(--progress-width);
    }
}

.progress-animated {
    animation: progressBar 2s ease-out;
}

/* Morphing Animation */
@keyframes morph {
    0%, 100% {
        border-radius: 40px 60px 70px 30px;
    }
    34% {
        border-radius: 70px 40px 30px 60px;
    }
    67% {
        border-radius: 100px 60px 60px 40px;
    }
}

.morph {
    animation: morph 8s ease-in-out infinite;
}

/* Particle Animation */
@keyframes particle {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(180deg);
        opacity: 0;
    }
}

.particle {
    animation: particle 3s linear infinite;
}

/* Wave Animation */
@keyframes wave {
    0% {
        d: path('M 0,400 C 0,400 0,200 0,200 C 100,200 100,200 200,200 C 300,200 300,200 400,200 C 500,200 500,200 600,200 C 700,200 700,200 800,200 C 900,200 900,200 1000,200 C 1100,200 1100,200 1200,200 C 1300,200 1300,200 1400,200 C 1500,200 1500,200 1600,200 C 1600,200 1600,400 1600,400 Z');
    }
    50% {
        d: path('M 0,400 C 0,400 0,200 0,200 C 100,180 100,180 200,180 C 300,220 300,220 400,220 C 500,180 500,180 600,180 C 700,220 700,220 800,220 C 900,180 900,180 1000,180 C 1100,220 1100,220 1200,220 C 1300,180 1300,180 1400,180 C 1500,220 1500,220 1600,220 C 1600,220 1600,400 1600,400 Z');
    }
    100% {
        d: path('M 0,400 C 0,400 0,200 0,200 C 100,200 100,200 200,200 C 300,200 300,200 400,200 C 500,200 500,200 600,200 C 700,200 700,200 800,200 C 900,200 900,200 1000,200 C 1100,200 1100,200 1200,200 C 1300,200 1300,200 1400,200 C 1500,200 1500,200 1600,200 C 1600,200 1600,400 1600,400 Z');
    }
}

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

.gradient-animated {
    background: linear-gradient(-45deg, var(--primary-color), var(--primary-dark), var(--accent-color), var(--primary-color));
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* Text Reveal Animation */
@keyframes textReveal {
    0% {
        width: 0;
    }
    50% {
        width: 100%;
    }
    100% {
        width: 100%;
    }
}

.text-reveal {
    position: relative;
    overflow: hidden;
}

.text-reveal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--primary-color);
    animation: textReveal 2s ease-in-out;
}

/* Loading Animations */
@keyframes loading-dots {
    0%, 20% {
        color: rgba(244, 185, 66, 0);
        text-shadow: 0.25em 0 0 rgba(244, 185, 66, 0),
                     0.5em 0 0 rgba(244, 185, 66, 0);
    }
    40% {
        color: var(--primary-color);
        text-shadow: 0.25em 0 0 rgba(244, 185, 66, 0),
                     0.5em 0 0 rgba(244, 185, 66, 0);
    }
    60% {
        text-shadow: 0.25em 0 0 var(--primary-color),
                     0.5em 0 0 rgba(244, 185, 66, 0);
    }
    80%, 100% {
        text-shadow: 0.25em 0 0 var(--primary-color),
                     0.5em 0 0 var(--primary-color);
    }
}

.loading-dots::after {
    content: '...';
    animation: loading-dots 1.5s steps(5, end) infinite;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(244, 185, 66, 0.4);
}

/* Stagger Animation Classes */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* Parallax Effect */
.parallax {
    transform: translateZ(0);
}

.parallax-slow {
    transform: translateY(var(--parallax-offset, 0)) translateZ(0);
}

/* Intersection Observer Animation Triggers */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Enhanced Button Animations */
.btn-magnetic {
    transition: transform 0.3s ease;
    cursor: pointer;
}

.btn-magnetic:hover {
    transform: translate(var(--mouse-x, 0), var(--mouse-y, 0)) scale(1.05);
}

/* Smooth Animations for Mobile */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High Performance Animations */
.will-animate {
    will-change: transform, opacity;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000;
}

/* Custom Easing Functions */
.ease-out-expo {
    transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

.ease-out-back {
    transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ease-in-out-quart {
    transition-timing-function: cubic-bezier(0.76, 0, 0.24, 1);
}

/* Animation Utils */
.pause-animation {
    animation-play-state: paused;
}

.play-animation {
    animation-play-state: running;
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 400% 100%;
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

/* Success/Error Animations */
@keyframes success-check {
    0% {
        stroke-dashoffset: 100;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.success-check {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: success-check 0.6s ease-in-out forwards;
}

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

.error-shake {
    animation: error-shake 0.6s ease-in-out;
}

/* Reveal Animations */
.reveal-mask {
    position: relative;
    overflow: hidden;
}

.reveal-mask::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    animation: reveal-sweep 2s ease-in-out;
}

@keyframes reveal-sweep {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Page Transitions */
.page-transition-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.page-transition-exit {
    opacity: 1;
    transform: translateY(0);
}

.page-transition-exit-active {
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}