/**
 * Improved Loading States for Real-time Filtering
 * 
 * Stiluri pentru loading states mai subtile și mai plăcute pentru filtrarea în timp real
 */

/* Loading state mai subtil pentru produse */
.category-page-product-loop.loading {
    opacity: 0.7;
    pointer-events: none;
    transition: opacity 0.2s ease;
    position: relative;
}

/* Loading indicator mic pentru real-time filtering */
.digitalease-main-filters::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -30px;
    width: 16px;
    height: 16px;
    border: 2px solid #EAD4C3;
    border-top: 2px solid #590202;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

.digitalease-main-filters.filtering::after {
    opacity: 1;
    visibility: visible;
}

/* Loading overlay mai subtil pentru real-time */
.products-loading-overlay.real-time {
    background-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(1px);
}

.products-loading-overlay.real-time .loading-content {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.products-loading-overlay.real-time .loading-spinner {
    width: 24px;
    height: 24px;
    margin: 0 auto 8px;
    border-width: 2px;
}

.products-loading-overlay.real-time .loading-content p {
    font-size: 13px;
    margin: 0;
}

/* Indicator pentru dropdown activ */
.filter-dropdown.has-changes .filter-dropdown-btn {
    border-color: #590202;
    background-color: rgba(89, 2, 2, 0.05);
}

/* Animații pentru aplicarea filtrelor */
@keyframes filterApplied {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(89, 2, 2, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 4px rgba(89, 2, 2, 0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(89, 2, 2, 0);
    }
}

.filter-dropdown-btn.filter-applied {
    animation: filterApplied 0.6s ease-out;
}

/* Progress bar pentru multiple requests */
.filter-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #EAD4C3;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.filter-progress.active {
    opacity: 1;
    visibility: visible;
}

.filter-progress-bar {
    height: 100%;
    background: #590202;
    width: 0%;
    transition: width 0.3s ease;
    animation: progressPulse 1.5s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Mobile specific loading */
@media (max-width: 768px) {
    .digitalease-main-filters::after {
        right: -25px;
        width: 14px;
        height: 14px;
    }
    
    .products-loading-overlay.real-time .loading-content {
        margin: 0 15px;
        padding: 12px 20px;
    }
}

/* Toast notification pentru filtre aplicate (opțional) */
.filter-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #590202;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 13px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.filter-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.filter-toast.hide {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

/* Micro-animations pentru feedback - versiune fără translatie */
/* Aplicată DOAR pe sidebar, NU pe dropdown-uri */
.digitalease-custom-filters .filter-option input:checked + .checkmark {
    animation: checkmarkGlow 0.3s ease-out;
}

@keyframes checkmarkGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(89, 2, 2, 0.4);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(89, 2, 2, 0.2);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(89, 2, 2, 0);
    }
}

/* Disabled state pentru perioada de loading */
.filter-dropdown.loading .filter-dropdown-btn {
    opacity: 0.7;
    cursor: wait;
}

.filter-dropdown.loading .filter-dropdown-content {
    pointer-events: none;
    opacity: 0.8;
} 