/* ===== ОСНОВНАЯ ПАНЕЛЬ ПЛЕЕРА ===== */
.player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--player-height);
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid #222;
    display: flex;
    flex-direction: column;
    padding: 0 30px;
    z-index: 1000;
}

/* Кнопка-ручка для открытия расширенного плеера */
.player-drag-handle {
    position: absolute;
    top: -15px;
    left: 0;
    right: 0;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1001;
}

.drag-indicator {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    transition: all 0.2s ease;
}

.player-drag-handle:hover .drag-indicator {
    background: var(--accent);
    width: 60px;
}

/* ПРОГРЕСС-БАР (ВЕРХНЯЯ ЧАСТЬ) */
.time-info-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    height: 30px;
    margin-top: 10px;
}

#currentTime, #timeLeft {
    font-size: 11px;
    font-family: 'Courier New', monospace;
    color: var(--text-dim);
    min-width: 40px;
}

/* УНИВЕРСАЛЬНЫЕ СЛАЙДЕРЫ */
.slider-wrapper {
    flex: 1;
    height: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.slider-base {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    position: relative;
}

.slider-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    width: 0%;
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
    transition: width 0.1s linear;
}

/* НИЖНЯЯ ЧАСТЬ */
.controls-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    flex: 1;
    width: 100%;
}

/* Информация о треке */
.track-info {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-self: start;
}

.track-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.track-text b {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-text small {
    color: var(--text-dim);
    font-size: 12px;
}

/* КНОПКИ УПРАВЛЕНИЯ */
.btn-group {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-self: center;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 18px;
    cursor: pointer;
    transition: 0.2s;
}

.icon-btn:hover {
    color: #fff;
    transform: scale(1.1);
}

.icon-btn.active-shuffle { 
    color: var(--accent); 
}

.play-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #fff;
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.2s;
}

.play-btn:hover {
    transform: scale(1.05);
    background: var(--accent);
}

/* ЗОНА ГРОМКОСТИ */
.vol-zone {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 150px;
    justify-self: end;
}

#volVal {
    font-size: 11px;
    min-width: 30px;
    color: var(--text-dim);
}

/* ===== ВИНИЛОВЫЙ ДИСК ===== */
.vinyl-disc {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #222, #111);
    box-shadow: 0 0 0 2px #333, 0 0 0 4px #222, 0 5px 15px rgba(0,0,0,0.5);
    overflow: hidden;
    flex-shrink: 0;
    transition: box-shadow 0.3s ease;
}

.vinyl-disc::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffcc00, #b38f00);
    box-shadow: 0 0 0 2px #444, 0 0 0 4px #222;
    z-index: 2;
}

.vinyl-disc::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.vinyl-grooves {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: repeating-radial-gradient(
        circle at center,
        transparent 0px,
        transparent 3px,
        rgba(255, 255, 255, 0.03) 3px,
        rgba(255, 255, 255, 0.03) 6px
    );
    z-index: 1;
}

.vinyl-cover {
    position: absolute;
    top: 6px;
    left: 6px;
    width: calc(100% - 12px);
    height: calc(100% - 12px);
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
    z-index: 0;
}

/* Анимации винила */
@keyframes spinVinyl {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.vinyl-disc.playing {
    animation: spinVinyl 3s linear infinite;
}

.vinyl-disc.paused {
    animation: spinVinyl 3s linear infinite;
    animation-play-state: paused;
}

.vinyl-disc.stopped {
    animation: none;
    transform: rotate(0deg);
}

.vinyl-disc.loading {
    animation: spinVinyl 1s linear infinite;
    opacity: 0.8;
    filter: blur(0.5px);
}

.vinyl-disc:hover {
    filter: drop-shadow(0 0 5px rgba(255, 204, 0, 0.5));
}

/* Анимации для перемотки */
@keyframes spin-normal {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.vinyl-disc.slow-forward {
    animation: spin-normal 1.5s linear infinite !important;
}

.vinyl-disc.slow-rewind {
    animation: spin-normal 1.5s linear infinite reverse !important;
}

.vinyl-disc.medium-forward {
    animation: spin-normal 0.8s linear infinite !important;
}

.vinyl-disc.medium-rewind {
    animation: spin-normal 0.8s linear infinite reverse !important;
}

.vinyl-disc.fast-forward {
    animation: spin-normal 0.4s linear infinite !important;
}

.vinyl-disc.fast-rewind {
    animation: spin-normal 0.4s linear infinite reverse !important;
}

.vinyl-disc.very-fast-forward {
    animation: spin-normal 0.2s linear infinite !important;
}

.vinyl-disc.very-fast-rewind {
    animation: spin-normal 0.2s linear infinite reverse !important;
}

.vinyl-disc.turbo-forward {
    animation: spin-normal 0.1s linear infinite !important;
}

.vinyl-disc.turbo-rewind {
    animation: spin-normal 0.1s linear infinite reverse !important;
}

/* ===== ВЫДВИЖНОЙ РАСШИРЕННЫЙ ПЛЕЕР ===== */
.expanded-player {
    position: fixed;
    top: 100%;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
    backdrop-filter: blur(20px);
    z-index: 2000;
    transition: top 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.expanded-player.active {
    top: 0;
}

.expanded-player-content {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    box-sizing: border-box;
}

/* Кнопка закрытия */
.close-expanded-player {
    position: sticky;
    top: 10px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    z-index: 10;
}

.close-expanded-player:hover {
    background: var(--accent);
    color: #000;
    transform: scale(1.1);
}

/* Большая обложка */
.expanded-cover-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0 30px;
}

.expanded-vinyl-disc {
    position: relative;
    width: min(280px, 70vw);
    height: min(280px, 70vw);
    border-radius: 50%;
    background: linear-gradient(135deg, #333, #111);
    box-shadow: 0 0 0 4px #444, 0 0 0 8px #222, 0 20px 40px rgba(0,0,0,0.8);
    overflow: hidden;
    transition: transform 0.3s ease;
    animation: none;
}

.expanded-vinyl-disc.playing {
    animation: spinVinyl 4s linear infinite;
}

.expanded-vinyl-disc.paused {
    animation: spinVinyl 4s linear infinite;
    animation-play-state: paused;
}

.expanded-vinyl-disc::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(60px, 15vw);
    height: min(60px, 15vw);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffcc00, #b38f00);
    box-shadow: 0 0 0 4px #444, 0 0 0 8px #222;
    z-index: 2;
}

.expanded-vinyl-grooves {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: repeating-radial-gradient(
        circle at center,
        transparent 0px,
        transparent 8px,
        rgba(255, 255, 255, 0.03) 8px,
        rgba(255, 255, 255, 0.03) 12px
    );
    z-index: 1;
}

.expanded-vinyl-cover {
    position: absolute;
    top: min(15px, 4vw);
    left: min(15px, 4vw);
    width: calc(100% - min(30px, 8vw));
    height: calc(100% - min(30px, 8vw));
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
    z-index: 0;
}

/* Информация о треке */
.expanded-track-info {
    text-align: center;
    margin-bottom: 30px;
}

.expanded-track-info h2 {
    font-size: clamp(20px, 6vw, 28px);
    margin: 0 0 10px;
    color: #fff;
    font-weight: 700;
    word-break: break-word;
}

.expanded-track-info p {
    font-size: clamp(14px, 4vw, 18px);
    margin: 0;
    color: var(--accent);
    opacity: 0.9;
    word-break: break-word;
}

/* ===== ПРОГРЕСС-БАР НА ВСЮ ШИРИНУ ===== */
.expanded-progress-container {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    margin: 20px 0;
}

.expanded-time {
    font-size: 12px;
    font-family: 'Courier New', monospace;
    color: var(--text-dim);
    min-width: 45px;
    text-align: center;
}

.expanded-slider-wrapper {
    flex: 1;
    height: 40px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.expanded-slider-base {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    position: relative;
}

.expanded-slider-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    width: 0%;
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
}

/* ===== ВСЕ КНОПКИ В ОДНОЙ СТРОКЕ ПО ВСЕЙ ШИРИНЕ ===== */
.expanded-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin: 20px 0;
    padding: 10px 0;
    width: 100%;
}

.expanded-controls-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.expanded-likes-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.expanded-volume-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
}

.expanded-icon-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 22px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.expanded-icon-btn:hover {
    color: #fff;
    transform: scale(1.1);
    background: rgba(255,255,255,0.1);
}

.expanded-play-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #000;
    box-shadow: 0 5px 20px rgba(255, 204, 0, 0.4);
    flex-shrink: 0;
}

.expanded-play-btn:hover {
    transform: scale(1.05);
    background: #ffd700;
    box-shadow: 0 8px 25px rgba(255, 204, 0, 0.6);
}

/* Громкость */
.expanded-volume-group .expanded-slider-wrapper {
    width: 100px;
    height: 30px;
    flex: none;
}

.volume-percent {
    font-size: 12px;
    color: var(--text-dim);
    min-width: 40px;
    text-align: right;
}

.volume-icon {
    font-size: 18px;
    color: var(--text-dim);
}

/* ===== ПЕРВЫЙ РЯД - НАВИГАЦИЯ ===== */
.expanded-nav-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 20px 0 10px;
    width: 100%;
}

/* ===== ВТОРОЙ РЯД - ЛАЙКИ И ГРОМКОСТЬ ===== */
.expanded-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 10px 0;
    padding: 10px 0;
    width: 100%;
}

/* Группа лайков */
.expanded-likes-group {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Контейнер громкости */
.expanded-volume-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Кнопка-иконка громкости */
.volume-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--text-dim);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.volume-toggle:hover {
    background: var(--accent);
    color: #000;
    transform: scale(1.1);
}

/* Вертикальный слайдер громкости (скрыт по умолчанию) */
.vertical-volume-slider {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 120px;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 15px 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 10;
}

.vertical-volume-slider.active {
    display: flex;
}

.vertical-volume-slider .expanded-slider-wrapper {
    width: 4px;
    height: 80px;
    flex: none;
    transform: rotate(180deg);
}

.vertical-volume-slider .expanded-slider-base {
    width: 4px;
    height: 100%;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    position: relative;
}

.vertical-volume-slider .expanded-slider-fill {
    width: 100%;
    height: 0%;
    background: var(--accent);
    border-radius: 2px;
    position: absolute;
    bottom: 0;
    left: 0;
    transition: height 0.1s linear;
}

.vertical-volume-slider .volume-percent {
    margin-top: 10px;
    font-size: 11px;
    color: var(--text-dim);
}

/* ===== МОДАЛЬНОЕ ОКНО ОЧЕРЕДИ ===== */
.queue-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.queue-modal.active {
    display: flex;
}

.queue-modal-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

.queue-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: rgba(0,0,0,0.3);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.queue-modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--accent);
}

.close-queue {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-queue:hover {
    background: var(--red);
    transform: rotate(90deg);
}

.queue-modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.queue-item:hover {
    background: rgba(255,255,255,0.1);
}

.queue-item.active {
    background: rgba(255, 204, 0, 0.15);
    border-left: 3px solid var(--accent);
}

.queue-item.active .queue-title {
    color: var(--accent);
}

.queue-cover {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    background-color: #333;
    flex-shrink: 0;
}

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

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

.queue-artist {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-position {
    font-size: 12px;
    color: var(--text-dim);
    min-width: 30px;
    text-align: center;
    font-family: monospace;
}

.queue-current {
    color: var(--accent);
    font-weight: bold;
}

.queue-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-dim);
}

.queue-empty p {
    margin: 10px 0 0;
    font-size: 14px;
}

/* Счетчик очереди */
.queue-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent);
    color: #000;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-sidebar);
}

/* ===== ТУЛТИПЫ (ПОДСКАЗКИ) ===== */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 100;
    letter-spacing: 0.5px;
}

[data-tooltip]:hover:before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* Тултипы для мобилок (отключаем на маленьких экранах) */
@media (max-width: 768px) {
    [data-tooltip]:before {
        display: none;
    }
}

/* ===== КНОПКА SHUFFLE ===== */
.icon-btn#shuffleBtn,
.expanded-icon-btn#expandedShuffleBtn {
    transition: all 0.2s ease;
}

.icon-btn#shuffleBtn.active .shuffle-icon,
.expanded-icon-btn#expandedShuffleBtn.active .shuffle-icon {
    content: "🔀";
}

.icon-btn#shuffleBtn.active,
.expanded-icon-btn#expandedShuffleBtn.active {
    color: var(--accent) !important;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

/* ===== ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ===== */
.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.album-card {
    background: var(--bg-card);
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.album-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(255, 204, 0, 0.15);
    background: var(--bg-card);
}

/* ===== АДАПТАЦИЯ ДЛЯ МОБИЛОК ===== */
@media (max-width: 768px) {
    .expanded-player-content {
        max-width: 100%;
        padding: 15px;
    }
    
    .expanded-controls-row {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .expanded-controls-group {
        order: 1;
        width: 100%;
        justify-content: center;
    }
    
    .expanded-likes-group {
        order: 2;
        width: 100%;
        justify-content: center;
    }
    
    .expanded-volume-group {
        order: 3;
        width: 100%;
        justify-content: center;
        min-width: auto;
    }
    
    .expanded-icon-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .expanded-play-btn {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }
    
    .expanded-actions-row {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .expanded-likes-group {
        order: 1;
    }
    
    .expanded-volume-container {
        order: 2;
    }
}

@media (max-width: 480px) {
    .expanded-controls-group {
        gap: 10px;
    }
    
    .expanded-likes-group {
        gap: 10px;
    }
    
    .expanded-icon-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .expanded-play-btn {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    
    .expanded-volume-group .expanded-slider-wrapper {
        width: 80px;
    }
}