/* Сброс и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* Telegram UI цвета - светлая тема */
    --tg-theme-bg-color: #ffffff;
    --tg-theme-secondary-bg-color: #f4f4f5;
    --tg-theme-text-color: #000000;
    --tg-theme-hint-color: #999999;
    --tg-theme-link-color: #2481cc;
    --tg-theme-button-color: #2481cc;
    --tg-theme-button-text-color: #ffffff;
    --tg-theme-section-bg-color: #ffffff;
    --tg-theme-section-header-text-color: #6d6d72;
    --tg-theme-subtitle-text-color: #999999;
    --tg-theme-destructive-text-color: #ff3b30;
    
    /* Основные цвета */
    --primary: var(--tg-theme-button-color);
    --background: var(--tg-theme-secondary-bg-color);
    --surface: var(--tg-theme-section-bg-color);
    --text-primary: var(--tg-theme-text-color);
    --text-secondary: var(--tg-theme-hint-color);
    --border: #c8c7cc;
    --separator: rgba(0, 0, 0, 0.1);
    
    /* Размеры Telegram */
    --bottom-nav-height: 50px;
    --header-height: 56px;
    --cell-height: 44px;
}

/* Темная тема - Telegram Dark */
@media (prefers-color-scheme: dark) {
    :root {
        --tg-theme-bg-color: #18222d;
        --tg-theme-secondary-bg-color: #131415;
        --tg-theme-text-color: #ffffff;
        --tg-theme-hint-color: #7d8b99;
        --tg-theme-link-color: #5eb3f5;
        --tg-theme-button-color: #5eb3f5;
        --tg-theme-button-text-color: #ffffff;
        --tg-theme-section-bg-color: #1d2733;
        --tg-theme-section-header-text-color: #7d8b99;
        --tg-theme-subtitle-text-color: #7d8b99;
        --tg-theme-destructive-text-color: #ff595a;
        
        --primary: var(--tg-theme-button-color);
        --background: var(--tg-theme-secondary-bg-color);
        --surface: var(--tg-theme-section-bg-color);
        --text-primary: var(--tg-theme-text-color);
        --text-secondary: var(--tg-theme-hint-color);
        --border: #2b3642;
        --separator: rgba(255, 255, 255, 0.1);
    }
}

body.dark-theme {
    --tg-theme-bg-color: #18222d;
    --tg-theme-secondary-bg-color: #131415;
    --tg-theme-text-color: #ffffff;
    --tg-theme-hint-color: #7d8b99;
    --tg-theme-link-color: #5eb3f5;
    --tg-theme-button-color: #5eb3f5;
    --tg-theme-button-text-color: #ffffff;
    --tg-theme-section-bg-color: #1d2733;
    --tg-theme-section-header-text-color: #7d8b99;
    --tg-theme-subtitle-text-color: #7d8b99;
    --tg-theme-destructive-text-color: #ff595a;
    
    --primary: var(--tg-theme-button-color);
    --background: var(--tg-theme-secondary-bg-color);
    --surface: var(--tg-theme-section-bg-color);
    --text-primary: var(--tg-theme-text-color);
    --text-secondary: var(--tg-theme-hint-color);
    --border: #2b3642;
    --separator: rgba(255, 255, 255, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    overflow-x: hidden;
    padding-bottom: var(--bottom-nav-height);
}

/* Page Header в стиле Telegram */
.page-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--background);
    padding: 16px 16px 12px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 0.5px solid var(--separator);
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    line-height: 34px;
}



/* Контейнер */
.container {
    padding: 0;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + 16px);
    min-height: 100vh;
}

/* Дополнительный отступ для Telegram WebApp */
body.telegram-webapp .container {
    padding-top: env(safe-area-inset-top, 0px);
}

body.telegram-webapp .page-header {
    top: env(safe-area-inset-top, 0px);
}

/* Нижняя навигация в стиле Telegram */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    background: var(--surface);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    border-top: 0.5px solid var(--separator);
    z-index: 99;
    padding-top: 4px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -1px 0 var(--separator);
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.15s;
    font-size: 10px;
    min-height: 46px;
    -webkit-tap-highlight-color: transparent;
}

.nav-icon {
    font-size: 26px;
    line-height: 1;
    margin-bottom: 2px;
}

.nav-label {
    font-size: 10px;
    font-weight: 500;
    line-height: 12px;
    white-space: nowrap;
}

.nav-btn.active {
    color: var(--primary);
}

.nav-btn:active {
    opacity: 0.5;
    transition: opacity 0.1s;
}

/* Вкладки */
.tab-content {
    display: none;
    padding: 16px;
}

.tab-content.active {
    display: block;
}

/* Заголовки секций */
.section-header {
    padding: 8px 0 12px;
    margin-bottom: 12px;
}

.section-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.section-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 18px;
}

.section-header-small {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    margin-bottom: 12px;
}

.section-header-small h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    margin: 0;
    letter-spacing: -0.2px;
}

.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: var(--surface);
    color: var(--primary);
    border-radius: 12px;
    font-size: 1.3em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.back-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.back-btn:hover {
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(-2px);
}

.back-btn:hover::before {
    opacity: 1;
}

.back-btn span {
    position: relative;
    z-index: 1;
}

.back-btn:active {
    transform: scale(0.95) translateX(-2px);
}

.search-section {
    margin-bottom: 16px;
}

.search-section.hidden {
    display: none;
}

/* Баннер */
.banner-container {
    margin-bottom: 16px;
}

.banner {
    position: relative;
    background: linear-gradient(135deg, var(--primary) 0%, #4ea4f6 100%);
    border-radius: 12px;
    overflow: hidden;
    min-height: 140px;
    display: flex;
    align-items: center;
}

.banner-content {
    position: relative;
    z-index: 2;
    padding: 24px;
    color: white;
    flex: 1;
}

.banner-title {
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 8px;
}

.banner-text {
    font-size: 1em;
    opacity: 0.9;
}

.banner-image {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 50%;
    object-fit: cover;
    opacity: 0.3;
    z-index: 1;
}

/* Жанры музыки */
.genres-section {
    margin: 16px 0;
}

.genres-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.genre-tag {
    background: var(--surface);
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.genre-tag:active {
    background: var(--background);
}

/* Секция недавних */
.recent-section {
    margin-top: 24px;
}

/* Поиск */
.search-container {
    margin-bottom: 20px;
}

.search-box {
    display: flex;
    gap: 8px;
    background: var(--surface);
    border-radius: 10px;
    padding: 8px 12px;
    align-items: center;
}

#search-input {
    flex: 1;
    padding: 0;
    border: none;
    font-size: 17px;
    background: transparent;
    color: var(--text-primary);
    line-height: 22px;
}

#search-input:focus {
    outline: none;
}

#search-input::placeholder {
    color: var(--text-secondary);
}

.search-btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-btn-icon:active {
    opacity: 0.6;
}

/* Результаты поиска (артисты) */
.results {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.artist-card {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: none;
    position: relative;
    overflow: hidden;
}

.artist-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.artist-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.artist-card:hover::after {
    opacity: 0.08;
}

.artist-card:active {
    transform: translateY(-2px) scale(0.98);
}

.artist-cover {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.artist-name {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Список треков в стиле Telegram */
.tracks-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
}

.track-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--surface);
    border-bottom: 0.5px solid var(--separator);
    transition: background-color 0.2s;
    min-height: 60px;
}

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

.track-item:active {
    background: var(--background);
}

.track-position {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--primary);
    min-width: 32px;
    text-align: center;
}

.track-cover {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.track-info {
    flex: 1;
    min-width: 0;
}

.track-title {
    font-weight: 600;
    font-size: 0.95em;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.track-artist {
    color: var(--text-secondary);
    font-size: 0.85em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-stats {
    display: none;
}

.track-actions {
    display: flex;
    gap: 6px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-btn:active {
    opacity: 0.6;
}

/* Telegram UI стиль */
.btn-play {
    background: var(--primary);
    color: white;
}

.btn-download {
    background: var(--primary);
    color: white;
    position: relative;
}

/* Анимация загрузки для кнопки скачивания */
.btn-download.loading {
    pointer-events: none;
}

.btn-download.loading::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--primary);
    border-right-color: var(--primary);
    animation: downloadSpin 0.8s linear infinite;
}

.btn-download.loading .action-icon {
    opacity: 0.3;
}

@keyframes downloadSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.btn-like {
    background: var(--background);
    color: var(--text-secondary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-like:hover {
    background: var(--border);
}

.btn-like.liked {
    background: var(--danger);
    color: white;
    box-shadow: 0 1px 3px rgba(255, 107, 107, 0.3);
}

.btn-like.liked:hover {
    background: #ff5252;
}

/* Темная тема - дополнительные стили для кнопок */
@media (prefers-color-scheme: dark) {
    .btn-play {
        box-shadow: 0 1px 3px rgba(92, 168, 232, 0.4);
    }
    
    .btn-download {
        box-shadow: 0 1px 3px rgba(123, 184, 240, 0.4);
    }
    
    .btn-like {
        box-shadow: 0 1px 3px rgba(255, 255, 255, 0.05);
    }
    
    .btn-like.liked {
        box-shadow: 0 1px 3px rgba(255, 107, 107, 0.4);
    }
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    padding: 16px;
}

.btn-nav {
    width: 48px;
    height: 48px;
    border: none;
    background: var(--surface);
    color: var(--primary);
    border-radius: 50%;
    font-size: 1.3em;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-nav:active {
    transform: scale(0.95);
}

.btn-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-info {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 40px;
    text-align: center;
}

/* Статистика */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-card {
    background: var(--surface);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: none;
    border: 1px solid var(--border);
}

.stat-icon {
    font-size: 2em;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2em;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.85em;
    color: var(--text-secondary);
}

/* Мобильный плеер (компактный) */
.mobile-player {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 0.5px solid var(--separator);
    z-index: 98;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.mobile-player.hidden {
    display: none;
}

.player-track-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
}

.player-cover {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

.player-details {
    flex: 1;
    min-width: 0;
}

.player-title {
    font-weight: 600;
    font-size: 0.9em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.player-artist {
    color: var(--text-secondary);
    font-size: 0.8em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s;
}

.player-artist:hover {
    color: var(--primary);
    text-decoration: underline;
}

.player-play-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-play-btn:active {
    transform: scale(0.95);
}

.player-progress-bar {
    padding: 0 16px 8px;
}

.player-progress-bar input[type="range"] {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background: var(--border);
}

.player-progress-bar input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

.player-progress-bar input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
}

/* Полноэкранный плеер */
.fullscreen-player {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

/* Темная тема для плеера */
@media (prefers-color-scheme: dark) {
    .fullscreen-player {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    }
    
    .fullscreen-player::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
        opacity: 0.15;
        z-index: 0;
    }
    
    .fullscreen-header,
    .fullscreen-content {
        position: relative;
        z-index: 1;
    }
}

.fullscreen-player.active {
    transform: translateY(0);
}

.fullscreen-player.hidden {
    display: flex;
}

.fullscreen-header {
    padding: 16px;
    padding-top: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: grab;
}

.fullscreen-header:active {
    cursor: grabbing;
}

/* Индикатор свайпа */
.fullscreen-header::before {
    content: '';
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin-bottom: 12px;
}

.close-btn {
    position: absolute;
    left: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-title {
    color: white;
    font-weight: 600;
    font-size: 0.9em;
    opacity: 0.9;
}

.fullscreen-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    color: white;
}

/* Ambient фон */
.ambient-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 0;
}

.ambient-blur {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    background-size: cover;
    background-position: center;
    filter: blur(80px) brightness(0.6);
    opacity: 0.5;
    animation: ambientPulse 4s ease-in-out infinite;
}

@keyframes ambientPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.7;
    }
}

/* Контейнер обложки */
.cover-container {
    position: relative;
    z-index: 1;
    margin-bottom: 32px;
}

.cover-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    height: 320px;
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    filter: blur(50px) brightness(1.2);
    opacity: 0.9;
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0.7;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 1;
    }
}

.fullscreen-cover {
    position: relative;
    width: 280px;
    height: 280px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.fullscreen-info {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-bottom: 32px;
    width: 100%;
}

.fullscreen-track-title {
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 8px;
}

.fullscreen-track-artist {
    font-size: 1.1em;
    opacity: 0.8;
    cursor: pointer;
    transition: opacity 0.2s;
}

.fullscreen-track-artist:hover {
    opacity: 1;
    text-decoration: underline;
}

.fullscreen-progress {
    position: relative;
    z-index: 2;
    width: 100%;
    margin-bottom: 32px;
}

.time-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85em;
    opacity: 0.8;
}

.fullscreen-progress input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.3);
}

.fullscreen-progress input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.fullscreen-progress input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Дополнительные действия в плеере */
.fullscreen-actions {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.action-btn-player {
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-radius: 50%;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.action-btn-player:active {
    transform: scale(0.92);
}

.action-btn-player:hover {
    background: rgba(255, 255, 255, 0.25);
}

.action-btn-player.active {
    background: var(--primary);
    box-shadow: 0 2px 8px rgba(51, 144, 236, 0.4);
}

/* Анимация загрузки для кнопки в плеере */
.action-btn-player.loading {
    pointer-events: none;
}

.action-btn-player.loading::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: white;
    border-right-color: white;
    animation: downloadSpin 0.8s linear infinite;
}

.action-btn-player.loading .action-icon {
    opacity: 0.3;
}

.action-btn-player .action-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

.fullscreen-controls {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.control-btn {
    width: 56px;
    height: 56px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    font-size: 1.3em;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn-large {
    width: 72px;
    height: 72px;
    border: none;
    background: white;
    color: var(--primary);
    border-radius: 50%;
    font-size: 1.8em;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn-large:active {
    transform: scale(0.95);
}

/* Иконки управления */
.control-icon {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

.control-icon-large {
    width: 32px;
    height: 32px;
}

.player-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

.close-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

/* Иконки действий с треками - Telegram UI */
.action-icon {
    width: 16px;
    height: 16px;
    transition: all 0.15s ease;
}

.btn-play .action-icon {
    filter: brightness(0) invert(1);
}

.btn-download .action-icon {
    filter: brightness(0) invert(1);
}

.btn-like .action-icon {
    filter: brightness(0.5);
    opacity: 0.6;
}

.btn-like.liked .action-icon {
    filter: brightness(0) invert(1);
    opacity: 1;
}

/* Анимация при наведении */
.action-btn:hover .action-icon {
    transform: scale(1.1);
}

/* Загрузка */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 1em;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Загрузка при прокрутке */
.loading-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    color: var(--text-secondary);
}

.loading-more.hidden {
    display: none;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 4em;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1em;
}

/* Адаптация для маленьких телефонов (до 375px) */
@media (max-width: 375px) {
    
    .tab-content {
        padding: 12px;
    }
    
    .results {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .artist-card {
        padding: 12px;
    }
    
    .track-item {
        padding: 10px;
        gap: 10px;
    }
    
    .back-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1em;
    }
    
    .track-cover {
        width: 48px;
        height: 48px;
    }
    
    .track-title {
        font-size: 0.9em;
    }
    
    .track-artist {
        font-size: 0.8em;
    }
    
    .action-btn {
        width: 32px;
        height: 32px;
    }
    
    .fullscreen-cover {
        width: 240px;
        height: 240px;
    }
    
    .cover-glow {
        width: 280px;
        height: 280px;
    }
    
    .fullscreen-track-title {
        font-size: 1.3em;
    }
    
    .fullscreen-track-artist {
        font-size: 1em;
    }
    
    .control-btn {
        width: 48px;
        height: 48px;
    }
    
    .control-btn-large {
        width: 64px;
        height: 64px;
    }
    
    .action-btn-player {
        width: 44px;
        height: 44px;
    }
}

/* Адаптация для средних телефонов (376px - 414px) */
@media (min-width: 376px) and (max-width: 414px) {
    .fullscreen-cover {
        width: 260px;
        height: 260px;
    }
    
    .cover-glow {
        width: 300px;
        height: 300px;
    }
}

/* Адаптация для больших телефонов (415px - 767px) */
@media (min-width: 415px) and (max-width: 767px) {
    .results {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .fullscreen-cover {
        width: 300px;
        height: 300px;
    }
    
    .cover-glow {
        width: 340px;
        height: 340px;
    }
}

/* Адаптация для планшетов (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        max-width: 768px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .results {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .track-item {
        padding: 14px;
    }
    
    .fullscreen-cover {
        width: 350px;
        height: 350px;
    }
    
    .cover-glow {
        width: 400px;
        height: 400px;
    }
    
    .ambient-blur {
        width: 500px;
        height: 500px;
    }
    
    .control-btn {
        width: 60px;
        height: 60px;
    }
    
    .control-btn-large {
        width: 80px;
        height: 80px;
    }
    
    .action-btn-player {
        width: 52px;
        height: 52px;
    }
    
    .fullscreen-track-title {
        font-size: 1.8em;
    }
    
    .fullscreen-track-artist {
        font-size: 1.3em;
    }
}

/* Адаптация для десктопа */
@media (min-width: 1024px) {
    body {
        padding-bottom: 0;
    }
    
    .container {
        max-width: 1200px;
        margin-top: 0;
        min-height: auto;
    }
    
    .bottom-nav {
        position: relative;
        height: auto;
        border-top: none;
        border-bottom: 2px solid var(--border);
        box-shadow: none;
    }
    
    .nav-btn {
        flex-direction: row;
        gap: 8px;
        padding: 16px 24px;
    }
    
    .nav-icon {
        font-size: 1.2em;
    }
    
    .nav-label {
        font-size: 1em;
    }
    
    .tab-content {
        padding: 32px;
        padding-bottom: 32px;
    }
    
    .results {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .mobile-player {
        bottom: 0;
    }
    
    .ambient-blur {
        width: 600px;
        height: 600px;
    }
    
    .cover-glow {
        width: 500px;
        height: 500px;
        filter: blur(60px) brightness(1.3);
    }
    
    .fullscreen-cover {
        width: 400px;
        height: 400px;
    }
}

/* Анимации */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Скрытие скроллбара но сохранение функциональности */
::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

/* Плавная прокрутка */
html {
    scroll-behavior: smooth;
}

/* Модальное окно */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

/* Темная тема для модальных окон */
@media (prefers-color-scheme: dark) {
    .modal {
        background: rgba(0, 0, 0, 0.85);
    }
}

.modal-content {
    background: var(--surface);
    border-radius: 20px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--text-primary);
}

.close-modal-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--background);
    color: var(--text-secondary);
    border-radius: 50%;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.2s;
}

.close-modal-btn:hover {
    background: var(--border);
}

.modal-body {
    padding: 24px;
}

.modal-description {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 0.95em;
}

#telegram-id-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1em;
    margin-bottom: 12px;
    transition: border-color 0.3s;
}

#telegram-id-input:focus {
    outline: none;
    border-color: var(--primary);
}

.modal-hint {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.modal-hint a {
    color: var(--primary);
    text-decoration: none;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.btn-primary-modal {
    flex: 1;
    padding: 14px;
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-radius: 12px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary-modal:active {
    transform: scale(0.98);
}

.btn-secondary-modal {
    flex: 1;
    padding: 14px;
    border: 2px solid var(--border);
    background: transparent;
    color: var(--text-primary);
    border-radius: 12px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary-modal:active {
    transform: scale(0.98);
}

/* Адаптация для очень больших экранов (1440px+) */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }
    
    .results {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .fullscreen-cover {
        width: 450px;
        height: 450px;
    }
    
    .cover-glow {
        width: 550px;
        height: 550px;
    }
    
    .ambient-blur {
        width: 700px;
        height: 700px;
    }
}

/* Адаптация для ландшафтной ориентации на телефонах */
@media (max-height: 500px) and (orientation: landscape) {
    .bottom-nav {
        height: 56px;
    }
    
    .nav-btn {
        padding: 6px;
        font-size: 0.7em;
    }
    
    .nav-icon {
        font-size: 1.2em;
    }
    
    .tab-content {
        padding: 8px;
    }
    
    .fullscreen-cover {
        width: 200px;
        height: 200px;
    }
    
    .cover-glow {
        width: 240px;
        height: 240px;
    }
    
    .fullscreen-track-title {
        font-size: 1.2em;
    }
    
    .fullscreen-track-artist {
        font-size: 0.9em;
    }
    
    .control-btn {
        width: 44px;
        height: 44px;
    }
    
    .control-btn-large {
        width: 56px;
        height: 56px;
    }
}

/* Аудиокниги */
.books-genres {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.genre-category {
    background: var(--surface);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.genre-category-title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.genre-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.genre-btn {
    padding: 14px 16px;
    border: none;
    background: var(--background);
    color: var(--text-primary);
    border-radius: 12px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.genre-btn:active {
    transform: scale(0.98);
    background: var(--primary);
    color: white;
}

.genre-btn:hover {
    background: var(--primary);
    color: white;
}

/* Адаптация жанров для планшетов */
@media (min-width: 768px) {
    .genre-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Адаптация жанров для десктопа */
@media (min-width: 1024px) {
    .genre-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
