/* Фиксированный плеер */
.fixed-player {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #2c2c2c;
    padding: 10px 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1000;
    border-top: 1px solid #444;
    align-items: center;
}

body {
    padding-bottom: 80px;
}

/* Основная структура плеера */
.player-content {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    gap: 15px;
}

/* Группы элементов плеера */
.player-header {
    display: flex;
    align-items: center;
    min-width: 200px;
    max-width: 250px;
    flex-shrink: 0;
}

.player-cover {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
}

.player-info {
    flex: 1;
    min-width: 0;
    color: white;
    overflow: hidden;
    margin-right: 15px;
    margin-left: 10px;
}

.player-title {
    font-weight: bold;
    margin-bottom: 2px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

.player-title:hover {
    color: #b19cd9;
}

.player-artist {
    font-size: 12px;
    color: #aaa;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.player-artist:hover {
    color: #ddd;
}

/* Элементы управления плеером */
.player-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    order: 1;
    /* Перемещаем контролы перед прогресс-баром */
}

.player-progress {
    flex: 1;
    min-width: 200px;
    max-width: 600px;
    margin: 0 15px;
    order: 2;
    /* Перемещаем прогресс-бар после контролов */
}

.progress-container {
    height: 4px;
    background: #444;
    border-radius: 2px;
    cursor: pointer;
    margin-bottom: 5px;
    width: 100%;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, #6f42c1, #d30d60);
    border-radius: 2px;
    width: 0%;
    position: relative;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #aaa;
}

/* Дополнительные кнопки управления */
.player-additional-controls {
    order: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    /* margin-left: auto; */
    /* Прижимаем к правому краю */
}

/* Кнопки плеера */
.player-btn {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.player-btn:hover {
    color: #b19cd9;
    transform: scale(1.1);
}

.player-btn.prev-btn,
.player-btn.next-btn {
    color: #6f42c1;
}

.player-btn.prev-btn:hover,
.player-btn.next-btn:hover {
    color: #5a32a3;
}

.player-btn.download-btn {
    color: #6f42c1;
}

.player-btn.download-btn:hover {
    color: #5a32a3;
}

.player-btn.delete-btn {
    color: #dc3545;
}

.player-btn.delete-btn:hover {
    color: #c82333;
}

.play-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #6f42c1;
    color: white;
    border-radius: 50%;
    border: none;
    transition: all 0.2s;
    cursor: pointer;
}

.play-btn:hover {
    background-color: #5a32a3;
    transform: scale(1.1);
}

/* Кнопка закрытия - теперь в блоке дополнительных контролов */
.close-btn {
    color: white;
    font-size: 20px;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
    margin-left: 10px;
    /* Добавляем отступ слева */
}

.player-btn.close-btn {
    order: unset !important;
}

.close-btn:hover {
    color: #b19cd9;
    opacity: 1;
    transform: scale(1.1);
}

.volume-control {
    position: relative;
}

.volume-slider {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%);
    width: 10px;
    height: 100px;
    margin-bottom: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 10;
    background: linear-gradient(to top, #c142c0, #7445ad) no-repeat;
    background-size: 100% 100%;
    border-radius: 5px;
    padding: 0px 5px;
    writing-mode: vertical-lr;
    direction: rtl;
}

/* Стилизация самого ползунка (thumb) */
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #6f42c1;
    /* Фиолетовый */
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.volume-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #6f42c1;
    /* Фиолетовый */
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.volume-slider.show {
    opacity: 1;
    visibility: visible;
}

/* Адаптация для больших экранов (>992px) */
@media (min-width: 993px) {
    .player-content {
        justify-content: flex-start;
    }

    .player-progress {
        flex: 1;
    }
}

/* Адаптация для средних экранов (684px - 992px) */
@media (max-width: 992px) and (min-width: 684px) {
    .player-content {
        flex-wrap: nowrap;
    }

    .player-header {
        min-width: 180px;
        max-width: 200px;
    }

    .player-progress {
        flex: 1;
        min-width: 0;
        max-width: none;
        margin: 0 10px;
    }

    .close-btn {
        margin-left: 10px;
    }
}

/* Адаптация для мобильных устройств (<684px) */
@media (max-width: 683px) {
    .player-content {
        flex-direction: column;
        gap: 10px;
    }

    .player-header {
        width: calc(100% - 50px);
        max-width: none;
    }

    .player-controls {
        width: 100%;
        justify-content: center;
        order: 1;
    }

    .player-progress {
        width: 100%;
        order: 2;
    }

    .player-additional-controls {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }

    .close-btn {
        position: static;
        margin-left: 15px;
    }

    /* Скрываем кнопку громкости на мобильных устройствах */
    .volume-control {
        display: none;
    }
}

/* Остальные стили остаются без изменений */
.track-item {
    position: relative;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #f8f9fa;
}

/* Добавляем в конец файла или в соответствующую секцию */

/* Стиль для активного (играющего) трека */
.track-item.playing {
    background: linear-gradient(135deg, rgba(111, 66, 193, 0.1), rgba(211, 13, 96, 0.1));
    box-shadow: 0 0 0 2px #6f42c1;
    border: 1px solid rgba(111, 66, 193, 0.3);
}

/* Стиль при наведении на трек */
.track-item:hover {
    background: linear-gradient(135deg, rgba(111, 66, 193, 0.05), rgba(211, 13, 96, 0.05));
    transform: translateY(-2px);
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Комбинированный стиль - когда трек играет И на него наведен курсор */
.track-item.playing:hover {
    background: linear-gradient(135deg, rgba(111, 66, 193, 0.15), rgba(211, 13, 96, 0.15));
    box-shadow: 0 0 0 2px #6f42c1, 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Анимация для кнопки play в активном треке */
.track-item.playing .play-btn {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(111, 66, 193, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(111, 66, 193, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(111, 66, 193, 0);
    }
}

.track-content {
    display: flex;
    flex-direction: column;
}

a.track-header {
    color: #5a32a3;
}

.track-header {
    display: flex;
    align-items: flex-start;
    text-decoration: none !important;
    margin-bottom: 10px;
    width: 100%;
}

.track-cover {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 15px;
    flex-shrink: 0;
}

.track-info {
    flex: 1;
    min-width: 0;
    margin-right: 15px;
    text-decoration: none !important;
    background: linear-gradient(273deg, #69148124, #db161614);
    border-radius: 10px;
}

.track-title {
    font-weight: 500;
    margin-bottom: 2px;
    margin-left: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 16px;
    text-decoration: none !important;
    color: #6f42c1;
}

.track-artist {
    font-size: 14px;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
    margin-left: 10px;
}

.audio-player {
    display: flex;
    align-items: center;
    width: 90%;
    margin-top: 10px;
}

.track-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

.track-genre {
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
    margin-left: 10px;
}

.download-btn,
.edit-btn {
    background: none;
    border: none;
    color: #6f42c1;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    transition: all 0.2s;
}

.download-btn:hover {
    color: #5a32a3;
    transform: scale(1.1);
}

.edit-btn {
    color: #6c757d;
}

.edit-btn:hover {
    color: #495057;
    transform: scale(1.1);
}

.delete-btn {
    background: none;
    border: 1px solid #dc3545;
    color: #dc3545;
    border-radius: 4px;
    padding: 5px 10px;
    transition: all 0.2s;
    cursor: pointer;
    white-space: nowrap;
}

.delete-btn:hover {
    background: #dc3545;
    color: white;
}

.delete-btn.mobile {
    display: none;
}

/* Анимация при удалении */
@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
        max-height: 0;
        padding: 0;
        margin: 0;
    }
}

.track-item.deleting {
    animation: fadeOut 0.3s forwards;
}

.duration-badge {
    background-color: #e9ecef;
    color: #495057;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin-left: 10px;
}

/* Адаптация списка треков для мобильных */
@media (max-width: 768px) {
    .track-header {
        flex-wrap: nowrap;
    }

    .track-cover {
        width: 50px;
        height: 50px;
        margin-right: 10px;
    }

    .track-info {
        margin-right: 10px;
    }

    .track-title {
        font-size: 14px;
    }

    .track-artist {
        font-size: 12px;
    }

    .track-actions {
        gap: 5px;
    }

    .delete-btn.desktop {
        display: none;
    }

    .delete-btn.mobile {
        display: inline-block;
        border: none;
        font-size: 1rem;
        padding: 3px;
        background: none;
    }

    .download-btn,
    .edit-btn {
        font-size: 1rem;
        padding: 3px;
    }

    .track-item.playing {
        box-shadow: 0 0 0 1px #6f42c1;
    }

    .track-item:hover {
        transform: none;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
}

/* Остальные стили */
.filter-dropdown {
    min-width: 250px;
}

.filter-section {
    padding: 10px;
}

.filter-section h6 {
    margin-top: 10px;
    margin-bottom: 5px;
    font-weight: 600;
}

.btn-outline-secondary {
    color: #6f42c1;
    border-color: #6f42c1;
    margin-bottom: 10px;
}

.btn-outline-secondary:hover {
    color: white;
    background-color: #6f42c1;
    border-color: #6f42c1;
}

.dropdown-toggle.btn-outline-secondary {
    color: #6f42c1;
    border-color: #6f42c1;
}

.dropdown-toggle.btn-outline-secondary:hover {
    color: white;
    background-color: #6f42c1;
    border-color: #6f42c1;
}

.no-results {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-style: italic;
    margin: 20px 0;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #dee2e6;
}

.alert {
    transition: opacity 0.15s ease;
    background-color: #ebdeecc2;
}

.alert-info {
    --bs-alert-border-color: #bf96c9f5;
}

#applyFilters {
    background: linear-gradient(to right, #6f42c1, #d30d60) !important;
    color: white !important;
    border: none !important;
}

#applyFilters:hover {
    background: linear-gradient(to right, #5a32a3, #b80b50) !important;
    color: white !important;
}

.form-select:focus,
.form-control:focus {
    border-color: #6f42c1 !important;
    box-shadow: 0 0 0 0.25rem rgba(111, 66, 193, 0.25) !important;
}

.dropdown-item:focus,
.dropdown-item:hover {
    background-color: #6f42c1 !important;
    color: white !important;
}

.form-select option:checked {
    background-color: #6f42c1 !important;
    color: white !important;
}

.track-link {
    display: flex;
    flex-grow: 1;
    text-decoration: none;
    color: inherit;
    margin-right: 15px;
}

.track-link:hover {
    color: inherit;
}

.rating-badge {
    background-color: #f8f9fa;
    color: #6f42c1;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    border: 1px solid #dee2e6;
}

.rating-badge .bi {
    color: #ffc107;
    font-size: 11px;
}

.track-item.playing .rating-badge {
    background-color: white;
}