/**
 * Estilos públicos para el Widget de Playlist de YouTube (Premium UX/UI).
 */

/* Contenedor general del Widget */
.yt-playlist-widget-container {
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    margin: 20px auto;
    max-width: 1200px; /* Evitar estiramiento infinito en pantallas ultra-anchas */
    transition: background-color 0.3s ease;
    box-sizing: border-box;
    
    /* Configurar para Container Queries */
    container-type: inline-size;
    container-name: yt-playlist;
}

/* Títulos y descripción principales */
.yt-playlist-widget-container .yt-main-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: 700;
    line-height: 1.2;
}

.yt-playlist-widget-container .yt-main-desc {
    margin-top: 0;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Grid de videos en 3 columnas */
.yt-videos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 35px;
    width: 100%;
}

/* Soporte responsive premium usando CONTAINER QUERIES (se adaptan al ancho de la columna receptora) */
@container yt-playlist (max-width: 850px) {
    .yt-videos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .yt-playlist-widget-container {
        padding: 20px;
    }
}

@container yt-playlist (max-width: 550px) {
    .yt-videos-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .yt-playlist-widget-container {
        padding: 15px;
    }
}

/* Tarjeta individual de video */
.yt-video-card {
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Contenedor del Thumbnail */
.yt-video-thumb-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Imagen miniatura de YouTube */
.yt-video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Enlace contenedor */
.yt-video-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

/* Capa del botón de Play (Centrado absoluto) */
.yt-play-button-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
}

/* Icono SVG del botón play */
.yt-svg-play {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Elementos internos del SVG */
.yt-svg-play-bg {
    fill: #212121;
    fill-opacity: 0.85;
    transition: fill 0.25s cubic-bezier(0.4, 0, 0.2, 1), fill-opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.yt-svg-play-triangle {
    fill: #ffffff;
}

/* Micro-animaciones en hover */
.yt-video-card:hover .yt-video-thumbnail {
    transform: scale(1.06);
}

.yt-video-card:hover .yt-svg-play-bg {
    fill: #ff0000;
    fill-opacity: 1;
}

.yt-video-card:hover .yt-svg-play {
    transform: scale(1.12);
}

.yt-video-card:hover {
    transform: translateY(-4px);
}

/* Envoltura del título del video debajo del thumbnail */
.yt-video-title-wrap {
    margin-top: 12px;
    padding: 0 4px;
}

.yt-video-title-wrap h1,
.yt-video-title-wrap h2,
.yt-video-title-wrap h3,
.yt-video-title-wrap h4,
.yt-video-title-wrap h5,
.yt-video-title-wrap p,
.yt-video-title-wrap span {
    margin: 0;
    line-height: 1.4;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2; /* Propiedad estándar para compatibilidad futura */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.yt-video-title-wrap a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

.yt-video-title-wrap a:hover {
    color: #ff0000 !important;
}

/* Celdas vacías de relleno/placeholders */
.yt-video-placeholder {
    visibility: hidden;
    pointer-events: none;
    aspect-ratio: 16 / 9;
}

.yt-video-placeholder-inner {
    width: 100%;
    height: 100%;
    background: transparent;
}

/* Paginador del Widget */
.yt-playlist-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 25px;
}

.yt-pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #ffffff;
    border: 1px solid #dcdfe6;
    color: #606266;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    user-select: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.yt-pagination-btn:hover:not(:disabled) {
    color: #ff0000;
    border-color: #ffb3b3;
    background-color: #fff5f5;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 0, 0, 0.08);
}

.yt-pagination-btn:active:not(:disabled) {
    transform: translateY(0);
}

.yt-pagination-btn:disabled {
    color: #c0c4cc;
    background-color: #f5f7fa;
    border-color: #e4e7ed;
    cursor: not-allowed;
    box-shadow: none;
}

.yt-pagination-info {
    font-size: 14px;
    color: #909399;
    font-weight: 500;
    user-select: none;
}

.yt-current-page {
    color: #ff0000;
    font-weight: 700;
}

.yt-total-pages {
    color: #303133;
}

/* Mensajes de error o info */
.yt-playlist-error {
    background-color: #fff0f0;
    border-left: 4px solid #ff0000;
    color: #a80000;
    padding: 15px 20px;
    border-radius: 0 6px 6px 0;
    font-size: 14px;
    font-weight: 500;
    margin: 15px 0;
}

.yt-playlist-info {
    background-color: #fdf6ec;
    border-left: 4px solid #e6a23c;
    color: #c17b11;
    padding: 15px 20px;
    border-radius: 0 6px 6px 0;
    font-size: 14px;
    font-weight: 500;
    margin: 15px 0;
}
