/* Sticky Audio Player - Restored from Backup */
:root {
    --player-bg: #ebedf0;
    --player-text: #424e5b;
    --player-accent: #7e99c0;
    --player-accent-hover: #5582d4;
    --player-border: rgba(126, 153, 192, 0.2);
}

.sticky-audio-player {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 1440px;
    height: 87px !important;
    background: #fafafa;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 2px solid var(--player-border);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    z-index: 10002;
    display: flex;
    align-items: center;
    box-shadow: 0 -4px 12px rgba(126, 153, 192, 0.1);
    transition: transform 0.3s ease, bottom 0.3s ease;
}

.sticky-audio-player.hidden {
    bottom: -90px;
    transform: translateX(-50%);
}

/* Compact mode layout */
.sticky-audio-player.compact {
    height: 60px !important;
    width: 100%;
    max-width: none;
    border-radius: 0;
    border-left: none;
    border-right: none;
}
.sticky-audio-player.compact .player-info {
    width: 200px;
    gap: 10px;
}
.sticky-audio-player.compact .player-cover {
    width: 32px;
    height: 32px;
}
.sticky-audio-player.compact .p-title {
    font-size: 13px !important;
}
.sticky-audio-player.compact .p-artist {
    font-size: 11px !important;
}
.sticky-audio-player.compact .p-main-btn i {
    font-size: 1.5rem !important;
}
.sticky-audio-player.compact .player-container {
    gap: 15px;
}
.sticky-audio-player.compact .player-progress-area {
    margin: 0 5px !important;
}
.sticky-audio-player.compact .p-progress-bar {
    height: 3px !important;
}

/* Dark mode colors ONLY for Karaoke */
.sticky-audio-player.dark-mode {
    background: #111 !important;
    border-top: 1px solid #333 !important;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5) !important;
}
.sticky-audio-player.dark-mode .p-title {
    color: #fff !important;
}
.sticky-audio-player.dark-mode .p-artist {
    color: #aaa !important;
}
.sticky-audio-player.dark-mode .p-btn i,
.sticky-audio-player.dark-mode .p-main-btn i {
    color: #eee !important;
}
.sticky-audio-player.dark-mode .time {
    color: #888 !important;
}
.sticky-audio-player.dark-mode .p-progress-bar {
    background: rgba(255,255,255,0.1) !important;
}
.sticky-audio-player.dark-mode .p-progress {
    background: #416f9d !important;
}
.sticky-audio-player.dark-mode .p-album-select {
    background: #222 !important;
    border-color: #444 !important;
    color: #eee !important;
}
.sticky-audio-player.dark-mode .p-album-select option {
    background: #222 !important;
    color: #eee !important;
}

.player-container {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 25px;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 250px;
    flex-shrink: 0;
}

.p-album-select {
    background: #fff;
    border: 1px solid #416f9d;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 11px;
    color: #416f9d;
    min-width: 137px;
    width: 137px;
    outline: none;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(65, 111, 157, 0.1);
    flex-shrink: 0;
}
.p-album-select:hover {
    background: #f0f7ff;
    border-color: #345a82;
    transform: scale(1.02);
}
.p-album-select option { background: #fff; color: #333; font-weight: normal; }

.player-cover {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(126, 153, 192, 0.1);
    object-fit: cover;
    border: 1px solid var(--player-border);
}

.p-track-meta {
    flex: 1;
    min-width: 0; /* Критично для правильной работы overflow в flex-контейнере */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.p-title, .p-artist { 
    font-size: 14px !important; 
    font-weight: 600 !important; 
    color: #416f9d !important; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    width: 100%;
    display: block;
}

.p-artist { 
    font-size: 13px !important; 
    font-weight: 400 !important;
    color: #747d86 !important; 
    text-transform: none !important; 
}

/* Анимация бегущей строки */
.p-title.scrollable,
.p-artist.scrollable {
    width: max-content !important;
    display: inline-block !important;
    text-overflow: clip !important;
    padding-right: 60px; /* Отступ после текста для разделения при повторе */
    animation: playerMarquee 12s linear infinite;
}

@keyframes playerMarquee {
    0% { transform: translateX(0); }
    15% { transform: translateX(0); }
    85% { transform: translateX(var(--scroll-amount, -50%)); }
    100% { transform: translateX(var(--scroll-amount, -50%)); }
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.p-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--player-accent);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.p-btn i { font-size: 1.2rem !important; color: #7e99c0 !important; transition: color 0.2s ease; } 
.p-btn:hover i { color: #416f9d !important; }
.p-btn.active i { color: #7e99c0 !important; text-shadow: none; }
.p-btn.no-lyrics i { color: #aaa !important; opacity: 0.6; pointer-events: none; }
.p-main-btn i { font-size: 1.8rem !important; color: #7e99c0 !important; } 

/* Специальный стиль для темного режима (караоке) */
.sticky-audio-player.dark-mode .p-btn.no-lyrics i { color: #555 !important; opacity: 1; }
.player-progress-area { 
    display: flex !important; align-items: center !important; gap: 12px !important; 
    flex-grow: 1 !important; margin: 0 15px !important;
}
.p-progress-bar { 
    flex-grow: 1 !important; height: 5px !important; background: rgba(0,0,0,0.05) !important; 
    border-radius: 3px !important; position: relative !important; cursor: pointer !important;
}
.p-progress { 
    height: 100% !important; background: rgba(126, 153, 192, 0.7) !important;
    border-radius: 3px !important; width: 0%; position: relative; 
    transition: width 0.1s linear !important;
}
.p-progress::after {
    content: ''; position: absolute; right: -6px; top: 50%; transform: translateY(-50%);
    width: 12px; height: 12px; background: rgba(126, 153, 192, 0.9) !important; border-radius: 50%; box-shadow: 0 0 3px rgba(0,0,0,0.1);
}
.time { font-size: 11px !important; color: #7e99c0 !important; min-width: 35px !important; font-family: monospace !important; }

.player-volume {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 130px;
}

#p-volume {
    -webkit-appearance: none; width: 70px; height: 4px; 
    background: #e9ecef; border-radius: 2px; outline: none !important;
}
#p-volume::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 12px; height: 12px; border-radius: 50%; 
    background: #7e99c0; cursor: pointer; border: none !important;
}
