/* ========================================= */
/* VARIABLES DE IXMUSIC                      */
/* ========================================= */
:root {
    --color-fondo-intermedio: #1e1b2e;
    --color-acento-lila: #7e5bef;
    --color-texto-claro: #FFFFFF;
    --color-texto-secundario: #9CA3AF;
}

/* ========================================= */
/* REPRODUCTOR FIJO                          */
/* ========================================= */
.fixed-player {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background-color: #121212;
    border-top: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1050; /* Z-index alto para estar sobre el footer de Bootstrap */
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.6);
}

.song-info {
    display: flex;
    align-items: center;
    width: 30%;
}

.player-cover {
    width: 55px;
    height: 55px;
    border-radius: 6px;
    margin-right: 15px;
    object-fit: cover;
}

.player-title {
    font-weight: bold;
    color: var(--color-texto-claro);
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.player-artist {
    color: var(--color-texto-secundario);
    font-size: 0.85rem;
}

.controls {
    display: flex;
    gap: 25px;
    width: 40%;
    justify-content: center;
}

.controls button {
    background: none;
    border: none;
    color: var(--color-texto-claro);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}

.controls button:hover {
    color: var(--color-acento-lila);
    transform: scale(1.1);
}

.player-progress {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 30%;
}

#seek-bar {
    flex-grow: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    background: #555;
    border-radius: 2px;
}

#seek-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-acento-lila);
}

.time-current, .time-total {
    font-size: 0.85rem;
    color: var(--color-texto-secundario);
}

/* ========================================= */
/* GRID GENERADO POR FIREBASE (CANCIONES)    */
/* ========================================= */
.song-grid-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto; 
    overflow-y: hidden; 
    padding: 10px 0 20px 0; 
    gap: 20px;
}

.song-grid-container::-webkit-scrollbar {
    height: 8px; 
    background-color: rgba(0,0,0,0.2);
}

.song-grid-container::-webkit-scrollbar-thumb {
    background-color: var(--color-acento-lila);
    border-radius: 4px;
}

.song-card {
    cursor: pointer;
    text-align: left;
    background-color: #2a263d; 
    padding: 15px;
    flex-shrink: 0; 
    width: 170px; 
    border-radius: 12px;
    transition: background-color 0.3s, transform 0.2s;
    position: relative; 
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.song-card:hover {
    background-color: #38344e; 
    transform: translateY(-4px);
}

.card-cover-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 100%; 
    margin-bottom: 10px;
}

.card-cover {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; 
    border-radius: 8px; 
}

.card-title {
    margin: 0;
    color: var(--color-texto-claro);
    font-weight: bold;
    font-size: 1rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.card-artist {
    margin: 2px 0 0;
    color: var(--color-acento-lila); 
    font-size: 0.9rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.card-play-icon {
    position: absolute;
    bottom: 8px; right: 8px;
    background-color: var(--color-acento-lila);
    color: var(--color-texto-claro);
    padding: 10px;
    border-radius: 50%;
    font-size: 1.2rem;
    line-height: 1;
    opacity: 0; 
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none; 
}

.song-card:hover .card-play-icon {
    opacity: 1; 
    transform: translateY(-5px); 
}

.song-card.active {
    background-color: #4b446a; 
    border: 1px solid var(--color-acento-lila);
}

/* SCROLL INTERNO */
.song-scroll-wrapper {
    max-height: 70vh; 
    overflow-y: auto; 
    padding-right: 15px; 
}

.song-scroll-wrapper::-webkit-scrollbar {
    width: 8px;
    background-color: rgba(0,0,0,0.2);
}

.song-scroll-wrapper::-webkit-scrollbar-thumb {
    background-color: var(--color-acento-lila);
    border-radius: 4px;
}

/* MEDIA QUERIES PARA MÓVIL (Reproductor) */
@media (max-width: 768px) {
    .fixed-player {
        justify-content: center;
    }
    .controls {
        width: 100%;
    }
}