.universal-music-player {
    width: 90%;
    /*max-width: 1200px;*/
    background: linear-gradient(135deg, #f3f3f3 0%, #aaaaaa 100%);
    /*border-radius: 15px;*/
    /*box-shadow: 0 5px 30px rgba(0,0,0,0.3);*/
    color: #000;
    font-family: "Mulish", sans-serif;
    user-select: none;

    border: 1px solid #eeeeef;
    border-radius: 24px;
    padding: 16px;
    width: 463px;
    height: 144px;
    background: #fff;
}

.universal-music-player.dark {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

.universal-music-player.light {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #333;
}

.universal-music-player.compact {
    max-width: 400px;
}

.player-container {
    position: relative;


}

.player-main {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    /*padding: 15px 25px;*/
    gap: 16px;
}

.player-main-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 16px;
}

.track-info {
    display: flex;
    align-items: center;
    gap: 12px;
    /*min-width: 250px;*/
}

.track-cover {
    border-radius: 8px;
    width: 40px;
    height: 40px;
    overflow: hidden;
    flex-shrink: 0;
}

.track-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.track-details {
    min-width: 0;
}

.track-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    font-size: 12px;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    /*width: 50%;*/
}

.control-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.control-btn {
    background: none;
    border: none;
    outline: none;
    padding: 0;
    /*width: 40px;*/
    /*height: 40px;*/
    display: flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.play-pause-btn {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.9);
    color: #333;
}

.play-pause-btn:hover {
    background: white;
}

.control-btn.active {
    background: rgba(255,255,255,0.4);
    color: #ffd700;
}

.close-btn {
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    outline: none;
    width: 44px;
    height: 32px;
    background: #f6f6f6;
}

.close-btn:hover {
    background: #f6f6f6;
}

.progress-section {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.time-current, .time-total {
    font-size: 12px;
    min-width: 35px;
    text-align: center;
}

.progress-bar {
    flex: 1;
    height: 3px;
    background: #eeeeef;
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.progress-fill {
    height: 100%;
    background: white;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s ease;
}

.progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: grab;
}

.progress-handle:active {
    cursor: grabbing;
}

.progress-bar:hover .progress-handle {
    opacity: 1;
}

.player-extras {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    width: 100%;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.volume-btn {
    background: none;
    border: none;
    color: currentColor;
    cursor: pointer;
    padding: 0px;
}

.volume-bar {
    position: relative;
    width: 80px;
}

.volume-slider {
    width: 124px;
    height: 3px;
    background: #eeeeef;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.playlist-btn {
    background: none;
    border: none;
    color: currentColor;
    cursor: pointer;
    padding: 0px;
    transition: background-color 0.3s ease;
}

.playlist-btn:hover {
    background: rgba(255,255,255,0.2);
}

.player-playlist {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: space-around;
    gap: 32px;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.playlist-header h3 {
    margin: 0;
    font-size: 16px;
}

.close-playlist-btn {
    background: none;
    color: white;
    border: 1px solid #dad9d9;
    border-radius: 10px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.close-playlist-btn:hover {
    background: rgba(255,255,255,0.2);
}

.playlist-items {
    max-height: 320px;
    overflow-y: auto;
    padding: 10px 0;
}

.playlist-item {
    display: flex;
    align-items: center;
    padding: 10px 25px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.playlist-item:hover {
    background: #f6f6f6;
}

.playlist-item:has(.is-play) {
    background: #f6f6f6;
}
.playlist-item.current {
    background: rgba(255,255,255,0.2);
}

.playlist-item .item-cover {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 15px;
    flex-shrink: 0;
}

.playlist-item .item-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-item .item-info {
    flex: 1;
    min-width: 0;
}

.playlist-item .item-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item .item-artist {
    font-size: 12px;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item .item-duration {
    font-size: 12px;
    opacity: 0.8;
    margin-left: 15px;
}


.playlist-items::-webkit-scrollbar {
    width: 6px;
}

.playlist-items::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.playlist-items::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.playlist-items::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* Адаптивность */
@media (max-width: 768px) {
    .universal-music-player {
        width: 100%;
        border-radius: 0;
        max-width: none;
    }

    .player-main {
        padding: 10px 15px;
        gap: 10px;
    }

    .track-info {
        min-width: auto;
        flex: 1;
    }

    .player-extras {
        min-width: auto;
    }

    .volume-control {
        display: none;
    }
}

@media (max-width: 480px) {
    .control-buttons {
        gap: 5px;
    }

    .control-btn {
        width: 35px;
        height: 35px;
    }

    .play-pause-btn {
        width: 45px;
        height: 45px;
    }

    .progress-section {
        gap: 10px;
    }

    .track-info {
        min-width: 120px;
    }

    .universal-music-player.compact .track-info {
        display: none;
    }
}


@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.universal-music-player {
    animation: fadeIn 0.3s ease-out;
}

.playlist-item {
    animation: fadeIn 0.2s ease-out;
}


.universal-music-player.neon {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 1px solid #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.universal-music-player.neon .control-btn {
    border: 1px solid #00ffff;
    background: rgba(0, 255, 255, 0.1);
}

.universal-music-player.neon .progress-fill {
    background: #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.universal-music-player.minimal {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 8px;
}

.universal-music-player.minimal .control-btn {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/**/

.other-control {
    display: flex;
    align-items: center;
    gap: 28px;
}
/**/

html:has(.player-playlist[style='display: flex;']) {
    overflow: hidden;
}

.player-playlist {
    align-items: center;
    justify-content: center;
    padding: 64px;
}

.playlist-left {
    padding: 0px 64px;
    width: 548px;
    height: 586px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.playlist-left .player-main {
    display: flex;
    flex-direction: column;
    width: 100%;
}
.playlist-left .player-main .player-main-top {
    display: flex;
    flex-direction: column;
}
.playlist-left .player-main .player-main-top .track-info {

}
.playlist-left .player-main .player-main-top .track-info .track-cover {
    border-radius: 32px;
    width: 420px;
    height: 420px;
}
.playlist-left .player-main .player-main-top .track-info-player-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
}
.playlist-left .player-main .player-main-top .track-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.playlist-left .player-main .player-main-top .track-details .track-name {
    font-weight: 500;
    font-size: 18px;
    line-height: 120%;
    letter-spacing: -0.01em;
}
.playlist-left .player-main .player-main-top .track-details .track-artist {
    font-weight: 450;
    font-size: 14px;
    line-height: 140%;
    letter-spacing: -0.01em;
    color: #999;
}
.playlist-left .player-main .player-main-top {

}
.playlist-left .player-main .progress-section {

}
.playlist-left .player-main .player-extras {

}
.playlist-right {
    display: flex;
    flex-direction: column;
    gap: 32px;
}
.playlist-right .playlist-header {
    padding: 0;
}
.playlist-right .playlist-header h3 {
    font-weight: 500;
    font-size: 30px;
    line-height: 115%;
    letter-spacing: -0.01em;
    color: #000;
    padding: 0;
}
.playlist-right .playlist-header .close-playlist-btn {
    position: absolute;
    top: 32px;
    right: 32px;
}
.playlist-right .playlist-items {
    display: flex;
    align-items: center;
    gap: 0px;
    flex-direction: column;
    max-height: 648px;
    padding: 0;
}
.playlist-right .playlist-items .playlist-item {
    border-radius: 20px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.playlist-right .playlist-items .playlist-item .item-cover {
    border-radius: 12px;
    width: 48px;
    height: 48px;
    padding: 0;
}
.playlist-right .playlist-items .playlist-item .item-info {
    display: flex;
    flex-direction: column;
}
.playlist-right .playlist-items .playlist-item .item-name {
    font-weight: 500;
    font-size: 16px;
    line-height: 150%;
    color: #000;
}
.playlist-right .playlist-items .playlist-item .item-artist {
    font-weight: 450;
    font-size: 14px;
    line-height: 140%;
    letter-spacing: -0.01em;
    color: #999;
}
.playlist-right .playlist-items .playlist-item .item-duration {
    font-weight: 450;
    font-size: 16px;
    line-height: 115%;
    text-align: center;
    color: #999;
}
.playlist-right .playlist-items .playlist-item.current {
    background: #f6f6f6;
}