.modern-audio-playlist {
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    margin: 20px 0;
}

/* Fixed player at bottom */
.playlist-player-wrapper {
    position: fixed;
    bottom: 0px;
    left: 0;
    right: 0;
    z-index: 9999;
    margin: 0 25px 25px 25px;
}
.playlist-player {
    background: #1c1c1f;
    color: white;
    padding: 15px 20px;
    border-top: 1px solid #9c9c9c;
    box-shadow: 0 0 #0000, 0 0 #0000, 0 12px 50px -12px rgba(0, 0, 0, 0.25);
    border-radius: 9px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.current-track-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 200px;
}

/*
.track-thumbnail {
    width: calc(.25rem * 10);
    height: calc(.25rem * 14);
    border-radius: .375rem;
    overflow: clip;
    flex-shrink: 0;
}
*/

.track-thumbnail img {
    width: 50px;
    height: 100%;
    border-radius: 4px;
    object-fit: cover;
}

.track-details h3 {
    margin: 0 0 2px 0;
    font-size: 14px;
    color: white;
}

.track-details p {
    margin: 0;
    font-size: 12px;
    color: #ccc;
}

/* Hide default audio controls */
#playlist-audio {
    display: none;
}

.player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 2;
    gap: 10px;
}

.player-controls .control-btn {
    background: transparent;
    border: none;
    color: white;
    height: 40px;
    width: 40px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.player-controls .control-btn:hover {
    background: #555;
}

.progress-container {
    flex: 1;
    min-width: 100px;
}

.progress-bar {
    position:absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 8px;
    background: #333;
    border-bottom-right-radius: 9px;
    border-bottom-left-radius: 9px;
    overflow: hidden;
    margin-bottom: 0px;
    cursor: pointer;
}

.progress {
    height: 100%;
    background: #fff;
    width: 0%;
    transition: width 0.1s;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #ccc;
}

/* Playlist tracks styling */
.playlist-tracks {
    margin-bottom: 100px; /* Space for fixed player */
}

.playlist-tracks.scroll-y {
    overflow-y: auto;
    max-height: 400px;
}
.playlist-tracks.scroll-y::before {
    position: absolute;
    left: 0;
    bottom: 0;
    display: block;
    width: 100%;
    height: 120px;
    content: "";
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0, rgba(255, 255, 255, 0)), to(#737373));
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0, #737373 100%);
    visibility: visible;
    opacity: 1;
    -webkit-transition: all 1s ease-in-out;
    transition: all 1s ease-in-out;
}

.playlist-track-item {
    border-bottom: 1px solid #f0f0f0;
    background: white;
    transition: background 0.2s;
}

.playlist-track-item:hover {
    background: #f8f9fa;
}

.playlist-track-item.playing {
    background: #f0f0f0;
}

/* Top level item - horizontal layout */
.top-level-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    gap: 15px;
}

.track-number {
    width: 30px;
    text-align: center;
    font-weight: bold;
    color: #666;
    font-size: 12px;
}

/* Thumbnail with play button overlay */
.track-thumb {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.track-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s ease;
}

.track-thumb-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.track-thumb-play-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    color: #000;
    transition: all 0.3s ease;
    transform: scale(0.8);
}

.track-thumb-play-btn:hover {
    background: white;
    transform: scale(1);
}

/* Show overlay on hover */
.playlist-track-item:hover .track-thumb-overlay {
    opacity: 1;
}

/* Show overlay and pause icon when playing */
.playlist-track-item.playing .track-thumb-overlay {
    opacity: 1;
    background: rgba(0, 0, 0, 0.5);
}
button.track-thumb-play-btn {
    border: none;
    border-radius: 3px;
    padding: 0;
    background-color: transparent;
}

.playlist-track-item.playing .track-thumb-play-btn {
    transform: scale(1);
}

/* Dim the thumbnail when playing */
.playlist-track-item.playing .track-thumb img {
    filter: brightness(0.8);
}

.track-info {
    flex: 1;
    min-width: 0; /* Allow text truncation */
}

.track-title {
    font-weight: 600;
    margin-bottom: 2px;
    font-size: 14px;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-link a {
    text-decoration: none;
    font-size: 14px;
    color: #666;
    padding: 5px;
    display: inline-flex;
    width: 30px;
    height: 30px;

    justify-content: center;
    align-items: center;
    border-radius: 30px;
}

.track-link span {
    display: inline-flex;
    padding: 3px;
    border-radius: 3px;
}

.track-link span svg { width: 18px;}
.track-link span svg path {
    stroke: currentColor;
}

.track-link a:hover svg path{
    color: #000;
}

.track-likes {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

/* Voting section */
.track-vote {
    display: flex;
    align-items: center;
    gap: 0px;
    flex-shrink: 0;
}

.track-vote .vote-btn {
    background: none;
    color: #666;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 3px;
}
button.vote-btn svg {
    width: 20px;
    height: 20px;
}

.track-vote .vote-btn:hover {
    background: none;
    color: #000;
}

.track-vote .vote-btn.voting {
    opacity: 0.6;
    cursor: not-allowed;
}

.track-vote .vote-btn.active {
    background: none;
    color: #000;
}

.track-vote .vote-btn.up.active {
    background: none;
    border-color: transparent;
}

.vote-btn.down.active {
    background: none;
    border-color: transparent;
}

.vote-btn.voted {
    background: none;
    border-color: transparent;
}

.vote-btn.up.voted {
    background: #4CAF50;
    border-color: #4CAF50;
    color: #fff;
}

.vote-btn.down.voted {
    background: #f44336;
    border-color: #f44336;
    color: #fff;
}

.net-votes {
    font-weight: bold;
    min-width: 20px;
    text-align: center;
    font-size: 12px;
}

/* Bottom level item - description */
.bottom-level-item {
    padding: 0 20px 15px 20px;
    margin-top: -5px;
}

.track-description {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    color: #666;
    border-left: 3px solid var(--paddle-color-button-bg);
}

.track-description p {
    margin: 0 0 8px 0;
}

.track-description p:last-child {
    margin-bottom: 0;
}

.track-description strong {
    color: #333;
}

.track-description a {
    color: #007cba;
    text-decoration: none;
}

.track-description a:hover {
    text-decoration: underline;
}

/* Desktop only elements */
.desktop-only {
    display: block;
}

/* Responsive design */
@media (max-width: 768px) {
    .playlist-player {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 15px;
    }
    
    .current-track-info {
        /*min-width: auto;*/
        flex: none;
        gap: 10px;
    }
    
    .progress-container {
        min-width: auto;
        flex: 1;
    }
    
    .track-details h3 {
        font-size: 12px;
    }
    
    .track-details p {
        font-size: 11px;
    }
    
    .track-thumbnail img {
        width: 40px;
        height: 40px;
    }
    
    .top-level-item {
        padding: 10px 15px;
        gap: 10px;
    }
    
    .track-thumb {
        width: 40px;
        height: 40px;
    }
    
    .track-thumb-play-btn {
        width: 25px;
        height: 25px;
        font-size: 10px;
    }
    
    .track-title {
        font-size: 13px;
    }
    
    .track-artist {
        font-size: 11px;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .bottom-level-item {
        padding: 0 15px 10px 15px;
    }
    
    .track-vote {
        gap: 3px;
    }
    
    .vote-btn {
        padding: 3px 6px;
        font-size: 11px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .top-level-item {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .track-info {
        min-width: 150px;
        flex: 2;
    }
    
    .track-vote {
        margin-left: auto;
    }
    
    .player-controls {
        gap: 5px;
    }
    
    .control-btn {
        padding: 6px 8px;
        font-size: 12px;
    }
}