/* ==========================================================================
   ELEGANT GLASSMORPHISM MUSIC PLAYER - SHOPTOOLNRO
   ========================================================================== */

/* Floating Player Container */
.music-player-widget {
    display: none !important; /* Hide visually to run entirely in the background as requested */
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    border-radius: 50px;
    background: rgba(18, 18, 18, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px 0 rgba(0, 188, 212, 0.2), 
                inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    overflow: hidden;
    max-width: 58px; /* Initially collapsed showing only equalizer & play/pause icon */
    height: 48px;
    user-select: none;
}

/* Expanded state on hover */
.music-player-widget:hover {
    max-width: 320px; /* Expand to reveal song title and volume slider */
    padding: 10px 20px;
    background: rgba(18, 18, 18, 0.85);
    border-color: rgba(0, 188, 212, 0.3);
    box-shadow: 0 12px 40px 0 rgba(0, 188, 212, 0.35),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
}

/* Equalizer Container */
.music-equalizer {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    width: 20px;
    height: 18px;
    flex-shrink: 0;
}

/* Equalizer Bars */
.equalizer-bar {
    width: 3px;
    height: 3px;
    background: #00bcd4;
    border-radius: 3px;
    transition: height 0.3s ease;
}

/* Music Playing Animation */
.music-player-widget.is-playing .equalizer-bar {
    background: linear-gradient(to top, #00bcd4, #4dd0e1);
    box-shadow: 0 0 8px rgba(0, 188, 212, 0.6);
    animation: bounce 1.2s ease-in-out infinite alternate;
}

/* Different animation delays to make it look organic */
.music-player-widget.is-playing .equalizer-bar:nth-child(1) {
    animation-delay: 0.1s;
    animation-duration: 1.1s;
}
.music-player-widget.is-playing .equalizer-bar:nth-child(2) {
    animation-delay: 0.3s;
    animation-duration: 0.8s;
}
.music-player-widget.is-playing .equalizer-bar:nth-child(3) {
    animation-delay: 0.0s;
    animation-duration: 1.3s;
}
.music-player-widget.is-playing .equalizer-bar:nth-child(4) {
    animation-delay: 0.5s;
    animation-duration: 0.9s;
}

@keyframes bounce {
    0% {
        height: 4px;
    }
    100% {
        height: 18px;
    }
}

/* Expanded Player Content */
.player-content {
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: translateX(-15px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
    visibility: hidden;
    width: 0;
    pointer-events: none;
}

/* Make content visible when expanded */
.music-player-widget:hover .player-content {
    opacity: 1;
    transform: translateX(0);
    visibility: visible;
    width: auto;
    pointer-events: auto;
}

/* Track Info Text */
.player-track-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.track-name {
    font-size: 13px;
    font-weight: 600;
    color: #e0e0e0;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    font-size: 10px;
    color: #888888;
}

/* Control Buttons & Volume Section */
.player-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 12px;
}

/* Play/Pause SVG Trigger */
.play-pause-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #00bcd4;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, color 0.2s ease;
    width: 24px;
    height: 24px;
}

.play-pause-btn:hover {
    transform: scale(1.15);
    color: #4dd0e1;
    filter: drop-shadow(0 0 4px rgba(0, 188, 212, 0.5));
}

.play-pause-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Custom Volume Slider Container */
.volume-control {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.volume-icon {
    color: #888;
    display: flex;
    align-items: center;
    width: 16px;
    height: 16px;
}

.volume-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* Beautiful custom slider input */
.volume-slider {
    -webkit-appearance: none;
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    outline: none;
    transition: background 0.3s;
    cursor: pointer;
}

.volume-slider:hover {
    background: rgba(255, 255, 255, 0.25);
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #00bcd4;
    box-shadow: 0 0 6px rgba(0, 188, 212, 0.8);
    cursor: pointer;
    transition: transform 0.1s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

.volume-slider::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #00bcd4;
    box-shadow: 0 0 6px rgba(0, 188, 212, 0.8);
    cursor: pointer;
    border: none;
    transition: transform 0.1s ease;
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .music-player-widget {
        bottom: 16px;
        left: 16px;
    }
    
    /* Make the hover width slightly smaller on mobile to fit narrow screens */
    .music-player-widget:hover {
        max-width: 270px;
        padding: 8px 14px;
    }
    
    .track-name {
        max-width: 80px;
    }
    
    .volume-slider {
        width: 45px;
    }
}
