/* --- PLAYER VARIABLES --- */
:root {
    --player-bg: rgba(10, 15, 25, 0.95);
    --player-border: rgba(255, 255, 255, 0.1);
    --player-h: 80px; 
    --mini-h: 65px;   
    --tab-h: 75px;    
}

/* === PERSISTENT PLAYER BAR === */
.player-bar {
    position: fixed;
    bottom: 0; 
    left: 240px; /* Для ПК */
    right: 0;
    height: var(--player-h);
    background: var(--player-bg);
    backdrop-filter: blur(15px);
    border-top: 1px solid var(--player-border);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    
    /* СКРЫВАЕМ ПО УМОЛЧАНИЮ */
    transform: translateY(150%); 
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    opacity: 0;

    /* ВАЖНО: Отключаем клики, пока плеер скрыт */
    pointer-events: none;
}

/* КЛАСС ДЛЯ ПОКАЗА ПЛЕЕРА */
.player-bar.active {
    transform: translateY(0);
    opacity: 1;

    /* ВАЖНО: Включаем клики, когда плеер появился */
    pointer-events: auto;
}

/* Progress Bar (Top Line) */
.player-progress-container {
    width: 100%; height: 4px; background: rgba(255,255,255,0.1);
    cursor: pointer; position: relative;
}
.player-progress-fill {
    height: 100%; background: var(--accent); width: 0%;
    transition: width 0.1s linear;
}
.player-progress-container:hover { height: 8px; margin-top: -4px; }

/* Content Layout */
.player-content {
    display: flex; align-items: center; justify-content: space-between;
    height: 100%; padding: 0 20px;
}

/* Track Info */
.player-track-info { display: flex; align-items: center; gap: 15px; width: 25%; }
#p-cover { width: 50px; height: 50px; border-radius: 6px; object-fit: cover; }
.p-title { color: white; font-weight: bold; font-size: 0.95rem; line-height: 1.2; }
.p-artist { color: var(--text-muted); font-size: 0.8rem; }

/* Controls (Center) */
.player-controls { display: flex; align-items: center; gap: 20px; justify-content: center; flex: 1; }
.p-btn { background: none; border: none; color: #ccc; cursor: pointer; transition: 0.2s; font-size: 1.2rem; }
.p-btn:hover { color: white; transform: scale(1.1); }
.p-btn.active { color: var(--accent); text-shadow: 0 0 10px var(--accent); }

/* Play Button */
.play-pause-btn {
    width: 40px; height: 40px; border-radius: 50%;
    background: white; color: black;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
}
.play-pause-btn:hover { background: var(--accent); color: black; transform: scale(1.1); }

/* Actions (Right) */
.player-actions { display: flex; align-items: center; gap: 15px; width: 25%; justify-content: flex-end; }
.volume-wrapper { display: flex; align-items: center; gap: 8px; }
#volume-slider { width: 80px; accent-color: var(--accent); }

/* Стиль для активного лайка */
.p-btn.liked, .mp-like-btn.liked {
    color: #ff3366 !important;
    animation: popIn 0.3s;
}
.p-btn.liked i, .mp-like-btn.liked i {
    font-weight: 900;
}

/* === MOBILE MINI PLAYER === */
@media (max-width: 768px) {
    .player-bar {
        left: 0; 
        /* Поднимаем над нижним меню */
        bottom: calc(var(--tab-h) + 10px); 
        width: 95%; 
        left: 2.5%; 
        height: 60px;
        border-radius: 12px;
        border: 1px solid rgba(255,255,255,0.15);
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        
        /* Снова скрываем, но с учетом отступа */
        transform: translateY(200%);
    }
    
    .player-bar.active {
        transform: translateY(0);
    }
    
    .player-content { padding: 0 15px; }
    .player-controls button:not(.play-pause-btn) { display: none; } /* Скрываем лишние кнопки */
    .desktop-only-flex, .desktop-only-bar { display: none !important; }
    
    .play-pause-btn { width: 35px; height: 35px; font-size: 1.2rem; }
    
    /* Тап по инфо открывает фуллскрин */
    .player-track-info { flex: 1; cursor: pointer; }
}

/* === MOBILE FULL SCREEN PLAYER === */
.mobile-player-overlay {
    position: fixed; top: 100%; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, #1a1a2e, #000);
    z-index: 2000;
    transition: top 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex; flex-direction: column;
    padding: 20px 30px;
    overflow-y: auto;
}
.mobile-player-overlay.open { top: 0; }

/* MP Elements */
.mp-header { display: flex; justify-content: space-between; color: white; font-weight: bold; margin-bottom: 30px; margin-top: 10px; }
.mp-btn { background: none; border: none; color: white; font-size: 1.5rem; }

.mp-cover-box { 
    width: 100%; aspect-ratio: 1/1; 
    border-radius: 20px; overflow: hidden; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    margin-bottom: 30px;
}
#mp-cover { width: 100%; height: 100%; object-fit: cover; }

.mp-info-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 30px; }
.mp-text h2 { font-size: 1.5rem; color: white; margin-bottom: 5px; }
.mp-text p { color: var(--accent); font-size: 1rem; }
.mp-like-btn { background: none; border: none; color: #ccc; font-size: 1.8rem; }

/* Seek Slider */
#mp-seek-slider { width: 100%; accent-color: var(--accent); margin-bottom: 10px; }
.mp-time-row { display: flex; justify-content: space-between; color: var(--text-muted); font-size: 0.8rem; font-family: monospace; }

/* Controls */
.mp-controls { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; }
.mp-ctrl-btn { background: none; border: none; color: white; transition: 0.2s; }
.mp-ctrl-btn.sm { font-size: 1.5rem; color: var(--text-muted); }
.mp-ctrl-btn.md { font-size: 2.5rem; }
.mp-ctrl-btn.lg { 
    font-size: 3.5rem; background: white; color: black; 
    border-radius: 50%; width: 70px; height: 70px; 
    display: flex; align-items: center; justify-content: center; 
}
.mp-ctrl-btn.active { color: var(--accent); }
/* ФИКС ОБЛОЖЕК */
.spotlight-img, 
.ci-img, 
.mp-img, 
#p-cover, 
#fp-cover,
#mp-cover {
    object-fit: contain !important; /* Показывает картинку целиком */
    background-color: #000; /* Черный фон, если картинка не квадратная */
}

/* На всякий случай для мобильного плеера */
#fp-cover {
    width: 100%;
    height: auto;
    max-height: 80vh;
    aspect-ratio: 1/1;
}