/**
 * ReSales Online API - Loading Spinner and Performance Styles
 * 
 * Add this to your style-filter.css or style-admin.css
 */

/* ============================================
   LOADING SPINNER OVERLAY
   ============================================ */

.rso-loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(2px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease-in-out;
}

.rso-loading.visible {
    display: flex;
}

.rso-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color-filter-rso, #3498db);
    border-radius: 50%;
    animation: rso-spin 1s linear infinite;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes rso-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   FILTER BUTTON STATE (for active filters)
   ============================================ */

.filter-grid button.active {
    background-color: var(--complementary-color-filter-rso, #e74c3c);
    color: white;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .rso-spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
}

/* ============================================
   PERFORMANCE HINTS
   ============================================ */

/* Optimize animations for devices with reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .rso-spinner {
        animation: none;
        border-top-color: var(--primary-color-filter-rso, #3498db);
    }
    
    .rso-loading {
        animation: none;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.rso-loading::after {
    content: "Loading...";
    position: absolute;
    bottom: 30px;
    font-size: 14px;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}
