* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #ffffff;
    color: #333;
    min-height: 100vh;
    font-family: "Manrope", sans-serif;
    overflow-y: auto;
}

.container {
    margin: 0 auto;
}

.subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin-bottom: 20px;
    font-family: "Manrope", sans-serif;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    color: #333;
    font-size: 1rem;
    font-family: "Manrope", sans-serif;
}

.search-box input:focus {
    outline: none;
    border-color: #4c5552;
}

.search-box input::placeholder {
    color: #95a5a6;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: #4c5552 transparent;
    flex-wrap: nowrap;
    max-width: 100%;

     /* Добавьте эти свойства для плавности */
    scroll-behavior: smooth !important;
    -webkit-overflow-scrolling: touch;
    transition: scroll-left 0.3s ease;
}

.filter-buttons::-webkit-scrollbar {
    height: 8px;
    transition: all 0.3s ease;
}

.filter-buttons::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.filter-buttons::-webkit-scrollbar-thumb {
    background-color: #4c5552;
    border-radius: 3px;
}

.filter-btn {
    padding: 12px 24px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 32px;
    color: #4c5552;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "Oranienbaum", serif;
    font-size: 1rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-btn:hover {
    background: #8e8e93;
    color: white;
    border-color: #8e8e93;
}

.filter-btn.active {
    background: #4c5552;
    color: white;
    border-color: #4c5552;
}

.performers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.performer-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 210px;
    display: flex;
    flex-direction: column;
    isolation: isolate;
    position: relative;
}

.performer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.performer-header {
    background: #f8f9fa;
    color: #2c3e50;
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    min-height: 80px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.performer-info {
    flex: 1;
}

.performer-name {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 3px;
    color: #4c5552;
    font-family: "Oranienbaum", serif;
}

.performer-title {
    font-size: 0.75rem;
    color: #8e8e93;
    font-weight: 500;
    line-height: 1.2;
    font-family: "Manrope", sans-serif;
}

.tracks-list {
    padding: 0;
    flex: 1;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-height: 150px !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-behavior: smooth !important;
    overscroll-behavior: auto !important;
    scrollbar-width: thin !important;
    scrollbar-color: #d1d1d1 #f8f9fa !important;
}

.tracks-list::-webkit-scrollbar {
    width: 14px !important;
}

.tracks-list::-webkit-scrollbar-track {
    background: #f8f9fa !important;
    border-radius: 7px !important;
}

.tracks-list::-webkit-scrollbar-thumb {
    background: #d1d1d1 !important;
    border-radius: 7px !important;
    border: 3px solid #f8f9fa !important;
    min-height: 40px !important;
}

.tracks-list::-webkit-scrollbar-thumb:hover {
    background: #b8b8b8 !important;
}

.tracks-list::-webkit-scrollbar-button:single-button {
    background-color: #f8f9fa;
    display: block;
    background-size: 10px;
    background-repeat: no-repeat;
    height: 20px !important;
    width: 14px !important;
}

.tracks-list::-webkit-scrollbar-button:single-button:vertical:decrement {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%234c5552'><polygon points='0,5 10,5 5,0'/></svg>");
    background-position: center 7px;
}

.tracks-list::-webkit-scrollbar-button:single-button:vertical:increment {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%234c5552'><polygon points='0,0 10,0 5,5'/></svg>");
    background-position: center 7px;
}

.track-item {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    overflow: hidden;
}

.track-item:hover {
    background-color: #f8f9fa;
}

.track-item:last-child {
    border-bottom: none;
}

.track-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 3px;
    color: #2c3e50;
    font-family: "Manrope", sans-serif;
    line-height: 1.2;
}

/* СТИЛИ ДЛЯ АВТОРА ПЕСНИ - БЕГУЩАЯ СТРОКА */
.track-author-marquee {
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
    margin-bottom: 1px;
    position: relative;
    height: 20px;
    min-height: 20px;
    flex-shrink: 0;
}

.track-author {
    font-size: 0.7rem;
    color: #8e8e93;
    font-family: "Manrope", sans-serif;
    line-height: 1.4;
    white-space: nowrap;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Бегущая строка - базовый стиль */
.track-author-marquee.scroll {
    position: relative;
}

.track-author-marquee.scroll .track-author {
    display: inline-block;
    text-overflow: clip;
    padding-left: 100%;
    animation: var(--marquee-animation, none);
}

.track-author-marquee:not(.scroll) .track-author {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Анимация бегущей строки */
@keyframes marquee-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Пауза анимации при наведении */
.track-item:hover .track-author-marquee.scroll .track-author {
    animation-play-state: paused;
}

.audio-player {
    margin: 2px 0 2px 0;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    margin: 1px 0 1px 0;
    cursor: pointer;
    position: relative;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #4c5552, #8e8e93);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: #8e8e93;
    margin-bottom: 1px;
    font-family: "Manrope", sans-serif;
}

.track-actions {
    display: flex;
    gap: 5px;
    margin-top: 8px;
}

.performer-card .btn {
    padding: 8px 12px !important;
    border: none !important;
    border-radius: 20px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    font-family: "Manrope", sans-serif !important;
    color: white !important;
    min-height: 32px !important;
    line-height: 1 !important;
    min-width: auto !important;
    width: auto !important;
    height: auto !important;
    gap: 4px !important;
}

.performer-card .btn-play {
    background: #4c5552 !important;
    color: white !important;
    flex: 1 !important;
}

.performer-card .btn-play.playing {
    background: #8e8e93 !important;
}

.performer-card .btn-download {
    background: #4c5552 !important;
    color: white !important;
    flex: 1 !important;
}

.performer-card .btn:disabled {
    background: #bdc3c7 !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

.performer-card .btn:hover:not(:disabled) {
    opacity: 0.9 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
    background: #8e8e93 !important;
}

.performer-card .icon {
    font-size: 0.7rem !important;
    color: white !important;
}

.performer-card .btn-text {
    font-size: 0.7rem !important;
    color: white !important;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #8e8e93;
    font-size: 1.1rem;
    background: #f8f9fa;
    border-radius: 10px;
    font-family: "Manrope", sans-serif;
}

.stats {
    margin-bottom: 20px;
    color: #8e8e93;
    font-size: 0.9rem;
    text-align: center;
    font-family: "Manrope", sans-serif;
}

.tracks-list * {
    position: static !important;
    transform: none !important;
}

.filter-buttons::-webkit-scrollbar {
    height: 8px;
}

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

.filter-buttons::-webkit-scrollbar-thumb {
    background: #4c5552;
    border-radius: 4px;
}

.filter-buttons::-webkit-scrollbar-thumb:hover {
    background: #3a423f;
}

.tracks-list.single-track {
    overflow-y: hidden !important;
}

.tracks-list.single-track::-webkit-scrollbar {
    display: none !important;
}

@media (max-width: 768px) {
    .performers-grid {
        grid-template-columns: 1fr;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .performer-header {
        padding: 8px 10px;
    }
    
    .performer-card {
        height: 210px;
    }
    
    .filter-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .filter-buttons {
        gap: 8px;
        padding-bottom: 10px;
    }
    
    .track-item {
        min-height: 105px;
        padding: 12px 15px;
    }
    
    .tracks-list {
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: auto !important;
    }
    
    .track-author {
        font-size: 0.65rem;
        animation-duration: 12s;
    }
    
    .track-title {
        font-size: 0.85rem;
    }
}

.performer-card {
    overscroll-behavior: auto;
}

.performers-grid {
    overscroll-behavior: none;
}

.filter-buttons {
    cursor: grab;
    scroll-behavior: smooth;
    transition: scroll-left 0.2s ease;
}

.filter-buttons:active {
    cursor: grabbing;
}

.tracks-list {
    scrollbar-width: thin;
    scrollbar-color: #d1d1d1 #f8f9fa;
}

.track-item:focus {
    background-color: #f8f9fa;
    outline: none;
}

.track-item,
.btn,
.progress-bar {
    transition: all 0.2s ease;
}

.tracks-list::-webkit-scrollbar-button:single-button {
    background-color: #f8f9fa;
    display: block;
    background-size: 10px;
    background-repeat: no-repeat;
    height: 16px !important;
    width: 14px !important;
    border: none !important;
}

.tracks-list::-webkit-scrollbar-button:single-button:vertical:decrement {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%234c5552'><polygon points='0,5 10,5 5,0'/></svg>");
    background-position: center 4px;
    background-repeat: no-repeat;
}

.tracks-list::-webkit-scrollbar-button:single-button:vertical:increment {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%234c5552'><polygon points='0,0 10,0 5,5'/></svg>");
    background-position: center 4px;
    background-repeat: no-repeat;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.performer-card {
    animation: fadeInUp 0.5s ease forwards;
}

.track-title {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.progress-bar:hover .progress {
    background: linear-gradient(90deg, #3a423f, #6e6e72);
}

.track-item.active {
    background-color: #e8f4f8;
    border-left: 3px solid #4c5552;
}

@media (prefers-reduced-motion: reduce) {
    .track-author {
        animation: none;
        white-space: normal;
        padding-left: 0;
    }
    
    .performer-card {
        animation: none;
    }
    
    .btn:hover:not(:disabled) {
        transform: none;
    }
    
    .performer-card:hover {
        transform: none;
    }
}

/* --- Исправление ступенчатой прокрутки фильтров --- */
.filter-buttons {
    scroll-behavior: auto !important;
    transition: none !important;
}

/* mobile scroll improvements */
.performer-card { touch-action: pan-y; }
.tracks-list { touch-action: pan-y; }
.filters-container { touch-action: pan-x; }
