/* ===================================== */
/*              HOME PAGE                */
/* ===================================== */

.home-page {
    padding: 20px 0 40px;
    animation: fadeIn 0.4s ease;
}

/* Hero микс */
.hero-mix {
    position: relative;
    height: 220px;
    border-radius: 24px;
    margin-bottom: 40px;
    background: linear-gradient(-45deg, #FFD700, #FFA500, #FF6B6B, #FFD700);
    background-size: 300% 300%;
    animation: gradientShift 8s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
}

.hero-mix:hover {
    transform: scale(1.02);
    box-shadow: 0 30px 60px rgba(255,215,0,0.3);
}

.hero-mix h1 {
    position: relative;
    z-index: 2;
    font-size: 48px;
    font-weight: 900;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    letter-spacing: 4px;
    animation: textGlow 2s ease-in-out infinite;
}

.hero-mix-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
                rgba(255,255,255,0.3) 0%, 
                transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.hero-mix:hover .hero-mix-overlay {
    opacity: 1;
}

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

@keyframes textGlow {
    0%, 100% { text-shadow: 0 0 20px rgba(255,255,255,0.5); }
    50% { text-shadow: 0 0 40px rgba(255,255,255,0.8); }
}

/* Секции */
.section {
    margin-bottom: 50px;
}

.section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: var(--text-main);
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.title-icon {
    font-size: 24px;
}

/* Таблицы на главной */
.table-container {
    background: rgba(0,0,0,0.2);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.02);
}

.home-table {
    width: 100%;
    border-collapse: collapse;
}

.home-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}

.home-table tr:last-child td {
    border-bottom: none;
}

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

.home-table tr.active {
    background: rgba(255,215,0,0.1);
    position: relative;
}

.home-table tr.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

/* Пустое состояние */
.empty-table {
    text-align: center;
    padding: 40px 20px !important;
    color: var(--text-dim);
}

.empty-table .empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-table h3 {
    font-size: 16px;
    margin: 0 0 8px 0;
    color: #fff;
}

.empty-table p {
    font-size: 13px;
    margin: 0;
    opacity: 0.7;
}

/* Скролл артистов */
.artists-scroll-container {
    position: relative;
    margin: 0 -5px;
}

.artists-scroll {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 5px 20px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

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

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

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

/* Карточка артиста */
.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;
    flex-shrink: 0;
    overflow: hidden;
}

.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);
}

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

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

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

.artist-info {
    width: 100%;
    overflow: hidden;
}

/* Контейнер для бегущей строки */
.artist-name-wrapper {
    width: 100%;
    overflow: hidden;
    margin-bottom: 5px;
    position: relative;
    height: 20px;
}

/* Бегущая строка - ТОЛЬКО для длинных названий */
.artist-card[data-long-name="true"] .artist-name-scroll {
    display: inline-flex;
    white-space: nowrap;
    animation: scrollText 10s linear infinite;
    animation-play-state: paused;
    will-change: transform;
}

.artist-card[data-long-name="true"]:hover .artist-name-scroll {
    animation-play-state: running;
}

.artist-card[data-long-name="true"] .artist-name,
.artist-card[data-long-name="true"] .artist-name-clone {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--text-main) !important;
    padding-right: 20px;
    display: inline-block;
    white-space: nowrap;
}

/* Для очень длинных названий */
.artist-card[data-long-name="true"] .artist-name-scroll {
    animation-duration: 15s;
}


.artist-name,
.artist-name-clone {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--text-main) !important;
    padding-right: 20px;
    display: inline-block;
    white-space: nowrap;
}

/* Статистика */
.artist-stats {
    font-size: 11px;
    color: var(--text-dim);
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
}

.artist-tracks {
    color: var(--text-dim);
    white-space: nowrap;
}

.artist-plays {
    color: var(--accent);
    white-space: nowrap;
}

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

/* Бегущая строка - ТОЛЬКО для длинных названий */
.artist-card[data-long-name="true"] .artist-name-scroll {
    display: inline-flex;
    white-space: nowrap;
    animation: scrollText 10s linear infinite;
    animation-play-state: paused;
    will-change: transform;
}

/* Карточка плейлиста */
.playlist-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);
    position: relative;
    animation: cardAppear 0.4s ease;
    flex-shrink: 0;
}

.playlist-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);
}

.playlist-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);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--accent);
    background: linear-gradient(135deg, #333, #111);
}

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

.playlist-info {
    text-align: center;
    width: 100%;
}

.playlist-name {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
}

.playlist-meta {
    font-size: 11px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.playlist-like-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    z-index: 2;
}

.playlist-like-btn:hover {
    transform: scale(1.1);
    background: var(--accent);
    color: #000;
}

.playlist-like-btn.active {
    background: var(--accent);
    color: #000;
}

/* Пустое состояние */
.empty-state {
    min-width: 200px;
    text-align: center;
    padding: 30px 20px;
    background: rgba(255,255,255,0.02);
    border-radius: 16px;
    border: 1px dashed rgba(255,255,255,0.05);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 14px;
    margin: 0 0 8px 0;
    color: #fff;
}

.empty-state p {
    font-size: 12px;
    margin: 0;
    opacity: 0.7;
}

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

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

/* Задержки для карточек */
.artist-card:nth-child(1),
.playlist-card:nth-child(1) { animation-delay: 0.05s; }

.artist-card:nth-child(2),
.playlist-card:nth-child(2) { animation-delay: 0.1s; }

.artist-card:nth-child(3),
.playlist-card:nth-child(3) { animation-delay: 0.15s; }

.artist-card:nth-child(4),
.playlist-card:nth-child(4) { animation-delay: 0.2s; }

.artist-card:nth-child(5),
.playlist-card:nth-child(5) { animation-delay: 0.25s; }

.artist-card:nth-child(6),
.playlist-card:nth-child(6) { animation-delay: 0.3s; }

.artist-card:nth-child(7),
.playlist-card:nth-child(7) { animation-delay: 0.35s; }

.artist-card:nth-child(8),
.playlist-card:nth-child(8) { animation-delay: 0.4s; }

.artist-card:nth-child(9),
.playlist-card:nth-child(9) { animation-delay: 0.45s; }

.artist-card:nth-child(10),
.playlist-card:nth-child(10) { animation-delay: 0.5s; }

/* Адаптив */
@media (max-width: 1024px) {
    .hero-mix h1 {
        font-size: 42px;
    }
}

@media (max-width: 768px) {
    .home-page {
        padding: 10px 0 30px;
    }

    .hero-mix {
        height: 140px;
        margin-bottom: 30px;
    }

    .hero-mix h1 {
        font-size: 28px;
        letter-spacing: 2px;
    }

    .section-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .section-title {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .title-icon {
        font-size: 20px;
    }

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

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

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

    .artist-name {
        font-size: 12px;
    }

    .artist-stats {
        font-size: 10px;
    }

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

    .playlist-cover {
        width: 100px;
        height: 100px;
        font-size: 40px;
    }

    .playlist-name {
        font-size: 12px;
    }

    .playlist-meta {
        font-size: 10px;
    }

    .empty-table {
        padding: 30px 15px !important;
    }

    .empty-table .empty-icon {
        font-size: 40px;
    }

    .empty-table h3 {
        font-size: 14px;
    }

    .empty-table p {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .hero-mix {
        height: 120px;
    }

    .hero-mix h1 {
        font-size: 24px;
    }

    .artist-card {
        min-width: 100px;
        width: 100px;
        padding: 10px 6px;
    }

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

    .artist-name {
        font-size: 11px;
    }

    .artist-stats {
        font-size: 9px;
        flex-direction: column;
        gap: 2px;
    }

    .playlist-card {
        min-width: 120px;
        width: 120px;
        padding: 10px;
    }

    .playlist-cover {
        width: 90px;
        height: 90px;
        font-size: 36px;
    }

    .playlist-name {
        font-size: 11px;
    }

    .playlist-meta {
        font-size: 9px;
    }

    .home-table td {
        padding: 6px 8px;
        font-size: 11px;
    }

    .home-table .track-plays,
    .home-table .track-duration {
        display: none;
    }
}

/* Темная тема */
@media (prefers-color-scheme: dark) {
    .artist-card,
    .playlist-card {
        background: rgba(30,30,30,0.3);
    }

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

    .home-table tr.active {
        background: rgba(255,215,0,0.12);
    }
}
/* Умный микс */
.smart-mix-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 0 0 36px;
    padding: 24px 28px;
    border-radius: 22px;
    background:
        radial-gradient(circle at 10% 20%, rgba(255, 215, 0, 0.18), transparent 55%),
        linear-gradient(135deg, #1b1b1f, #111114);
    border: 1px solid rgba(255, 215, 0, 0.16);
    cursor: pointer;
    transition: all 0.25s ease;
}

.smart-mix-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 215, 0, 0.38);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.smart-mix-badge {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255, 215, 0, 0.14);
    color: #ffd700;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
}

.smart-mix-info h2 {
    margin: 0;
    font-size: 28px;
    color: #fff;
}

.smart-mix-info p {
    margin: 6px 0 0;
    max-width: 520px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.smart-mix-play {
    flex: 0 0 auto;
    padding: 13px 26px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #111;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 700px) {
    .smart-mix-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 18px;
        margin-bottom: 26px;
    }

    .smart-mix-info h2 {
        font-size: 24px;
    }

    .smart-mix-play {
        width: 100%;
    }
}

/* Заголовки разделов на главной — ссылки на раздел */
.home-page .section-title-link[data-goto-page] {
    cursor: pointer;
    touch-action: manipulation;
    transition: color 0.2s ease;
}

.home-page .section-title-link[data-goto-page]:hover {
    color: var(--accent);
}

/* Имена артистов не должны обрезаться снизу */
.artist-card .artist-info {
    overflow: visible;
    padding: 2px 0 4px;
}

.artist-card .artist-name-wrapper {
    height: auto;
    min-height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.artist-card .artist-name {
    line-height: 1.3;
}

/* На десктопе кнопка микса не должна быть миниатюрной */
@media (min-width: 701px) {
    .smart-mix-play {
        min-width: 190px;
        padding: 17px 38px;
        border-radius: 36px;
        font-size: 16px;
        box-shadow: 0 10px 24px rgba(255, 215, 0, 0.18);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .smart-mix-play:hover {
        transform: translateY(-2px);
        box-shadow: 0 14px 30px rgba(255, 215, 0, 0.28);
    }
}
