/* ========== MODERN LOADING EFFECTS ========== */

/* Primary loading glow effect for image processing */
.loading-glow-img {
    position: relative !important;
    pointer-events: none !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    opacity: 0.8 !important;
    transition: opacity 0.3s ease !important;
}

/* Modern pulsing glow background */
.loading-glow-img::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: linear-gradient(
        135deg,
        rgba(18, 158, 217, 0.1) 0%,
        rgba(79, 70, 229, 0.15) 25%,
        rgba(139, 92, 246, 0.2) 50%,
        rgba(79, 70, 229, 0.15) 75%,
        rgba(18, 158, 217, 0.1) 100%
    ) !important;
    animation: modernPulse 2s ease-in-out infinite !important;
    z-index: 1 !important;
    border-radius: inherit !important;
}

/* Flowing shimmer effect */
.loading-glow-img::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 25%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0.4) 75%,
        transparent 100%
    ) !important;
    animation: modernFlow 2.5s ease-in-out infinite !important;
    z-index: 2 !important;
    border-radius: inherit !important;
    backdrop-filter: blur(1px) !important;
}

/* Modern pulse animation */
@keyframes modernPulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.01);
    }
}

/* Modern flow animation */
@keyframes modernFlow {
    0% {
        left: -100%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

/* Enhanced button loading state */
.loading-glow-img[role="button"],
.loading-glow-img.edit-button,
button.loading-glow-img {
    background: linear-gradient(
        135deg,
        rgba(243, 244, 246, 0.9) 0%,
        rgba(229, 231, 235, 0.9) 100%
    ) !important;
    color: #9ca3af !important;
    border-color: #d1d5db !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Enhanced image container loading */
.image-wrapper.loading,
.loading-glow-img .image-wrapper {
    position: relative !important;
    border-radius: 12px !important;
    overflow: hidden !important;
}

.image-wrapper.loading::before,
.loading-glow-img .image-wrapper::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: radial-gradient(
        circle at center,
        rgba(18, 158, 217, 0.15) 0%,
        rgba(79, 70, 229, 0.1) 30%,
        transparent 60%
    ) !important;
    animation: modernRadialPulse 2s ease-in-out infinite !important;
    z-index: 3 !important;
    border-radius: inherit !important;
}

/* Radial pulse animation */
@keyframes modernRadialPulse {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

/* Loading state for product rows */
.product-row.loading,
.product-row.row-glow {
    position: relative !important;
    overflow: hidden !important;
}

.product-row.loading::before,
.product-row.row-glow::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(18, 158, 217, 0.08) 25%,
        rgba(18, 158, 217, 0.15) 50%,
        rgba(18, 158, 217, 0.08) 75%,
        transparent 100%
    ) !important;
    animation: rowGlowFlow 2s ease-in-out !important;
    z-index: 1 !important;
    pointer-events: none !important;
}

/* Row glow flow animation */
@keyframes rowGlowFlow {
    0% {
        left: -100%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

/* Loading overlay improvements */
.loading-overlay {
    position: relative !important;
    background: linear-gradient(
        135deg,
        rgba(18, 158, 217, 0.05) 0%,
        rgba(79, 70, 229, 0.08) 50%,
        rgba(18, 158, 217, 0.05) 100%
    ) !important;
    animation: modernOverlayPulse 2s ease-in-out infinite !important;
    border-radius: 8px !important;
    backdrop-filter: blur(2px) !important;
}

.loading-overlay::before {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 40px !important;
    height: 40px !important;
    margin: -20px 0 0 -20px !important;
    border: 3px solid transparent !important;
    border-top: 3px solid rgba(18, 158, 217, 0.6) !important;
    border-right: 3px solid rgba(79, 70, 229, 0.4) !important;
    border-radius: 50% !important;
    animation: modernSpin 1s linear infinite !important;
    z-index: 2 !important;
}

/* Modern overlay pulse */
@keyframes modernOverlayPulse {
    0%, 100% {
        opacity: 0.7;
        backdrop-filter: blur(1px);
    }
    50% {
        opacity: 0.9;
        backdrop-filter: blur(3px);
    }
}

/* Modern spinner */
@keyframes modernSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced enhance button loading */
#enhanceButton.loading {
    background: linear-gradient(
        135deg,
        rgba(243, 244, 246, 0.9) 0%,
        rgba(229, 231, 235, 0.9) 100%
    ) !important;
    color: #9ca3af !important;
    border-color: #d1d5db !important;
    position: relative !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

#enhanceButton.loading::after {
    background: linear-gradient(
        120deg,
        transparent 0%,
        rgba(156, 163, 175, 0.3) 25%,
        rgba(156, 163, 175, 0.5) 50%,
        rgba(156, 163, 175, 0.3) 75%,
        transparent 100%
    ) !important;
    animation: modernButtonFlow 2s ease-in-out infinite !important;
}

/* Modern button flow */
@keyframes modernButtonFlow {
    0% {
        left: -100%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

/* Ensure proper layering */
.loading-glow-img * {
    position: relative !important;
    z-index: 3 !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .loading-glow-img::before,
    .loading-glow-img::after {
        border-radius: 8px !important;
    }
}

/* Accessibility - reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .loading-glow-img::before,
    .loading-glow-img::after,
    .loading-overlay::before {
        animation-duration: 3s !important;
        animation-timing-function: linear !important;
    }
    
    .loading-glow-img::before {
        animation: modernPulseReduced 3s ease-in-out infinite !important;
    }
    
    @keyframes modernPulseReduced {
        0%, 100% { opacity: 0.4; }
        50% { opacity: 0.6; }
    }
} 