.music-player-container {
    position: fixed;
    right: 28px;
    bottom: 0;
    z-index: 2000;
    transition: transform 0.3s ease-in-out;
}

.music-player-container.collapsed .player-widget {
    height: 48px;
    padding-top: 3px;
    padding-bottom: 3px;
    overflow: hidden;
}

.music-player-widget {
    width: 280px;
    padding: 0px 4px 3px 4px;
    border-style: solid;
    border-width: 10px;
    border-image-slice: 33% fill;
    border-image-source: url('../Img/UI_Box_Musicplayer.png');
    color: #f0e6d2;
    font-family: 'Silkscreen', sans-serif;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background-color: rgba(0,0,0,0.5);
    position: relative;
    overflow: visible;
}

.player-cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}

.player-header, .player-progress-container, .player-controls {
    position: relative;
    z-index: 1;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding-right: 25px;
}

.song-info {
    flex: 1;
    overflow: hidden;
}

.marquee-container {
    width: 100%;
    overflow: visible;
    white-space: nowrap;
    position: relative;
    display: flex;
    align-items: baseline;
}

.marquee-scroll-window {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.track-number {
    font-size: calc(14px + var(--font-offset));
    font-weight: bold;
    color: #fffde7;
    margin-right: 4px;
    flex-shrink: 0;
}

.song-title {
    font-size: var(--font-size-body) !important;
    font-weight: bold;
    color: #fffde7;
    margin-bottom: 1px;
    text-transform: uppercase;
    display: inline-block;
    min-width: 0;
}

.song-artist {
    font-size: var(--font-size-interpreter) !important;
    color: #d4c4a8;
    display: inline-block;
    min-width: 100%;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    10% { transform: translateX(0); }
    45% { transform: translateX(var(--move-dist, 0)); }
    55% { transform: translateX(var(--move-dist, 0)); }
    90% { transform: translateX(0); }
    100% { transform: translateX(0); }
}

.marquee-active {
    animation: marquee 8s linear infinite alternate;
}

.collapse-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    cursor: pointer;
    background-image: url('../Img/UI_Collapse_Normal.png');
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 10;
}

.collapse-btn:hover {
    background-image: url('../Img/UI_Collapse_Hovered.png');
}

.collapse-btn:active {
    background-image: url('../Img/UI_Collapse_Pressed.png');
}

.collapsed .collapse-btn {
    background-image: url('../Img/UI_Expand_Normal.png');
    transform: none;
}

.collapsed .collapse-btn:hover {
    background-image: url('../Img/UI_Expand_Hovered.png');
}

.collapsed .collapse-btn:active {
    background-image: url('../Img/UI_Expand_Pressed.png');
}

.player-progress-container {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.progress-slider {
    width: 100%;
    height: 12px;
}

.progress-time {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-timestamp) !important;
    color: #aaa;
    margin-top: -6px;
}

.player-controls {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    margin-top: 0px;
}

.control-btn {
    cursor: pointer;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    image-rendering: pixelated;
}

.btn-prev { 
    width: 24px; 
    height: 24px; 
    background-image: url('../Img/UI_Button_Media_Prev_Normal.png'); 
}

.btn-prev:hover {
    background-image: url('../Img/UI_Button_Media_Prev_Hoverede.png');
}

.btn-prev:active {
    background-image: url('../Img/UI_Button_Media_Prev_Pressed.png');
}

.btn-play-pause { 
    width: 32px; 
    height: 32px; 
    background-image: url('../Img/UI_Button_Media_PlayPause_Normal.png');
}

.btn-play-pause:hover {
    background-image: url('../Img/UI_Button_Media_PlayPause_Hovered.png');
}

.btn-play-pause:active {
    background-image: url('../Img/UI_Button_Media_PlayPause_Pressed.png');
}

.playing .btn-play-pause {
    filter: hue-rotate(90deg);
}

.btn-next { 
    width: 24px; 
    height: 24px; 
    background-image: url('../Img/UI_Button_Media_Next_Normal.png'); 
}

.btn-next:hover {
    background-image: url('../Img/UI_Button_Media_Next_Hovered.png');
}

.btn-next:active {
    background-image: url('../Img/UI_Button_Media_Next_Pressed.png');
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.volume-icon {
    width: 24px;
    height: 24px;
    background-image: url('../Img/Icons/Icon_Volume.png');
    background-size: contain;
    background-repeat: no-repeat;
    image-rendering: pixelated;
}

.volume-slider {
    flex: 1;
    height: 12px;
}

.player-widget .ui-slider {
    padding: 0;
    overflow: visible;
}

.player-widget .ui-slider-track {
    height: 12px;
    border-image-width: 6px; 
    border-image-slice: 7 7 7 7 fill;
}

.player-widget .ui-slider-fill {
    border-image-width: 6px; 
    border-image-slice: 7 7 7 7 fill;
    clip-path: inset(0 0 0 0);
}

.player-widget .ui-slider-handle {
    width: 16px;
    height: 16px;
    transform: translateX(-50%);
    z-index: 10;
}

@media screen and (max-width: 768px) {
    .music-player-container {
        right: 0;
    }

    .music-player-container.collapsed .song-info {
        display: none;
    }

    .music-player-container.collapsed .music-player-widget {
        width: 42px;
        min-width: 42px;
        padding: 0;
        margin-right: 0;
        border-width: 10px;
        overflow: hidden;
    }

    .music-player-container.collapsed .player-header {
        padding: 0;
        justify-content: center;
        align-items: center;
        width: 100%;
        height: 100%;
        min-height: 22px;
    }

    .music-player-container.collapsed .collapse-btn {
        position: static;
        margin: 0;
        display: block;
    }

    .music-player-container.collapsed .player-cover-overlay {
        display: none;
    }

    .music-player-container.collapsed {
        height: 42px;
        display: flex;
        justify-content: flex-end;
        align-items: flex-end;
    }
}
