/**
 * Shared Animation Styles
 * Common animations and transitions used by both fullscreen and standard shops
 * 
 * Usage: Load this before shop-specific styles
 * Provides reusable keyframes and animation classes
 */

/* ==========================================================================
   Keyframe Animations
   ========================================================================== */

/* Spin Animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Fade Out Animation */
@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Slide In from Bottom */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Slide In from Top */
@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Slide In from Left */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Slide In from Right */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Scale In Animation */
@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Scale Out Animation */
@keyframes scaleOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0);
        opacity: 0;
    }
}

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

/* Shake Animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

/* Shimmer/Skeleton Loading */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Progress Bar Animation */
@keyframes progress {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

/* Ripple Effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Cart Pulse Animation */
@keyframes cartPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
}

/* Cart Bounce Animation */
@keyframes cartBounce {
    0%, 100% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.2); 
    }
}

/* Wishlist Pulse Animation */
@keyframes wishlistPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Wishlist Spin Animation */
@keyframes wishlist-spin {
    to { 
        transform: rotate(360deg); 
    }
}

/* Checkmark Animation */
@keyframes checkmark {
    0% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.3) rotate(10deg); 
    }
    100% { 
        transform: scale(1); 
    }
}

/* Modal Fade In with Scale */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Modal Slide Up */
@keyframes modalSlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal Fade Out with Scale */
@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* Dot Pulse Animation */
@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Ellipsis Animation */
@keyframes ellipsis {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

/* Loading Bar Animation */
@keyframes loadingBar {
    0% {
        left: -40%;
    }
    100% {
        left: 100%;
    }
}

/* Bounce In Animation */
@keyframes bounceIn {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Success Pulse Animation */
@keyframes successPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

/* Progress Fill Animation */
@keyframes progress-fill {
    0% {
        background: linear-gradient(to right, 
            #007cba 0%, 
            #007cba 0%, 
            #e0e0e0 0%, 
            #e0e0e0 100%
        );
    }
    33.33% {
        background: linear-gradient(to right, 
            #007cba 0%, 
            #007cba 33.33%, 
            #e0e0e0 33.33%, 
            #e0e0e0 100%
        );
    }
    66.66% {
        background: linear-gradient(to right, 
            #007cba 0%, 
            #007cba 66.66%,
            #e0e0e0 66.66%,
            #e0e0e0 100%
        );
    }
    100% {
        background: linear-gradient(to right, 
            #007cba 0%, 
            #007cba 100%, 
            #007cba 100%, 
            #007cba 100%
        );
    }
}

/* Filter Pulse Animation */
@keyframes filterPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Progress Stripes Animation */
@keyframes progressStripes {
    0% {
        background-position: 40px 0;
    }
    100% {
        background-position: 0 0;
    }
}

/* Dots Loading Animation */
@keyframes dots {
    0%, 20% {
        color: rgba(0,0,0,0);
        text-shadow:
            .25em 0 0 rgba(0,0,0,0),
            .5em 0 0 rgba(0,0,0,0);
    }
    40% {
        color: black;
        text-shadow:
            .25em 0 0 rgba(0,0,0,0),
            .5em 0 0 rgba(0,0,0,0);
    }
    60% {
        text-shadow:
            .25em 0 0 black,
            .5em 0 0 rgba(0,0,0,0);
    }
    80%, 100% {
        text-shadow:
            .25em 0 0 black,
            .5em 0 0 black;
    }
}

/* Heartbeat Animation */
@keyframes heartbeat {
    0% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.3);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.3);
    }
    70% {
        transform: scale(1);
    }
}

/* Slide Up Animation */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Fade In Scale Animation */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Ring Rotate Animation */
@keyframes ringRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Simple Spin Animation */
@keyframes spinSimple {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Checkout Spin Animation */
@keyframes checkoutSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Digital Check Spin Animation */
@keyframes digital-check-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Button Spin Animation */
@keyframes btnSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Filter Spin Animation */
@keyframes filterSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Standard Shop Animations - Deprecated (use unprefixed versions) */
@keyframes ssSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes ssPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes ssFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes ssSlideUp {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==========================================================================
   Animation Classes
   ========================================================================== */

/* Spin */
.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-spin-slow {
    animation: spin 2s linear infinite;
}

/* Pulse */
.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Fade */
.animate-fade-in {
    animation: fadeIn 0.3s ease;
}

.animate-fade-out {
    animation: fadeOut 0.3s ease;
}

/* Slide */
.animate-slide-up {
    animation: slideInUp 0.3s ease;
}

.animate-slide-down {
    animation: slideInDown 0.3s ease;
}

.animate-slide-left {
    animation: slideInLeft 0.3s ease;
}

.animate-slide-right {
    animation: slideInRight 0.3s ease;
}

/* Scale */
.animate-scale-in {
    animation: scaleIn 0.3s ease;
}

.animate-scale-out {
    animation: scaleOut 0.3s ease;
}

/* Bounce */
.animate-bounce {
    animation: bounce 1s ease;
}

/* Shake */
.animate-shake {
    animation: shake 0.5s ease;
}

/* Cart Animations */
.animate-cart-pulse {
    animation: cartPulse 0.5s ease;
}

.animate-cart-bounce {
    animation: cartBounce 0.5s ease;
}

/* Wishlist Animations */
.animate-wishlist-pulse {
    animation: wishlistPulse 0.5s ease;
}

.animate-wishlist-spin {
    animation: wishlist-spin 0.5s linear;
}

/* Checkmark */
.animate-checkmark {
    animation: checkmark 0.4s ease;
}

/* Modal Animations */
.animate-modal-fade-in {
    animation: modalFadeIn 0.3s ease;
}

.animate-modal-fade-out {
    animation: modalFadeOut 0.3s ease;
}

.animate-modal-slide-up {
    animation: modalSlideUp 0.3s ease;
}

/* Success Animation */
.animate-success-pulse {
    animation: successPulse 1s ease;
}

/* Filter Animation */
.animate-filter-pulse {
    animation: filterPulse 0.5s ease;
}

/* ==========================================================================
   Transition Classes
   ========================================================================== */

/* Base Transition */
.transition {
    transition-property: all;
    transition-duration: 0.3s;
    transition-timing-function: ease;
}

.transition-fast {
    transition-duration: 0.15s;
}

.transition-slow {
    transition-duration: 0.5s;
}

/* Specific Transitions */
.transition-opacity {
    transition-property: opacity;
}

.transition-transform {
    transition-property: transform;
}

.transition-colors {
    transition-property: background-color, border-color, color, fill, stroke;
}

.transition-shadow {
    transition-property: box-shadow;
}

.transition-all {
    transition-property: all;
}

/* Timing Functions */
.ease-linear {
    transition-timing-function: linear;
}

.ease-in {
    transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}

.ease-out {
    transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
}

.ease-in-out {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Hover Animation Classes
   ========================================================================== */

.hover-grow:hover {
    transform: scale(1.05);
}

.hover-shrink:hover {
    transform: scale(0.95);
}

.hover-lift:hover {
    transform: translateY(-4px);
}

.hover-sink:hover {
    transform: translateY(4px);
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

.hover-shadow:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   Loading Animations
   ========================================================================== */

/* Dots Loading */
.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: #007bff;
    border-radius: 50%;
    animation: pulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Bar Loading */
.loading-bar {
    width: 100%;
    height: 4px;
    background: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
}

.loading-bar::after {
    content: '';
    display: block;
    width: 40%;
    height: 100%;
    background: #007bff;
    animation: progress 2s ease-in-out infinite;
}

/* ==========================================================================
   Notification Animations
   ========================================================================== */

.notification-enter {
    animation: slideInRight 0.3s ease;
}

.notification-exit {
    animation: slideOutRight 0.3s ease;
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ==========================================================================
   Accessibility Considerations
   ========================================================================== */

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}