/* ===================================== */
/*              SEARCH OVERLAY           */
/* ===================================== */

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-main);
    z-index: 10000;
    overflow-y: auto;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-overlay.active {
    display: block;
    opacity: 1;
}

/* Шапка поиска */
.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: var(--bg-main);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: sticky;
    top: 0;
    z-index: 10001;
    backdrop-filter: blur(10px);
}

.search-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--accent);
    font-weight: 700;
}

.close-search {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-search:hover {
    background: var(--red);
    transform: rotate(90deg);
}

/* Поле ввода */
.mobile-search-wrapper {
    position: sticky;
    top: 71px;
    background: var(--bg-main);
    padding: 15px 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    z-index: 10000;
    backdrop-filter: blur(10px);
}

.mobile-search-input {
    width: 100%;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.1);
    padding: 15px 20px;
    border-radius: 40px;
    color: white;
    font-size: 16px;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.mobile-search-input:focus {
    border-color: var(--accent);
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 20px rgba(255,215,0,0.2);
}

/* Результаты */
#searchResults {
    padding: 20px 25px 40px;
    min-height: calc(100vh - 180px);
}

/* Секция результатов */
.results-section {
    margin-bottom: 40px;
    animation: fadeInUp 0.4s ease;
}

.results-section:last-child {
    margin-bottom: 0;
}

.results-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 0 5px;
}

.results-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.results-section-count {
    font-size: 13px;
    color: var(--text-dim);
    background: rgba(255,255,255,0.05);
    padding: 4px 12px;
    border-radius: 30px;
    font-weight: 500;
}

/* Горизонтальный скролл */
.results-scroll {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 5px 20px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.results-scroll::-webkit-scrollbar {
    height: 4px;
}

.results-scroll::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

.results-scroll::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.02);
}

/* Карточка артиста */
.result-artist-card {
    min-width: 140px;
    width: 140px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 15px 10px;
    background: rgba(255,255,255,0.02);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.03);
    animation: cardAppear 0.4s ease;
}

.result-artist-card:hover {
    transform: translateY(-8px);
    background: rgba(255,215,0,0.05);
    border-color: rgba(255,215,0,0.2);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.result-artist-cover {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 12px;
    overflow: hidden;
    border: 3px solid transparent;
    transition: border-color 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.result-artist-card:hover .result-artist-cover {
    border-color: var(--accent);
}

.result-artist-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-artist-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.result-artist-tracks {
    font-size: 12px;
    color: var(--text-dim);
}

/* Карточка альбома */
.result-album-card {
    min-width: 160px;
    width: 160px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 15px;
    background: rgba(255,255,255,0.02);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.03);
    animation: cardAppear 0.4s ease;
}

.result-album-card:hover {
    transform: translateY(-8px);
    background: rgba(255,215,0,0.05);
    border-color: rgba(255,215,0,0.2);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.result-album-cover {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    margin: 0 auto 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
}

.result-album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.result-album-card:hover .result-album-cover img {
    transform: scale(1.05);
}

.result-album-cover::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    background: rgba(0,0,0,0.3);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-album-card:hover .result-album-cover::after {
    opacity: 1;
}

.result-album-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    text-align: center;
}

.result-album-artist {
    font-size: 13px;
    color: var(--text-dim);
    display: block;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-album-year {
    font-size: 12px;
    color: var(--accent);
    display: block;
    text-align: center;
    margin-top: 4px;
}

/* Таблица треков - единый стиль */
.results-table-container {
    background: rgba(0,0,0,0.2);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.02);
    margin-top: 10px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.results-table th {
    text-align: left;
    padding: 15px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.2);
}

.results-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    transition: all 0.2s ease;
}

.results-table tr {
    cursor: pointer;
    transition: background 0.2s ease;
}

.results-table tr:hover {
    background: rgba(255,215,0,0.05);
}


/* Колонки таблицы - фиксированная ширина */
.result-track-index {
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    text-align: center;
    font-weight: 600;
    color: var(--accent);
    font-family: monospace;
    font-size: 14px;
}

.result-track-cover-cell {
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    padding: 8px !important;
}

.result-track-cover {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    background-color: #222;
    flex-shrink: 0;
    margin: 0 auto !important;
    display: block;
}

.result-track-info {
    max-width: 400px;
    display: flex !important;
    align-items: center;
    gap: 12px;
}

.result-track-name {
    font-weight: 500;
    display: block;
    margin-bottom: 4px;
    color: var(--text-main);
    font-size: 14px;
}

.result-track-artist {
    font-size: 12px;
    color: var(--text-dim);
    display: block;
}

.result-track-album {
    max-width: 250px;
    color: var(--text-dim);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-track-duration {
    color: var(--text-dim);
    font-size: 13px;
    font-family: monospace;
    min-width: 60px;
    text-align: right;
}

.result-track-plays {
    color: var(--text-dim);
    font-size: 13px;
    min-width: 70px;
    text-align: right;
}

.result-track-menu {
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    text-align: center;
}

/* Пустое состояние */
.search-empty,
.search-no-results {
    text-align: center;
    padding: 100px 20px;
    color: var(--text-dim);
    animation: fadeIn 0.4s ease;
}

.search-empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.search-empty h3,
.search-no-results h3 {
    font-size: 24px;
    margin: 0 0 10px 0;
    color: #fff;
}

.search-empty p,
.search-no-results p {
    font-size: 16px;
    margin: 0;
    opacity: 0.7;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

/* Задержки для анимации */
.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }
.delay-5 { animation-delay: 0.25s; }
.delay-6 { animation-delay: 0.3s; }
.delay-7 { animation-delay: 0.35s; }
.delay-8 { animation-delay: 0.4s; }
.delay-9 { animation-delay: 0.45s; }
.delay-10 { animation-delay: 0.5s; }

/* Адаптив */
@media (max-width: 768px) {
    .search-header {
        padding: 12px 16px;
    }

    .search-header h2 {
        font-size: 18px;
    }

    .close-search {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .mobile-search-wrapper {
        padding: 12px 16px;
        top: 60px;
    }

    .mobile-search-input {
        padding: 12px 16px;
        font-size: 15px;
    }

    #searchResults {
        padding: 16px;
    }

    .results-section-title {
        font-size: 16px;
    }

    .result-artist-card {
        min-width: 120px;
        width: 120px;
        padding: 12px 8px;
    }

    .result-artist-cover {
        width: 80px;
        height: 80px;
    }

    .result-artist-name {
        font-size: 13px;
    }

    .result-artist-tracks {
        font-size: 11px;
    }

    .result-album-card {
        min-width: 140px;
        width: 140px;
        padding: 12px;
    }

    .result-album-cover {
        width: 100px;
        height: 100px;
    }

    .result-album-name {
        font-size: 14px;
    }

    .result-album-artist {
        font-size: 12px;
    }

    .results-table th {
        padding: 12px 10px;
        font-size: 11px;
    }

    .results-table td {
        padding: 10px;
        font-size: 12px;
    }

    .result-track-info {
        max-width: 200px;
    }

    .result-track-name {
        font-size: 13px;
    }

    .result-track-artist {
        font-size: 11px;
    }

    .result-track-album {
        max-width: 150px;
        font-size: 12px;
    }

    .result-track-duration,
    .result-track-plays {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .result-artist-card {
        min-width: 100px;
        width: 100px;
    }

    .result-artist-cover {
        width: 70px;
        height: 70px;
    }

    .result-album-card {
        min-width: 120px;
        width: 120px;
    }

    .result-album-cover {
        width: 80px;
        height: 80px;
    }

    .result-track-info {
        max-width: 150px;
    }

    .result-track-album {
        display: none;
    }

    .results-table th:nth-child(3),
    .results-table td:nth-child(3) {
        display: none;
    }
}
