/* ===== playlist.css – редизайн в стиле трека ===== */

/* Hero-обёртка с анимированным фиолетово-красным градиентом */
.playlist-hero-wrapper {
    margin-bottom: 40px;
    border-radius: 32px;
    overflow: hidden;
}
.playlist-hero-bg {
    background: linear-gradient(135deg, #422eda 0%, #ff001c 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    padding: 36px 40px;
    position: relative;
    z-index: 0;
}
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.playlist-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.25);
    z-index: 0;
}
.playlist-hero {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 40px;
    align-items: center;
}

/* Медиа (обложка + кнопка) */
.playlist-hero-media {
    flex-shrink: 0;
}
.playlist-cover-large {
    position: relative;
    width: 220px;
    height: 220px;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 20px 30px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
}
.playlist-cover-large:hover {
    transform: scale(1.02);
}
.playlist-cover-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* Кнопка Play – чёрная */
.playlist-play-all-btn {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #111;
    border: none;
    color: #fff;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transition: transform 0.2s, background 0.2s;
    z-index: 2;
}
.playlist-play-all-btn:hover {
    background: #222;
    transform: translate(-50%, -50%) scale(1.08);
}

/* Информация */
.playlist-hero-info {
    flex: 1;
    min-width: 0;
    color: #fff;
}
.playlist-badge {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    padding: 4px 14px;
    border-radius: 40px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}
.playlist-hero-title {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 12px 0;
    word-break: break-word;
    color: #fff;
}
.playlist-hero-meta {
    display: flex;
    gap: 24px;
    margin-bottom: 18px;
    color: rgba(255,255,255,0.9);
    font-size: 15px;
    flex-wrap: wrap;
}
.playlist-hero-meta i {
    margin-right: 6px;
    opacity: 0.8;
}

/* Кнопки действий */
.playlist-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.playlist-hero-btn {
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    padding: 10px 20px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}
.playlist-hero-btn:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.4);
}
.playlist-hero-btn.primary {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.playlist-hero-btn.primary:hover {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.18);
}

/* Поиск */
.playlist-search-wrapper {
    margin-bottom: 20px;
    animation: fadeInUp 0.6s ease-out 0.15s backwards;
}
.search-wrapper {
    background: var(--search-bg);
    border-radius: 40px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--search-border);
}
.search-wrapper i { color: var(--text-secondary); }
.search-wrapper input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    width: 100%;
    outline: none;
}
.search-wrapper input::placeholder { color: var(--text-secondary); }

/* Фильтры жанров */
.genres-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    animation: fadeInUp 0.6s ease-out 0.3s backwards;
}
.genre-filter-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 6px 16px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}
.genre-filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}
.genre-filter-btn:hover:not(.active) {
    background: var(--nav-item-hover-bg);
    color: var(--text-primary);
}

/* Список треков */
.playlist-tracks {
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: fadeInUp 0.6s ease-out 0.45s backwards;
}
.playlist-track-item {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: 0.2s;
}
.playlist-track-item:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px var(--shadow-heavy);
}
.track-cover-small {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}
.track-cover-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.track-play-btn-small {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}
.track-play-btn-small i {
    color: #ffffff !important;
}
.playlist-track-item:hover .track-play-btn-small {
    opacity: 1;
}
.track-info-small {
    flex: 1;
    min-width: 0;
}
.track-title-small {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.track-artist-small {
    font-size: 13px;
    color: var(--text-secondary);
}
.track-meta-small {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}
.track-duration-small, .track-plays-small {
    display: flex;
    align-items: center;
    gap: 4px;
}
.track-genre-tag {
    background: rgba(255, 102, 46, 0.1);
    color: var(--accent);
    padding: 2px 10px;
    border-radius: 40px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
}
.track-remove-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    flex-shrink: 0;
}
.track-remove-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}
.empty-state i {
    font-size: 48px;
    color: var(--accent);
    opacity: 0.5;
    margin-bottom: 16px;
}
.empty-state p { font-size: 16px; }
.empty-state.hidden { display: none; }

/* Модальное окно */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-overlay.hidden { display: none; }
.modal-container {
    background: var(--bg-sidebar);
    border-radius: 28px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    border: 1px solid var(--border-light);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}
.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
}
.modal-close:hover { color: var(--accent); }
.modal-body {
    padding: 20px 24px;
}
.modal-body p {
    color: var(--text-primary);
    margin-bottom: 20px;
}
.help-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}
.help-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    flex: 1;
}
.help-btn.danger {
    background: #f87171;
    border-color: #f87171;
    color: #fff;
}
.help-btn:hover { background: var(--nav-item-hover-bg); }
.help-btn.danger:hover { background: #ef4444; }

/* Верификация автора */
.track-artist-verified {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.track-artist-verified i { color: #1d9bf0; }

/* Ссылки */
.track-title-link,
.track-artist-link {
    color: inherit;
    text-decoration: none;
}
.track-title-link:hover,
.track-artist-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* Анимации */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Адаптивность ===== */
@media (min-width: 769px) and (max-width: 1120px) {
    .playlist-hero {
        flex-direction: column;
        text-align: center;
        align-items: center;
        gap: 28px;
    }
    .playlist-cover-large {
        width: 200px;
        height: 200px;
        margin: 0 auto;
    }
    .playlist-hero-info {
        text-align: center;
    }
    .playlist-hero-meta,
    .playlist-hero-actions {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .playlist-hero-bg {
        padding: 24px 20px;
    }
    .playlist-hero {
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }
    .playlist-cover-large {
        width: 180px;
        height: 180px;
        margin: 0 auto;
    }
    .playlist-hero-title {
        font-size: 32px;
    }
    .playlist-hero-btn {
        font-size: 13px;
        padding: 8px 16px;
    }
    .genres-filter {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }
    .playlist-track-item {
        padding: 10px 12px;
        gap: 12px;
    }
    .track-cover-small {
        width: 40px;
        height: 40px;
    }
    .track-play-btn-small {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    .track-title-small {
        font-size: 14px;
        white-space: normal;
        word-break: break-word;
    }
}

@media (max-width: 480px) {
    .playlist-cover-large {
        width: 140px;
        height: 140px;
    }
    .playlist-play-all-btn {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    .playlist-hero-title {
        font-size: 24px;
    }
    .playlist-hero-meta {
        font-size: 13px;
        gap: 12px;
    }
    .playlist-hero-btn {
        width: 100%;
        justify-content: center;
    }
}