/**
 * Estilos para Optimización de Imágenes
 * ChancayPlay - Image Optimization CSS
 */

/* Lazy loading styles */
.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy.loaded {
    opacity: 1;
}

/* Optimización de imágenes de canales */
.channel-item img,
.channel-logo {
    max-width: 300px;
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.channel-item img:hover,
.channel-logo:hover {
    transform: scale(1.05);
}

/* Placeholder para imágenes cargando */
.channel-item img[data-src] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Optimización para diferentes tamaños de pantalla */
@media (max-width: 768px) {
    .channel-item img,
    .channel-logo {
        max-width: 150px;
        max-height: 100px;
    }
}

@media (min-width: 1025px) {
    .channel-item img,
    .channel-logo {
        max-width: 250px;
        max-height: 150px;
    }
}

/* Estilos para WebP fallback */
.no-webp .channel-item img {
    /* Estilos específicos para navegadores sin WebP */
}

.webp .channel-item img {
    /* Estilos específicos para navegadores con WebP */
}

/* Optimización de carga */
.channel-item {
    position: relative;
    overflow: hidden;
}

.channel-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1;
}

.channel-item:hover::before {
    opacity: 1;
}
