/* ========================================
   ATCSOL - Image Loader Styles
   ======================================== */

/* Loading Skeleton Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Image Loading State */
img.loading {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 20%,
        #f0f0f0 40%,
        #f0f0f0 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
    color: transparent !important;
    min-height: 200px;
}

/* Service Card Images Loading */
.service-card img.loading {
    min-height: 280px;
}

/* Company Overview Image Loading */
.company-image img.loading {
    min-height: 600px;
}

/* Accordion Images Loading (Index) */
.accordion-item.loading::after {
    background: linear-gradient(
        90deg,
        #3a3a3a 0%,
        #2a2a2a 20%,
        #3a3a3a 40%,
        #3a3a3a 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
}

/* Hide alt text while loading */
img.loading::before {
    content: '';
    display: block;
}

img.loading {
    text-indent: -9999px;
    overflow: hidden;
}

/* Loaded State - Fade In */
img.loaded {
    animation: fadeIn 0.5s ease-in-out;
}

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

/* Spinner Loading (Alternative) */
.image-wrapper {
    position: relative;
}

.image-wrapper.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(73, 80, 188, 0.2);
    border-top-color: #4950bc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}
