/* ===== СБРОС И БАЗОВЫЕ НАСТРОЙКИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
}

/* ===== ФОНОВЫЙ СЛОЙ С КАРТИНКОЙ ===== */
.bg-image-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        url('/img/fon.jpeg') center center / cover no-repeat,
        linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 0;
    pointer-events: none;
}

/* ===== КОНТЕЙНЕР ПЛЕЕРА ===== */
.container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 30px;
    max-width: 800px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

h1 {
    font-family: 'Raleway', sans-serif;
    text-align: center;
    color: #ffffff;
    margin-bottom: 30px;
    font-size: 2.6em;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow:
        0 2px 10px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(102, 126, 234, 0.3);
}

/* ===== АНИМИРОВАННЫЙ ФОН БЛОКА УПРАВЛЕНИЯ ===== */
.player-controls {
    background: linear-gradient(-45deg,
        rgba(102, 126, 234, 0.7),
        rgba(118, 75, 162, 0.7),
        rgba(240, 147, 251, 0.7),
        rgba(79, 172, 254, 0.7)
    );
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    color: white;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.player-controls.playing {
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.6);
    animation: gradientShift 8s ease infinite, pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(102, 126, 234, 0.4); }
    50% { box-shadow: 0 0 40px rgba(118, 75, 162, 0.7); }
}

.player-controls::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 15s linear infinite;
    pointer-events: none;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.now-playing {
    font-family: 'Raleway', sans-serif;
    font-weight: 400;
    letter-spacing: 1px;
}

/* ===== ПРОГРЕСС-БАР ===== */
.progress-container {
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    margin-bottom: 10px;
}

.progress {
    height: 100%;
    background: white;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    opacity: 0.9;
}

/* ===== КНОПКИ УПРАВЛЕНИЯ ===== */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
}

/* ВАЖНО: SVG не должен перехватывать клики — иначе кнопка не работает! */
.btn svg {
    display: block;
    pointer-events: none; /* ← КЛЮЧЕВОЕ ИСПРАВЛЕНИЕ */
    transition: transform 0.3s ease;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.btn:hover svg {
    transform: scale(1.05);
}

.btn-play {
    width: 65px;
    height: 65px;
    background: rgba(255, 255, 255, 0.25);
}

.btn-play svg {
    width: 28px;
    height: 28px;
}

.btn-play:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

/* ===== РЕГУЛИРОВКА ГРОМКОСТИ ===== */
.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.volume-icon {
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    cursor: pointer;
    pointer-events: auto; /* Иконка громкости должна реагировать на клики */
}

.volume-icon:hover {
    color: #ffffff;
    transform: scale(1.1);
}

.volume-slider {
    width: 150px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* ===== СПИСОК ТРЕКОВ ===== */
.track-list {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.track-list::-webkit-scrollbar {
    width: 8px;
}

.track-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.track-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.track-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.track-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(248, 249, 250, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.track-item:hover {
    background: rgba(233, 236, 239, 0.5);
    transform: translateX(5px);
}

.track-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.track-number {
    font-size: 1.2em;
    font-weight: bold;
    min-width: 40px;
    opacity: 0.6;
}

.track-item.active .track-number {
    opacity: 1;
}

/* ИСПРАВЛЕНО: переименован класс, чтобы не конфликтовать с иконкой Play/Pause */
.track-play-icon {
    font-size: 1.5em;
    margin-right: 15px;
}

.track-info {
    flex: 1;
    margin-left: 15px;
}

.track-title {
    font-weight: 500;
    margin-bottom: 5px;
}

.track-artist {
    font-size: 0.9em;
    font-weight: 300;
    opacity: 0.7;
}

.track-duration {
    font-size: 0.9em;
    opacity: 0.8;
}

/* ===== АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ ===== */
@media (max-width: 768px) {
    .container {
        background: rgba(255, 255, 255, 0.3);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        padding: 20px;
    }

    .player-controls {
        padding: 20px;
    }

    .track-item {
        background: rgba(248, 249, 250, 0.5);
        padding: 12px;
    }

    .track-item:hover {
        background: rgba(233, 236, 239, 0.6);
    }

    .track-item.active {
        background: rgba(102, 126, 234, 0.6);
    }

    .btn {
        background: rgba(255, 255, 255, 0.25);
        width: 45px;
        height: 45px;
    }

    .btn-play {
        width: 55px;
        height: 55px;
    }

    .btn-play svg {
        width: 24px;
        height: 24px;
    }

    h1 {
        font-size: 1.8em;
        letter-spacing: 2px;
    }
}

@media (max-width: 480px) {
    .container {
        background: rgba(255, 255, 255, 0.5);
        padding: 15px;
    }

    .player-controls {
        padding: 15px;
    }

    .track-item {
        background: rgba(248, 249, 250, 0.45);
        padding: 10px;
    }
}

/* ===== СЧЁТЧИК В УГЛУ ===== */
.fixed-counter {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 100;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.fixed-counter:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .fixed-counter {
        bottom: 15px;
        left: 15px;
    }
}
