/* === TARJETAS DE CANCIÓN ESTILO SPOTIFY === */

.song-item.spotify-style {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    min-height: 60px;
}

.song-item.spotify-style:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Columna 1: Portada */
.song-album-cover {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.album-cover-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: linear-gradient(135deg, #535353, #282828);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b3b3b3;
    font-size: 16px;
    flex-shrink: 0;
}

/* Columna 2: Información de la canción */
.song-info-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0; /* Permite que el texto se trunque */
    flex: 1;
}

.song-title {
    color: white;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-artist {
    color: #b3b3b3;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Columna 3: Botón de acción */
.song-action-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.add-to-queue-btn {
    background: transparent;
    border: none;
    color: #b3b3b3;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.add-to-queue-btn:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.song-duration {
    color: #b3b3b3;
    font-size: 14px;
    min-width: 40px;
    text-align: right;
}

/* Animación de marquee para textos largos */
.song-item.spotify-style:hover .song-title,
.song-item.spotify-style:hover .song-artist {
    animation: marquee 8s linear infinite;
    padding-left: 100%;
}

@keyframes marquee {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* === RESPONSIVE PARA TARJETAS DE CANCIÓN === */

/* Tablets */
@media (max-width: 768px) {
    .song-item.spotify-style {
        grid-template-columns: 40px 1fr auto;
        gap: 12px;
        padding: 8px 12px;
        min-height: 56px;
    }
    
    .song-album-cover,
    .album-cover-placeholder {
        width: 36px;
        height: 36px;
    }
    
    .song-title {
        font-size: 15px;
    }
    
    .song-artist {
        font-size: 13px;
    }
    
    .add-to-queue-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
}

/* Móviles */
@media (max-width: 480px) {
    .song-item.spotify-style {
        grid-template-columns: 36px 1fr auto;
        gap: 10px;
        padding: 6px 10px;
        min-height: 52px;
    }
    
    .song-album-cover,
    .album-cover-placeholder {
        width: 32px;
        height: 32px;
    }
    
    .song-title {
        font-size: 14px;
    }
    
    .song-artist {
        font-size: 12px;
    }
    
    .song-duration {
        font-size: 12px;
        min-width: 35px;
    }
    
    .add-to-queue-btn {
        width: 24px;
        height: 24px;
        font-size: 14px;
        padding: 6px;
    }
    
    /* En móviles muy pequeños, ocultar duración */
    @media (max-width: 360px) {
        .song-duration {
            display: none;
        }
    }
}

/* Estados especiales */
.song-item.spotify-style.playing {
    background-color: rgba(29, 185, 84, 0.1);
}

.song-item.spotify-style.playing .song-title {
    color: #1DB954;
}

/* Efecto de hover mejorado */
.song-item.spotify-style {
    position: relative;
}

.song-item.spotify-style::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background-color: #1DB954;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.song-item.spotify-style:hover::before {
    opacity: 1;
}

/* Mejora la interactividad de las tarjetas */
.song-item.spotify-style {
    cursor: pointer;
    user-select: none; /* Evita que se seleccione el texto */
}

/* Feedback visual al hacer clic */
.song-item.spotify-style:active {
    background-color: rgba(255, 255, 255, 0.15);
    transform: scale(0.98);
    transition: all 0.1s ease;
}

/* El botón de agregar a cola no debe tener el cursor pointer de la tarjeta */
.add-to-queue-btn {
    cursor: pointer;
}

/* Evitar que el contenedor del botón herede el cursor */
.song-action-container {
    cursor: default;
}

/* --- GRID DE LISTAS --- */
#listas-reproduccion {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

/* --- TARJETA DE LA LISTA --- */
.playlist-grid-card {
    background: #181818;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    position: relative;
}

.playlist-grid-card:hover {
    background: #282828;
    transform: scale(1.04);
}

/* --- PORTADA --- */
.playlist-cover-container {
    position: relative;
}

.playlist-cover {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    background: #333;
}

.playlist-cover.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: #333;
    color: #666;
}

/* --- BOTÓN PLAY FLOTANTE --- */
.playlist-play-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: #1DB954;
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.playlist-grid-card:hover .playlist-play-btn {
    display: flex;
}

/* --- INFO --- */
.playlist-info {
    margin-top: 10px;
}

.playlist-info h3 {
    font-size: 1rem;
    margin: 0;
    color: white;
}

.playlist-info p {
    font-size: 0.8rem;
    color: #bbb;
    margin: 3px 0 5px;
}

.playlist-count {
    font-size: 0.75rem;
    color: #888;
}