#music-ui {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.75), rgba(15, 25, 35, 0.75));
    color: white;
    border-radius: 16px;
    padding: 20px;
    min-width: 320px;
    font-size: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    z-index: 15000;

    opacity: 0;
    transform: translateY(20px);
    transition: 
        opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
        transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
        background 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
        border-color 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
        box-shadow 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

#music-ui.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.music-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.music-title {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    max-width: 290px;
    transition: color 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.music-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.music-progress::before {
    content: 'PLAYING';
    font-size: 10px;
    color: #a0a0a0;
    letter-spacing: 1.5px;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: -4px;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 6px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.1));
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a7c87, #5a8c97, #6a9ca7);
    width: 0%;
    transition: width 0.1s ease, background 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    border-radius: 2px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 40%, 
        rgba(255, 255, 255, 0.2) 60%, 
        transparent 100%);
    border-radius: 2px;
}

.music-time {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #a0a0a0;
    font-weight: 500;
    letter-spacing: 0.3px;
}

#music-ui.idle-mode {
    background: linear-gradient(135deg, rgba(15, 25, 45, 0.85), rgba(25, 35, 55, 0.85));
    border-color: rgba(70, 100, 150, 0.3);
    transition: 
        opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
        transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
        background 1.0s cubic-bezier(0.4, 0, 0.2, 1), 
        border-color 1.0s cubic-bezier(0.4, 0, 0.2, 1), 
        box-shadow 1.0s cubic-bezier(0.4, 0, 0.2, 1);
}

#music-ui.idle-mode.exiting {
    transition: 
        opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
        transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
        background 0.7s cubic-bezier(0.4, 0, 0.2, 1), 
        border-color 0.7s cubic-bezier(0.4, 0, 0.2, 1), 
        box-shadow 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

#music-ui.idle-mode .music-title {
    color: #7bb8d4;
}

#music-ui.idle-mode .progress-fill {
    background: linear-gradient(90deg, #7bb8d4, #5a9cc4);
}

#music-ui.idle-mode.paused {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.85), rgba(40, 40, 50, 0.85));
    border-color: rgba(120, 120, 140, 0.4);
}

#music-ui.idle-mode.paused .music-title {
    color: #c0c0c0;
}

#music-ui.idle-mode.paused .progress-fill {
    background: linear-gradient(90deg, #8898a8, #9AAAB8);
    opacity: 0.7;
}

#music-ui.idle-mode.paused .music-progress::before {
    content: 'PAUSED - IDLE';
    color: #999999;
}

#music-ui.idle-mode.playing .music-progress::before {
    content: 'PLAYING - IDLE';
    color: #7bb8d4;
}

#music-ui.idle-mode.animated {
    animation: idlePulse 3s ease-in-out infinite;
}

#music-ui.idle-mode.paused.animated {
    animation: idlePulsePaused 3s ease-in-out infinite;
}

#music-ui.paused:not(.idle-mode) {
    background: linear-gradient(135deg, rgba(40, 30, 20, 0.75), rgba(50, 40, 30, 0.75));
    border-color: rgba(180, 140, 120, 0.3);
}

#music-ui.paused:not(.idle-mode) .music-title {
    color: #c4a480;
}

#music-ui.paused:not(.idle-mode) .progress-fill {
    background: linear-gradient(90deg, #b89070, #a88060, #987050);
    opacity: 0.7;
}

#music-ui.paused:not(.idle-mode) .music-progress::before {
    content: 'PAUSED';
    color: #b89070;
}

#music-ui.playing:not(.idle-mode) .progress-fill {
    opacity: 1;
}

@keyframes idlePulse {
    0%, 100% { 
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 
                    inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }
    50% { 
        box-shadow: 0 4px 30px rgba(70, 100, 150, 0.4), 
                    inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }
}

@keyframes idlePulsePaused {
    0%, 100% { 
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 
                    inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }
    50% { 
        box-shadow: 0 4px 25px rgba(120, 120, 120, 0.3), 
                    inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }
}

@media (max-width: 480px) {
    #music-ui {
        left: 20px;
        bottom: 20px;
        min-width: 250px;
        padding: 16px;
    }

    .music-title {
        font-size: 13px;
        max-width: 220px;
    }
    
    #combined-hud {
        right: 20px;
        bottom: 20px;
        min-width: 250px;
        padding: 16px;
    }
}
