﻿/* =============================================================================
   LAZY ELEMENT LOADING — Placeholder & Spinner Styles
   ============================================================================= */

.lazy-element-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
    transition: min-height 0.3s ease, opacity 0.3s ease;
}

.lazy-element-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: lazy-shimmer 1.5s infinite;
}

@keyframes lazy-shimmer {
    to {
        left: 100%;
    }
}

.lazy-element-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e9ecef;
    border-top-color: var(--color-primary, #ff5e14);
    border-radius: 50%;
    animation: lazy-spin 0.7s linear infinite;
    z-index: 1;
}

@keyframes lazy-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Hide placeholder after successful load or on error */
.lazy-element-placeholder.lazy-loaded {
    min-height: 0;
    padding: 0;
    margin: 0;
    background-color: transparent;
    opacity: 0;
    pointer-events: none;
}

.lazy-element-placeholder.lazy-loaded::before {
    display: none;
}

.lazy-element-placeholder.lazy-error {
    min-height: 0;
    padding: 0;
    margin: 0;
    display: none;
}
