/* BF Animator Frontend Styles */

/* Base Animation Classes */
.bf-animator-element {
    transform-origin: center center;
}

.bf-animator-hidden {
    opacity: 0;
    visibility: hidden;
}

.bf-animator-visible {
    opacity: 1;
    visibility: visible;
}

/* Animation State Classes */
.bf-animator-fade-in {
    opacity: 0;
}

.bf-animator-fade-out {
    opacity: 1;
}

.bf-animator-slide-up {
    transform: translateY(100px);
    opacity: 0;
}

.bf-animator-slide-down {
    transform: translateY(-100px);
    opacity: 0;
}

.bf-animator-slide-left {
    transform: translateX(100px);
    opacity: 0;
}

.bf-animator-slide-right {
    transform: translateX(-100px);
    opacity: 0;
}

.bf-animator-scale-up {
    transform: scale(0.8);
    opacity: 0;
}

.bf-animator-scale-down {
    transform: scale(1.2);
    opacity: 0;
}

.bf-animator-rotate-in {
    transform: rotate(180deg);
    opacity: 0;
}

.bf-animator-flip-x {
    transform: perspective(1000px) rotateX(90deg);
    opacity: 0;
}

.bf-animator-flip-y {
    transform: perspective(1000px) rotateY(90deg);
    opacity: 0;
}

/* Bounce Animations */
.bf-animator-bounce-in {
    transform: scale(0.3);
    opacity: 0;
}

.bf-animator-bounce-out {
    transform: scale(1);
    opacity: 1;
}

/* Elastic Animations */
.bf-animator-elastic-in {
    transform: scale(0);
    opacity: 0;
}

.bf-animator-elastic-out {
    transform: scale(1);
    opacity: 1;
}

/* Shake Animation */
.bf-animator-shake {
    animation: bf-animator-shake-keyframes 0.5s ease-in-out;
}

@keyframes bf-animator-shake-keyframes {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

/* Pulse Animation */
.bf-animator-pulse {
    animation: bf-animator-pulse-keyframes 1s ease-in-out infinite;
}

@keyframes bf-animator-pulse-keyframes {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Floating Animation */
.bf-animator-float {
    animation: bf-animator-float-keyframes 3s ease-in-out infinite;
}

@keyframes bf-animator-float-keyframes {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Wobble Animation */
.bf-animator-wobble {
    animation: bf-animator-wobble-keyframes 1s ease-in-out;
}

@keyframes bf-animator-wobble-keyframes {
    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%); }
}

/* Stagger Animation Delays */
.bf-animator-stagger-1 { animation-delay: 0.1s; }
.bf-animator-stagger-2 { animation-delay: 0.2s; }
.bf-animator-stagger-3 { animation-delay: 0.3s; }
.bf-animator-stagger-4 { animation-delay: 0.4s; }
.bf-animator-stagger-5 { animation-delay: 0.5s; }
.bf-animator-stagger-6 { animation-delay: 0.6s; }
.bf-animator-stagger-7 { animation-delay: 0.7s; }
.bf-animator-stagger-8 { animation-delay: 0.8s; }
.bf-animator-stagger-9 { animation-delay: 0.9s; }
.bf-animator-stagger-10 { animation-delay: 1.0s; }

/* Scroll Triggered Elements */
.bf-animator-scroll-trigger {
    will-change: transform, opacity;
}

/* Performance Optimizations */
.bf-animator-element {
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

/* Debug Mode Styles */
.bf-animator-debug .bf-animator-element {
    outline: 2px dashed #ff6b6b;
    position: relative;
}

.bf-animator-debug .bf-animator-element::before {
    content: attr(data-bf-animator-id);
    position: absolute;
    top: -20px;
    left: 0;
    background: #ff6b6b;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    z-index: 1000;
}

/* ScrollTrigger Markers (Development) */
.bf-animator-debug .gsap-marker-start,
.bf-animator-debug .gsap-marker-end {
    background: rgba(0, 208, 132, 0.3) !important;
    border-color: #00d084 !important;
}

.bf-animator-debug .gsap-marker-scroller-start,
.bf-animator-debug .gsap-marker-scroller-end {
    background: rgba(255, 107, 107, 0.3) !important;
    border-color: #ff6b6b !important;
}

/* Loading States */
.bf-animator-loading {
    opacity: 0;
    pointer-events: none;
}

.bf-animator-loaded {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    /* Reduce animation intensity on mobile */
    .bf-animator-slide-up,
    .bf-animator-slide-down {
        transform: translateY(50px);
    }
    
    .bf-animator-slide-left,
    .bf-animator-slide-right {
        transform: translateX(50px);
    }
    
    .bf-animator-float {
        animation: bf-animator-float-mobile 3s ease-in-out infinite;
    }
    
    @keyframes bf-animator-float-mobile {
        0%, 100% { transform: translateY(0px); }
        50% { transform: translateY(-10px); }
    }
}

@media (max-width: 480px) {
    /* Further reduce animations on small screens */
    .bf-animator-slide-up,
    .bf-animator-slide-down {
        transform: translateY(30px);
    }
    
    .bf-animator-slide-left,
    .bf-animator-slide-right {
        transform: translateX(30px);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    /* Disable animations for users who prefer reduced motion */
    .bf-animator-element,
    .bf-animator-pulse,
    .bf-animator-float,
    .bf-animator-wobble,
    .bf-animator-shake {
        animation: none !important;
        transition: none !important;
    }
    
    /* Show elements immediately */
    .bf-animator-fade-in,
    .bf-animator-slide-up,
    .bf-animator-slide-down,
    .bf-animator-slide-left,
    .bf-animator-slide-right,
    .bf-animator-scale-up,
    .bf-animator-scale-down,
    .bf-animator-rotate-in,
    .bf-animator-flip-x,
    .bf-animator-flip-y,
    .bf-animator-bounce-in,
    .bf-animator-elastic-in {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* High Contrast Support */
@media (prefers-contrast: high) {
    .bf-animator-debug .bf-animator-element {
        outline-color: #000000;
    }
    
    .bf-animator-debug .bf-animator-element::before {
        background: #000000;
        color: #ffffff;
    }
}

/* Print Styles */
@media print {
    .bf-animator-element {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
        transition: none !important;
    }
    
    .bf-animator-debug .bf-animator-element {
        outline: none !important;
    }
    
    .bf-animator-debug .bf-animator-element::before {
        display: none !important;
    }
}
