/**
 * YouTube-like Skeleton Loader
 * Reusable skeleton loader styles for all iYi Elements widgets
 */

/* Base skeleton animation */
@keyframes iyi-skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Base skeleton element */
.iyi-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: iyi-skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
    overflow: hidden;
}

/* Skeleton for slider/carousel */
.iyi-skeleton-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.95);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.iyi-skeleton-slider-item {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: iyi-skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

/* Skeleton for cards/grid items */
.iyi-skeleton-card {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: iyi-skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

/* Skeleton for text lines */
.iyi-skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: iyi-skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.iyi-skeleton-text:last-child {
    margin-bottom: 0;
}

/* Skeleton for images */
.iyi-skeleton-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: iyi-skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

/* Skeleton for circular elements (avatars, icons) */
.iyi-skeleton-circle {
    width: 100%;
    padding-bottom: 100%;
    border-radius: 50%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: iyi-skeleton-loading 1.5s ease-in-out infinite;
}

/* Hide skeleton when content is loaded */
.iyi-skeleton-loaded .iyi-skeleton,
.iyi-skeleton-loaded .iyi-skeleton-slider,
.iyi-skeleton-loaded .iyi-skeleton-card,
.iyi-skeleton-loaded .iyi-skeleton-text,
.iyi-skeleton-loaded .iyi-skeleton-image,
.iyi-skeleton-loaded .iyi-skeleton-circle {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Hide skeleton in Elementor editor */
.elementor-editor-active .iyi-skeleton,
.elementor-editor-active .iyi-skeleton-slider {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .iyi-skeleton-slider {
        background-color: rgba(255, 255, 255, 0.98);
    }
}

