/* style.css - Финальная версия с горизонтальным скроллом меню */

body {
    background-color: #121212;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    padding-bottom: 140px;
    -webkit-tap-highlight-color: transparent; /* Убираем синюю подсветку при клике на Android */
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 15px;
}

/* Лого */
.app-logo {
    text-align: center;
    margin-bottom: 15px;
    margin-top: 5px;
}

.app-logo h1 {
    font-size: 28px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
    background: linear-gradient(-45deg, #3a86ff, #ff2d55, #a259ff, #3a86ff);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientFlow 6s ease infinite;
    filter: drop-shadow(0 0 10px rgba(58, 134, 255, 0.3));
}

@keyframes gradientFlow { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.note-anim { display: inline-block; font-size: 20px; background: none; -webkit-text-fill-color: #ff2d55; animation: bounceNote 2s infinite ease-in-out; vertical-align: middle; margin-left: 5px; }
@keyframes bounceNote { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-5px) rotate(10deg); } }

/* Шапка */
.header { margin-bottom: 20px; }
.user-info-row { display: flex; align-items: center; margin-bottom: 15px; height: 30px; }
.user-badge-box { display: flex; align-items: center; gap: 10px; }
#user-badge {
    font-size: 13px; background: #2a2a2a; padding: 0 12px; border-radius: 20px;
    color: #aaa; border: 1px solid #333; display: inline-flex; align-items: center;
    height: 30px; white-space: nowrap;
}
#user-badge.vip-badge {
    background: linear-gradient(45deg, #FFD700, #FFA500) !important; color: #000 !important;
    border: 1px solid #ffcc00 !important; font-weight: 800 !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5) !important;
}
.header-vip-btn {
    background: linear-gradient(45deg, #007AFF, #0056b3); border: none; color: white;
    font-size: 11px; font-weight: 700; padding: 0 12px; height: 30px;
    border-radius: 20px; cursor: pointer; display: inline-flex; align-items: center;
    animation: pulseBtn 2s infinite;
}
@keyframes pulseBtn { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }
.vip-timer {
    font-size: 11px; color: #888; background: #1f1f1f; padding: 0 10px;
    height: 30px; border-radius: 8px; border: 1px solid #333; display: inline-flex; align-items: center;
}
.admin-gear { font-size: 20px; color: #888; cursor: pointer; padding: 5px; margin-left: auto; }
.fa-spin-hover:hover { animation: fa-spin 2s infinite linear; }

/* Поиск */
.search-box { display: flex; background: #2a2a2a; border-radius: 14px; padding: 5px; border: 1px solid #333; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.search-box input { flex: 1; background: transparent; border: none; color: white; padding: 10px; outline: none; font-size: 16px; }
.search-box button { background: #3a3a3c; border: none; color: white; padding: 0 15px; border-radius: 10px; cursor: pointer; }

/* --- НАВИГАЦИЯ (ГОРИЗОНТАЛЬНЫЙ СКРОЛЛ) --- */
.nav-grid {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 5px 0 15px 0; /* Немного отступа снизу для тени */
    margin-top: 15px;
    margin-bottom: 15px;
    
    /* Скрываем полосу прокрутки */
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch; /* Плавность iOS */
}

.nav-grid::-webkit-scrollbar {
    display: none;
}

.nav-card {
    flex: 0 0 auto; /* Запрет сжатия */
    width: 85px;
    height: 80px;
    background: #1f1f1f;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-card i {
    font-size: 24px;
    color: #666;
    transition: color 0.2s;
}

.nav-card span {
    font-size: 11px;
    font-weight: 500;
    color: #888;
}

/* Активное состояние кнопки */
.nav-card.active {
    background: #2a2a2c;
    border: 1px solid #3a86ff;
    box-shadow: 0 4px 12px rgba(58, 134, 255, 0.15);
    transform: scale(1.02);
}

.nav-card.active i {
    color: #3a86ff;
}

.nav-card.active span {
    color: white;
}

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

/* --- ТРЕКИ (ФИНАЛЬНЫЙ ВИД) --- */
.track-item {
    display: flex; align-items: center; background: #1e1e1e; margin-bottom: 8px;
    padding: 8px 12px; border-radius: 14px; position: relative; overflow: hidden;
}
.track-item.playing { border: 1px solid #3a86ff; background: #252525; }
.play-btn-left {
    background: #2c2c2e; border: none; color: white; width: 42px; height: 42px;
    border-radius: 50%; margin-right: 12px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0; font-size: 14px;
}
.rank-badge { font-weight: 800; font-size: 16px; width: 25px; text-align: center; color: #555; margin-right: 15px; flex-shrink: 0; }
.rank-1 { color: #FFD700 !important; text-shadow: 0 0 10px rgba(255, 215, 0, 0.2); } 
.rank-2 { color: #C0C0C0 !important; } .rank-3 { color: #CD7F32 !important; }

.track-info { flex: 1; overflow: hidden; margin-right: 10px; }

/* Троеточие вместо бегущей строки (Чистый дизайн) */
.track-title-box {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 15px;
    font-weight: 500;
}

.track-dur { font-size: 12px; color: #888; margin-top: 3px; }

/* Кнопки справа (Компактные) */
.track-actions { display: flex; align-items: center; gap: 0; margin-left: auto; }
.action-btn {
    background: transparent; border: none; color: #666; width: 25px; height: 32px; padding: 0;
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
    font-size: 15px; cursor: pointer; transition: color 0.2s;
}
.action-btn:active { background: #333; color: white; }
.action-btn.active { color: #ff2d55; }

/* Плеер */
.player-bar {
    position: fixed; bottom: 15px; left: 10px; right: 10px;
    background: rgba(35, 35, 35, 0.98); backdrop-filter: blur(15px);
    border-radius: 20px; padding: 15px; border: 1px solid #333;
    z-index: 1000; display: flex; flex-direction: column; gap: 10px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.8);
}
.player-bar.hidden { display: none; }
.player-top { display: flex; justify-content: space-between; align-items: center; }
.player-info { flex: 1; overflow: hidden; margin-right: 15px; }
#currentTrackTitle { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-controls button { background: transparent; border: none; color: white; font-size: 18px; padding: 5px; width: 40px; }
.main-play { font-size: 24px !important; color: #3a86ff !important; }
.player-progress-box { display: flex; align-items: center; gap: 10px; font-size: 11px; color: #888; }
#progressBar { flex: 1; height: 4px; background: #444; border-radius: 2px; -webkit-appearance: none; }
#progressBar::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; background: #3a86ff; border-radius: 50%; }

/* Модальные окна и прочее */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); display: none; align-items: center; justify-content: center; z-index: 2000; backdrop-filter: blur(5px); }
.modal-content { background: #151517; width: 90%; max-width: 360px; padding: 20px; border-radius: 24px; border: 1px solid #333; box-shadow: 0 20px 50px rgba(0,0,0,0.8); }
.modal-header { display: flex; justify-content: space-between; margin-bottom: 15px; }
.close-btn { background: none; border: none; color: #888; font-size: 20px; }
.tariff-card { background: #252527; padding: 16px; border-radius: 16px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; cursor: pointer; position: relative; border: 1px solid #333; transition: transform 0.1s; }
.tariff-card:active { transform: scale(0.98); }
.tier-6 { border: 1px solid #FFD700; background: rgba(255, 215, 0, 0.05); }
.tier-12 { border: 1px solid #bf5af2; background: rgba(191, 90, 242, 0.05); }
.badge-off { position: absolute; top: -8px; right: 10px; font-size: 10px; padding: 3px 8px; border-radius: 10px; font-weight: 800; text-transform: uppercase; }
.badge-10 { background: #FFD700; color: black; } .badge-15 { background: #bf5af2; color: white; }
.t-info { display: flex; flex-direction: column; } .t-name { font-weight: 700; font-size: 15px; color: white; } .t-sub { font-size: 11px; color: #888; margin-top: 2px; } .t-price { font-weight: 800; font-size: 16px; color: #fff; }
.gift-input { flex: 1; background: #2c2c2e; border: 1px solid #333; color: white; padding: 10px; border-radius: 10px; }
.gift-btn { background: #3a86ff; color: white; border: none; padding: 0 15px; border-radius: 10px; margin-left: 5px; font-weight: bold; }
.setting-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.setting-label { font-size: 14px; font-weight: 500; }
.setting-divider { font-size: 12px; font-weight: bold; color: #666; text-transform: uppercase; margin: 20px 0 10px 0; border-bottom: 1px solid #333; padding-bottom: 5px; }
.setting-input { background: #2c2c2e; border: 1px solid #444; color: white; padding: 8px; border-radius: 8px; width: 60px; text-align: center; }
.save-btn { width: 100%; background: #4cd964; color: black; border: none; padding: 12px; border-radius: 12px; font-weight: bold; font-size: 16px; margin-top: 10px; cursor: pointer; }
.switch { position: relative; display: inline-block; width: 50px; height: 28px; } .switch input { opacity: 0; width: 0; height: 0; } .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #3a3a3c; transition: .4s; border-radius: 34px; } .slider:before { position: absolute; content: ""; height: 24px; width: 24px; left: 2px; bottom: 2px; background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.3); } input:checked + .slider { background-color: #30d158; } input:checked + .slider:before { transform: translateX(22px); }
.loading { text-align: center; padding: 20px; color: #666; }

/* Ручка для перетаскивания */
.drag-handle {
    color: #555;
    padding: 10px;
    margin-right: 5px;
    cursor: grab;
    font-size: 16px;
    touch-action: none; /* Важно для телефонов, чтобы браузер не скроллил страницу */
}

.drag-handle:active {
    color: #3a86ff;
    cursor: grabbing;
}

/* Подсветка элемента, который ты сейчас тащишь */
.sortable-ghost {
    opacity: 0.5;
    background: #2c2c2e;
    border: 1px dashed #555;
}

.track-item {
    /* Запрещаем выделение текста, чтобы не мешало перетаскиванию */
    -webkit-user-select: none;
    user-select: none;
    
    /* Убираем стандартное поведение браузера при долгом тапе */
    -webkit-touch-callout: none; 
}

/* Когда элемент перетаскивают, делаем его полупрозрачным и чуть увеличиваем */
.sortable-ghost {
    opacity: 0.6;
    transform: scale(1.02);
    background: #2c2c2e;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}