/* Controles de música de fondo */
.music-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 50px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.music-controls:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.music-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.music-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.music-btn:active {
    transform: scale(0.95);
}

.music-play-btn {
    width: 50px;
    height: 50px;
    font-size: 16px;
    background: rgba(76, 175, 80, 0.8);
}

.music-play-btn:hover {
    background: rgba(76, 175, 80, 1);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 15px;
}

.volume-control i {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

#volume-slider {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    appearance: none;
    cursor: pointer;
}

#volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: #4CAF50;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

#volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.5);
}

#volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #4CAF50;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.music-controls {
    animation: fadeIn 0.5s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .music-controls {
        bottom: 15px;
        right: 15px;
        padding: 12px 15px;
        gap: 10px;
    }
    
    .music-btn {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
    
    .music-play-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .volume-control {
        margin-left: 8px;
        padding-left: 10px;
    }
    
    #volume-slider {
        width: 60px;
    }
}

@media (max-width: 480px) {
    .music-controls {
        bottom: 10px;
        right: 10px;
        padding: 10px 12px;
        gap: 8px;
    }
    
    .music-btn {
        width: 30px;
        height: 30px;
        font-size: 10px;
    }
    
    .music-play-btn {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
    
    .volume-control {
        display: none; /* Ocultar controles de volumen en móviles muy pequeños */
    }
}

/* Estados del reproductor */
.music-controls.minimized {
    padding: 8px 10px;
    gap: 8px;
}

.music-controls.minimized .music-btn {
    width: 30px;
    height: 30px;
    font-size: 10px;
}

.music-controls.minimized .music-play-btn {
    width: 35px;
    height: 35px;
    font-size: 12px;
}

.music-controls.minimized .volume-control {
    display: none;
}

/* Efectos de pulsación para indicar reproducción */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.music-play-btn.playing {
    animation: pulse 2s infinite;
}

/* Tooltip para los botones */
.music-btn::after {
    content: attr(title);
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.music-btn:hover::after {
    opacity: 1;
}

/* Indicador de carga */
.music-controls.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Estilos para botones deshabilitados */
.music-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.music-btn:disabled::after {
    opacity: 0.3;
}

.music-play-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
}

#volume-slider:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

#volume-slider:disabled::-webkit-slider-thumb {
    cursor: not-allowed;
}