#global-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(13, 57, 89, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.15);
    font-family: 'Montserrat', Arial, sans-serif;
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
}

#global-player.collapsed {
    height: 88px;
}

#global-player.expanded {
    height: calc(88px + 60vh);
}

body {
    padding-bottom: 88px;
}

.player-bar-collapsed {
    display: flex;
    align-items: center;
    height: 88px;
    padding: 0 20px;
    gap: 16px;
    box-sizing: border-box;
    position: relative;
    order: 2;
}

.player-bar-expanded {
    display: none;
    height: 60vh;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    order: 1;
}

#global-player.expanded .player-bar-expanded {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 30px;
    align-items: start;
}

.player-bar-collapsed .play-button {
    background: linear-gradient(135deg, #0d3959 0%, #1a5682 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    width: 48px;
    height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(13, 57, 89, 0.32);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    outline: none;
}

.player-bar-collapsed .play-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(13, 57, 89, 0.4);
}

.player-bar-collapsed .play-button:active {
    transform: scale(0.95);
}

.player-bar-collapsed .play-button svg {
    width: 20px;
    height: 20px;
    fill: #ffffff;
}

.player-bar-collapsed .play-button .play-icon {
    display: block !important;
}

.player-bar-collapsed .play-button .pause-icon {
    display: none !important;
}

.player-bar-collapsed .play-button.playing .play-icon {
    display: none !important;
}

.player-bar-collapsed .play-button.playing .pause-icon {
    display: block !important;
}

.player-bar-collapsed .player-cover {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.player-bar-collapsed .player-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.player-bar-collapsed .player-info .artist {
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-bar-collapsed .player-info .title {
    font-size: 13px;
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-bar-collapsed .visualizer-wrapper {
    width: 80px;
    min-width: 80px;
    height: 32px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0 4px;
    box-sizing: border-box;
    opacity: 0.4;
}

#global-player.playing .visualizer-wrapper {
    opacity: 0.8;
}

.player-bar-collapsed .eq-bar {
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.6) 100%);
    border-radius: 2px 2px 0 0;
    transform-origin: bottom center;
    transform: scaleY(0.1);
}

#global-player.playing .eq-bar {
    animation: eqDance 1.2s ease-in-out infinite alternate;
}

#global-player.playing .eq-bar:nth-child(1)  { animation-duration: 0.8s; animation-delay: 0.1s; }
#global-player.playing .eq-bar:nth-child(2)  { animation-duration: 1.1s; animation-delay: 0.3s; }
#global-player.playing .eq-bar:nth-child(3)  { animation-duration: 0.7s; animation-delay: 0.0s; }
#global-player.playing .eq-bar:nth-child(4)  { animation-duration: 1.3s; animation-delay: 0.5s; }
#global-player.playing .eq-bar:nth-child(5)  { animation-duration: 0.9s; animation-delay: 0.2s; }
#global-player.playing .eq-bar:nth-child(6)  { animation-duration: 1.2s; animation-delay: 0.4s; }
#global-player.playing .eq-bar:nth-child(7)  { animation-duration: 0.75s; animation-delay: 0.1s; }
#global-player.playing .eq-bar:nth-child(8)  { animation-duration: 1.0s; animation-delay: 0.3s; }
#global-player.playing .eq-bar:nth-child(9)  { animation-duration: 0.85s; animation-delay: 0.0s; }
#global-player.playing .eq-bar:nth-child(10) { animation-duration: 1.25s; animation-delay: 0.4s; }
#global-player.playing .eq-bar:nth-child(11) { animation-duration: 0.95s; animation-delay: 0.2s; }
#global-player.playing .eq-bar:nth-child(12) { animation-duration: 0.7s; animation-delay: 0.5s; }
#global-player.playing .eq-bar:nth-child(13) { animation-duration: 1.15s; animation-delay: 0.1s; }
#global-player.playing .eq-bar:nth-child(14) { animation-duration: 0.8s; animation-delay: 0.3s; }

@keyframes eqDance {
    0% { transform: scaleY(0.15); }
    50% { transform: scaleY(0.9); }
    100% { transform: scaleY(0.25); }
}

.player-bar-collapsed .volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: auto;
    position: relative;
}

.player-bar-collapsed .volume-button,
.volume-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.volume-toggle-btn svg {
    width: 18px;
    height: 18px;
    fill: rgba(255, 255, 255, 0.8);
}

.volume-popup {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(13, 57, 89, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 8px;
    padding: 14px 10px;
    margin-bottom: 10px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.3);
    z-index: 10000;
}

.volume-popup.visible {
    display: block;
}

.volume-slider-vertical {
    writing-mode: vertical-lr;
    direction: rtl;
    width: 6px;
    height: 100px;
    background: transparent;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin: 0;
    padding: 0;
}

.volume-slider-vertical::-webkit-slider-runnable-track {
    width: 3px;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 1px;
}

.volume-slider-vertical::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 6px;
    background: #ffffff;
    border-radius: 1px;
    cursor: pointer;
    margin-left: -3.5px;
}

.volume-slider-vertical::-moz-range-track {
    width: 3px;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 1px;
}

.volume-slider-vertical::-moz-range-thumb {
    width: 10px;
    height: 6px;
    background: #ffffff;
    border-radius: 1px;
    cursor: pointer;
    border: none;
}

.player-bar-collapsed .expand-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.player-bar-collapsed .expand-button:hover {
    transform: scale(1.1);
}

.player-bar-expanded .close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    color: #ffffff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.player-bar-expanded .close-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.player-bar-expanded .expanded-cover {
    width: 300px;
    height: 300px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.player-bar-expanded .expanded-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
}

.player-bar-expanded .expanded-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-bar-expanded .expanded-info .artist {
    font-size: 24px;
    font-weight: bold;
    color: #ffffff;
}

.player-bar-expanded .expanded-info .title {
    font-size: 18px;
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
}

.player-bar-expanded .expanded-visualizer {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0 8px;
    box-sizing: border-box;
    opacity: 0.6;
}

#global-player.playing .expanded-visualizer {
    opacity: 1;
}

.player-bar-expanded .expanded-ad {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

@media (max-width: 768px) {
    .player-bar-collapsed {
        padding: 0 12px;
        gap: 10px;
    }
    
    .player-bar-collapsed .play-button {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }
    
    .player-bar-collapsed .play-button svg {
        width: 16px;
        height: 16px;
    }
    
    .player-bar-collapsed .player-cover {
        width: 48px;
        height: 48px;
        min-width: 48px;
    }
    
    .player-bar-collapsed .player-info .artist {
        font-size: 13px;
    }
    
    .player-bar-collapsed .player-info .title {
        font-size: 12px;
    }
    
    .player-bar-collapsed .visualizer-wrapper {
        display: none;
    }
    
    .player-bar-expanded {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 15px;
    }
    
    .player-bar-expanded .expanded-cover {
        width: 200px;
        height: 200px;
        margin: 0 auto;
    }
    
    .player-bar-expanded .expanded-info .artist {
        font-size: 20px;
        text-align: center;
    }
    
    .player-bar-expanded .expanded-info .title {
        font-size: 16px;
        text-align: center;
    }
}
