/* css/style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #121212;
    color: #ffffff;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 100px; /* Espacio para el reproductor */
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: #1DB954;
    margin-bottom: 20px;
    font-size: 2.5rem;
}

.search-bar {
    margin-bottom: 20px;
}

#buscador {
    width: 100%;
    max-width: 500px;
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    background-color: #282828;
    color: white;
    font-size: 16px;
}

/* Caja de filtros */
.filters {
    background: #181818;
    padding: 10px;
    border-radius: 15px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    white-space: nowrap;
}

/* Grupo desplazable */
.filter-group {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
}

/* Select estilo Spotify */
.filters select {
    background: #282828;
    border: 1px solid #333;
    color: #ddd;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;

    /* ⭐ Previene desbordes sin romper el layout */
    width: 100%;
    max-width: 160px;
    min-width: 110px;

    overflow: hidden;

    flex-shrink: 1;   /* ⭐ Permite que se ajusten sin empujar a los demás */
}

/* Ajustes para pantallas grandes */
@media (min-width: 1200px) {
    .filters select {
        max-width: 190px;   /* Más espacio disponible */
    }
}

/* Tablets */
@media (max-width: 900px) {
    .filters select {
        max-width: 140px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .filter-group {
        overflow-x: auto;
    }

    .filters select {
        max-width: 140px;
    }
}



.btn-actualizar {
    padding: 10px 15px;
    border: none;
    border-radius: 20px;
    background-color: #1DB954;
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.btn-actualizar:hover {
    background-color: #1ed760;
}

.playlists-section, .songs-section {
    margin-bottom: 40px;
}

h2 {
    color: #1DB954;
    margin-bottom: 20px;
    border-bottom: 1px solid #282828;
    padding-bottom: 10px;
}

.playlists {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.playlist-card {
    background-color: #282828;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.playlist-card:hover {
    background-color: #383838;
}

.playlist-card h3 {
    margin-bottom: 10px;
    color: #1DB954;
}

.playlist-card p {
    color: #b3b3b3;
    font-size: 14px;
}

.songs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.song-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #181818;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.song-item:hover {
    background-color: #282828;
}

.song-info h3 {
    color: white;
    margin-bottom: 5px;
}

.song-info p {
    color: #b3b3b3;
    font-size: 14px;
}

.song-duration {
    display: flex;
    align-items: center;
    gap: 15px;
}

.play-btn {
    background-color: #1DB954;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.play-btn:hover {
    background-color: #1ed760;
}

.no-songs {
    text-align: center;
    padding: 40px;
    background-color: #282828;
    border-radius: 8px;
}

.no-songs p {
    margin-bottom: 10px;
    color: #b3b3b3;
}

/* Reproductor */
.player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #181818;
    border-top: 1px solid #282828;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.player.hidden {
    display: none;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.current-song {
    min-width: 200px;
}

.current-song span {
    display: block;
}

#current-title {
    font-weight: bold;
}

#current-artist {
    color: #b3b3b3;
    font-size: 14px;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.player-controls button {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
}

.player-controls button:hover {
    color: #1DB954;
}

.progress-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex-grow: 1;
    height: 4px;
    background-color: #5e5e5e;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.progress {
    height: 100%;
    background-color: #1DB954;
    border-radius: 2px;
    width: 0%;
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .player-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .progress-container {
        width: 100%;
    }
    
    .current-song {
        min-width: auto;
    }
}

/* Agregar estos estilos al CSS existente */

.loading {
    text-align: center;
    padding: 40px;
    background-color: #282828;
    border-radius: 8px;
    margin-bottom: 20px;
}

.loading .progress-bar {
    width: 100%;
    height: 20px;
    background-color: #5e5e5e;
    border-radius: 10px;
    margin: 20px 0;
    overflow: hidden;
}

.loading .progress {
    height: 100%;
    background-color: #1DB954;
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
}

.album-thumb {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
    margin-right: 15px;
}

.album-thumb.placeholder {
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.song-header {
    display: flex;
    align-items: center;
}

.song-details h3 {
    margin-bottom: 5px;
}

.song-details p {
    color: #b3b3b3;
    font-size: 14px;
    margin-bottom: 5px;
}

.song-year, .song-genre {
    display: inline-block;
    background-color: #333;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin-right: 5px;
    color: #ccc;
}

.album-art img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

#volume-control {
    width: 80px;
}

/* Responsive */
@media (max-width: 768px) {
    .song-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .album-thumb {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* Agregar al CSS existente */

.btn-metadatos {
    padding: 10px 15px;
    border: none;
    border-radius: 20px;
    background-color: #4A90E2;
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.btn-metadatos:hover {
    background-color: #357ABD;
}

.song-meta {
    margin-top: 5px;
}

.song-year, .song-genre, .song-duration {
    display: inline-block;
    background-color: #333;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-right: 5px;
    color: #ccc;
}

.song-duration {
    background-color: #1DB954;
    color: white;
}

.song-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.album-thumb {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
    margin-right: 15px;
}

.album-thumb.placeholder {
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.song-header {
    display: flex;
    align-items: center;
}

/* Responsive */
@media (max-width: 768px) {
    .filters {
        flex-direction: column;
    }
    
    .song-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .album-thumb {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* Agregar al CSS existente */

/* Navegaci贸n entre vistas */
.view-navigation {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.view-btn {
    padding: 10px 20px;
    border: 2px solid #333;
    background: #282828;
    color: #b3b3b3;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn:hover {
    border-color: #555;
    color: white;
}

.view-btn.active {
    border-color: #1DB954;
    background: #1DB954;
    color: white;
}

.view-section {
    display: none;
}

.view-section.active {
    display: block;
}

/* Header de lista actual */
.lista-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.btn-volver {
    padding: 8px 16px;
    background: #333;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-volver:hover {
    background: #444;
}

.btn-reproducir-lista {
    padding: 10px 20px;
    background: #1DB954;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
}

.btn-reproducir-lista:hover {
    background: #1ed760;
}

/* Tarjetas de lista mejoradas */
.playlist-card {
    background: #282828;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.playlist-card:hover {
    background: #383838;
    transform: translateY(-2px);
}

.playlist-stats {
    margin: 10px 0;
    color: #b3b3b3;
    font-size: 14px;
}

.playlist-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-ver-lista, .btn-reproducir-lista {
    padding: 8px 12px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.btn-ver-lista {
    background: #333;
    color: white;
}

.btn-ver-lista:hover {
    background: #444;
}

.btn-reproducir-lista {
    background: #1DB954;
    color: white;
}

.btn-reproducir-lista:hover {
    background: #1ed760;
}

/* Acciones de canci贸n en listas */
.song-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.remove-from-list-btn {
    background: none;
    border: none;
    color: #ff4444;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.remove-from-list-btn:hover {
    background: rgba(255, 68, 68, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .view-navigation {
        justify-content: center;
    }
    
    .lista-header {
        flex-direction: column;
        text-align: center;
    }
    
    .playlist-actions {
        justify-content: center;
    }
    
    .song-actions {
        flex-direction: column;
        gap: 5px;
    }
}

/* === RESPONSIVE PARA MOVILES === */
@media (max-width: 480px) {

    .container {
        padding: 10px;
        max-width: 100%;
    }

    h1 {
        font-size: 1.6rem;
    }

    .filters {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .filters select,
    .filters button {
        width: 100%;
        font-size: 14px;
    }

    .view-navigation {
        flex-direction: column;
        width: 100%;
    }

    .view-btn {
        width: 100%;
        text-align: center;
    }

    /* SONG ITEMS RESPONSIVE */
    .song-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        width: 100%;
    }

    .song-duration {
        width: 100%;
        justify-content: flex-end;
    }

    .song-header {
        width: 100%;
        flex-direction: row;
        gap: 10px;
    }

    .album-thumb {
        width: 40px;
        height: 40px;
        margin-right: 10px;
    }

    /* PLAYLIST CARDS */
    .playlists {
        grid-template-columns: 1fr;
    }

    /* Lista actual */
    .lista-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    /* PLAYER FIX */
    .player {
        flex-direction: column;
        padding: 10px;
        gap: 10px;
    }

    .player-info {
        flex-direction: column;
        text-align: center;
    }

    .progress-container {
        width: 100%;
    }
}

