/* Music Player Widget Styles */
.music-player-widget {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Header */
.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.widget-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.toggle-player {
    color: white;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.toggle-player:hover {
    opacity: 1;
    color: white;
}

/* Now Playing Section */
.now-playing {
    padding: 15px;
    background: #f8f9fa;
}

.album-cover-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.album-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.album-cover-container:hover .play-overlay {
    opacity: 1;
}

.btn-play-main {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    border: none;
    color: #667eea;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-play-main:hover {
    transform: scale(1.1);
}

/* Track Info */
.track-info {
    text-align: center;
    margin-bottom: 15px;
}

.track-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-author {
    font-size: 12px;
    color: #666;
}

/* Player Controls */
.player-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.btn-control {
    min-width: 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: white;
    color: #667eea;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex-shrink: 0;
    padding: 0;
}

.btn-control:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.btn-control.btn-play {
    min-width: 44px;
    width: 44px;
    height: 44px;
    font-size: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Progress Bar */
.progress-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #666;
}

.progress-bar-container {
    flex: 1;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.progress-bar {
    height: 100%;
    position: relative;
}

.progress-filled {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s;
}

/* Playlist */
.playlist-container {
    border-top: 1px solid #e9ecef;
    max-height: 300px;
    overflow-y: auto;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
}

.shuffle-btn {
    color: #6c757d;
    padding: 0;
}

.shuffle-btn.active {
    color: #667eea;
}

.playlist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.playlist-item {
    position: relative;
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f1f3f5;
    cursor: pointer;
    transition: all 0.2s;
}

.playlist-item:hover {
    background: #f8f9fa;
}

.playlist-item.active {
    background: #e7f5ff;
    border-left: 3px solid #667eea;
    padding-left: 12px;
}

.playlist-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    margin-right: 12px;
}

.playlist-info {
    flex: 1;
    min-width: 0;
}

.playlist-title {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
}

.playlist-author {
    font-size: 11px;
    color: #6c757d;
}

/* Link icon for playlist items */
.playlist-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f8f9fa;
    color: #6c757d;
    text-decoration: none;
    margin-left: 8px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.playlist-link:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.playlist-link i {
    font-size: 14px;
}

/* Playing state for playlist items */
.playlist-item.playing {
    background: linear-gradient(to right, #f0f4ff, #ffffff);
    border-left: 3px solid #667eea;
}

.playlist-item.playing .playlist-title {
    font-weight: 600;
    color: #667eea;
}

/* Add a small playing indicator */
.playlist-item.playing::before {
    content: "♪";
    position: absolute;
    left: 2px;
    color: #667eea;
    font-size: 12px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    gap: 10px;
}

#volume-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    outline: none;
    border-radius: 2px;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
}

#volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Empty Playlist */
.empty-playlist {
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
}

.empty-playlist i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-playlist p {
    margin-bottom: 5px;
    font-weight: 500;
}

.empty-playlist small {
    font-size: 12px;
}

/* Minimized State */
.music-player-widget.minimized .now-playing,
.music-player-widget.minimized .playlist-container,
.music-player-widget.minimized .volume-control {
    display: none;
}

.music-player-widget.minimized .player-header {
    border-radius: 12px;
}

/* Scrollbar Styling */
.playlist-container::-webkit-scrollbar {
    width: 6px;
}

.playlist-container::-webkit-scrollbar-track {
    background: #f1f3f5;
}

.playlist-container::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 3px;
}

.playlist-container::-webkit-scrollbar-thumb:hover {
    background: #868e96;
}

/* Responsive */
@media (max-width: 1399px) {
    .music-player-widget {
        display: none;
    }
}