#floatingPlayer {
    position: fixed;
    bottom: 65px;
    left: 5%;
    width: 90%;
    display: grid;
    grid-template-columns: 220px 1fr 220px;
    align-items: center;
    padding: 10px 80px;
    background: #000000a6;
    border: 1px solid #FFCC00;
    border-radius: 20px;
    color: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
    transform: translateY(200%);  /*Oculto (fuera de la pantalla) */
    transition: transform 0.3s ease-out;  /*Animación de entrada/salida */
    z-index: 9999;
}

/* 2. Ocultar el elemento de audio nativo (SÓLO lo usamos como motor) */
#audioPlayerContainerFloat audio {
    display: none !important; 
}

/* 3. Estilos de los controles personalizados */
#customPlayerControls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    color: white;
    width: 100%;
}

.player-icon {
    background: none;
    border: none;
    color: white; /* Iconos blancos */
    font-size: 1.2em;
    cursor: pointer;
    padding: 5px;
}
.player-icon:hover {
    color: #ccc;
}

/* 4. Estilos para la barra de progreso (Personalización) */
#progressBar, #volumeControl {
    -webkit-appearance: none; /* Oculta el estilo nativo de Chrome/Safari */
    appearance: none;
    height: 6px;
    width: 100px;
    background: #555; /* Fondo de la barra */
    border-radius: 3px;
    cursor: pointer;
}

/* Thumb (el circulito de la barra) */
#progressBar::-webkit-slider-thumb, #volumeControl::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white; /* Circulito blanco */
    cursor: pointer;
}

.contenedorCaratula {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: center;
}

#musicCaratulaCustom {
    width: 68px;
    height: 68px;
    border-radius: 10px;
    object-fit: cover;
}

#musicTitleCustom {
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

#musicArtistaCustom {
    font-size: 0.8rem;
    color: white;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#musicTitleCustom {
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-player-visible {
    transform: translateY(0) !important; /* Visible */
}

/* Estilos internos del reproductor */
#audioPlayerContainerFloat audio {
    width: 100%;
    margin-top: 5px;
}

.close-player-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    margin-left: 15px;
}

audio::-webkit-media-controls, audio::-webkit-media-controls-enclosure, audio::-webkit-media-controls-panel {
    background: #0e0e0e !important;
    color: #ffffff;
    border-radius: 10px;
}

audio::-webkit-media-controls-panel {
    background-color: #0e0e0e;
}

audio::-webkit-media-controls-play-button,
audio::-webkit-media-controls-time-remaining-display, audio::-webkit-media-controls-current-time-display, audio::-webkit-media-controls-timeline,
audio::-webkit-media-controls-timeline {
    color: #fff
}

.left-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.center-section {
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.right-section {
    display: flex;
    justify-content: flex-end;
    min-width: 40px;
}

@media (max-width: 1450px) {
    #floatingPlayer {
        grid-template-columns: 120px 1fr 50px;
        width: 95%;
        left: 2.5%;
        right: 2.5%;
        padding: 10px 20px;
    }

    #musicCaratulaCustom {
        width: 55px;
        height: 55px;
    }

    .contenedorCaratula {
        gap: 10px;
        overflow: hidden;
        align-items: center;
    }

    .info-music {
        flex-direction: column;
        max-width: 90px;
        min-width: 0;
        overflow: hidden;
        justify-content: center;
    }

    #musicTitleCustom, #musicArtistaCustom {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #musicTitleCustom {
        font-size: 0.85rem;
        font-weight: bold;
    }

    #musicArtistaCustom {
        font-size: 0.75rem;
        font-weight: 400;
        opacity: 0.9;
    }

    /* Controles */
    #customPlayerControls {
        gap: 10px;
        justify-content: center;
        width: 100%;
        min-width: 0;
    }

    #progressBar {
        height: 4px;
    }

    #volumeControl {
        width: 80px
    }

    .close-player-btn {
        font-size: 1.1rem;
    }
}

@media (max-width: 700px) {
    #floatingPlayer {
        grid-template-columns: 60px 1fr 40px;
        width: 95%;
        border-radius: 15px;
        left: 3%;
        right: 3%;
    }

    .contenedorCaratula {
        gap: 10px;
    }

    #musicCaratulaCustom {
        width: 50px;
        height: 50px;
    }

    .info-music {
        display: none;
    }

    #customPlayerControls {
        gap: 5px;
    }

    #progressBar {
        display: block;
        width: 100%;
        height: 4px;
    }

    #volumeControl {
        display: none;
    }

    .close-player-btn {
        margin-left: 0;
        font-size: 1em;
    }
}

@media (max-width: 450px) {
    #floatingPlayer {
        grid-template-columns: 1fr 40px !important;
        padding: 8px 12px;
        width: 94%;
        left: 3%;
        right: 3%;
    }

    .contenedorCaratula {
        display: none !important;
    }

    #musicCaratulaCustom {
        display: none !important;
    }

    #customPlayerControls {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 6px;
    }

    #progressBar {
        width: 100%;
        height: 4px;
    }

    #volumeControl {
        display: none !important;
    }

    .close-player-btn {
        font-size: 1.2rem;
    }
}

@media (max-width: 360px) {
    #floatingPlayer {
        grid-template-columns: 1fr 35px !important;
        padding: 6px 10px;
    }

    .contenedorCaratula {
        display: none !important;
    }

    #customPlayerControls {
        gap: 4px;
        justify-content: center;
    }

    .player-icon[data-action="back"], .player-icon[data-action="forward"], #volumeControl {
        display: none !important;
    }

    #progressBar {
        width: 100%;
        height: 4px;
        display: block;
    }

    .close-player-btn {
        font-size: 1.1rem;
    }
}