/* Reset y fuerza de estilos para evitar conflictos con tema Pique */
.pique-youtube-container * {
    box-sizing: border-box !important;
}

.pique-youtube-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.pique-playlist-section {
    margin-bottom: 50px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
}

.playlist-title {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #ff0000;
    padding-bottom: 10px;
}

/* Reproductor */
.main-player {
    margin-bottom: 20px;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: 8px;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Contenedor de miniaturas con navegación */
.thumbnails-nav-container {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-top: 15px;
}

/* Botones de navegación */
.nav-btn {
    flex: 0 0 40px;
    width: 40px;
    min-width: 40px;
    height: auto;
    align-self: center;
    background: #ff0000;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5em;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
    aspect-ratio: 1;
}

.nav-btn:hover:not(:disabled) {
    background: #cc0000;
    transform: scale(1.1);
}

.nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
}

/* DESKTOP - 4 miniaturas */
.thumbnails-wrapper {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    min-height: 100px;
}

.thumbnail-item {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
    position: relative;
}

.thumbnail-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.thumbnail-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

.thumbnail-item .video-title {
    padding: 6px 8px;
    font-size: 0.75em;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #fff;
    line-height: 1.2;
}

.thumbnail-item.active {
    box-shadow: 0 0 0 2px #ff0000;
}

.thumbnail-item.active::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,0,0,0.9);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    pointer-events: none;
}

.loading-text, .no-videos {
    text-align: center;
    padding: 40px;
    color: #666;
    grid-column: 1 / -1;
}

.thumbnails-wrapper.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* TABLET Y MÓVIL - 3 miniaturas */
@media (max-width: 768px) {
    .pique-youtube-container {
        padding: 10px;
    }
    
    .pique-playlist-section {
        padding: 15px;
        margin-bottom: 30px;
    }
    
    .playlist-title {
        font-size: 1.2em;
    }
    
    .thumbnails-wrapper {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .thumbnail-item img {
        height: 75px;
    }
    
    .thumbnail-item .video-title {
        font-size: 0.72em;
        padding: 4px 6px;
    }
    
    .nav-btn {
        flex: 0 0 36px;
        width: 36px;
        min-width: 36px;
        font-size: 1.2em;
    }
    
    .thumbnails-nav-container {
        gap: 8px;
    }
}

/* Móvil pequeño */
@media (max-width: 480px) {
    .pique-playlist-section {
        padding: 10px;
    }
    
    .playlist-title {
        font-size: 1.1em;
    }
    
    .thumbnails-wrapper {
        gap: 6px;
    }
    
    .thumbnail-item img {
        height: 70px;
    }
    
    .thumbnail-item .video-title {
        font-size: 0.7em;
        padding: 3px 5px;
    }
    
    .nav-btn {
        flex: 0 0 32px;
        width: 32px;
        min-width: 32px;
        font-size: 1.1em;
    }
}

@media (max-width: 360px) {
    .thumbnail-item img {
        height: 65px;
    }
    
    .thumbnail-item .video-title {
        font-size: 0.65em;
    }
    
    .nav-btn {
        flex: 0 0 28px;
        width: 28px;
        min-width: 28px;
        font-size: 1em;
    }
}