/* === GROOVE VIBES MIX - RESPONSIVE STYLES === */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;600;700&family=Roboto:wght@300;400;700&display=swap');

:root {
    --bg-dark: #050505;
    --bg-panel: #0f1016;
    --primary-neon: #00f3ff;
    --secondary-neon: #bc13fe;
    --text-main: #ffffff;
    --text-dim: #a0a0a0;
    --glass: rgba(255, 255, 255, 0.05);
    --input-bg: #1a1a24;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Roboto', sans-serif;
    height: 100vh;
    overflow: hidden; /* Предотвращаем скролл всей страницы, скроллим только контент */
    background: radial-gradient(circle at top right, #1a0b2e 0%, #000000 60%);
}

/* === LAYOUT (DESKTOP DEFAULT) === */
.app-container {
    display: grid;
    grid-template-columns: 240px 1fr;
    grid-template-rows: 1fr 90px;
    height: 100vh;
    width: 100%;
}

.mobile-header { display: none; } /* Скрыто на ПК */

/* === SIDEBAR === */
.sidebar {
    background: var(--bg-panel);
    border-right: 1px solid rgba(255,255,255,0.05);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.logo, .logo-mobile {
    font-family: 'Rajdhani', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 30px;
    text-shadow: 0 0 10px var(--secondary-neon);
    cursor: pointer;
}

.styled-select {
    padding: 8px; background: #000; color: #fff; border: 1px solid #333; 
    width: 100%; margin-bottom: 20px; border-radius: 4px;
}

.nav-links { padding: 0; }
.nav-links li {
    list-style: none; margin-bottom: 20px; font-size: 16px; color: var(--text-dim);
    cursor: pointer; transition: 0.3s; display: flex; align-items: center;
}
.nav-links li:hover, .nav-links li.active {
    color: var(--primary-neon); text-shadow: 0 0 8px var(--primary-neon);
}
.nav-links li i { margin-right: 10px; width: 20px; text-align: center; }

/* Ссылка на плейлист в сайдбаре */
#playlist-nav-list li {
    padding-left: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Small buttons for Sidebar */
.btn-neon-small {
    background: var(--primary-neon); color: #000; border: none; padding: 5px 15px;
    border-radius: 20px; font-weight: bold; cursor: pointer; width: 45%;
}
.btn-outline-small {
    background: transparent; color: var(--text-main); border: 1px solid #555;
    padding: 5px 15px; border-radius: 20px; cursor: pointer; width: 45%;
}
.btn-outline-small:hover { border-color: var(--primary-neon); color: var(--primary-neon); }

/* === MAIN CONTENT === */
.main-content {
    padding: 30px;
    overflow-y: auto; /* Скроллим только эту часть */
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.8) 100%);
    position: relative;
    padding-bottom: 100px; /* Чтобы контент не прятался за плеером */
}

h2 { font-family: 'Rajdhani', sans-serif; margin-bottom: 20px; font-size: 28px; }

/* Views */
.view-section { display: none; }
.view-section.active-view { display: block; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* Search */
.search-container { margin-bottom: 20px; position: relative; max-width: 500px; }
.search-input {
    width: 100%; padding: 12px 20px 12px 45px; border-radius: 30px; border: 1px solid #333;
    background: var(--bg-panel); color: #fff; font-size: 16px; outline: none;
}
.search-icon-inside { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #666; }

/* === GENRE FILTER BUTTONS === */
.genre-scroll-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-neon) #111;
}
.genre-scroll-container::-webkit-scrollbar { height: 6px; }
.genre-scroll-container::-webkit-scrollbar-thumb { background: var(--primary-neon); border-radius: 3px; }

.filter-btn {
    background: var(--bg-panel); border: 1px solid #333; color: #aaa; padding: 8px 16px;
    border-radius: 20px; white-space: nowrap; cursor: pointer; font-size: 14px; transition: 0.3s;
}
.filter-btn:hover { border-color: var(--primary-neon); color: #fff; }
.filter-btn.active-filter {
    background: var(--primary-neon); color: #000; font-weight: bold;
    border-color: var(--primary-neon); box-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
}

/* === CARDS GRID === */
.tracks-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px;
}
.track-card {
    background: var(--glass); padding: 10px; border-radius: 10px; cursor: pointer; border: 1px solid transparent;
    position: relative !important; /* Держит кнопки внутри */
    overflow: hidden; display: flex; flex-direction: column; transition: 0.3s;
}
.track-card:hover { border-color: var(--secondary-neon); background: rgba(255,255,255,0.1); }
.track-img { width: 100%; aspect-ratio: 1/1; border-radius: 5px; margin-bottom: 8px; object-fit: cover; }
.track-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-artist { font-size: 12px; color: var(--text-dim); }

/* Active Track Style */
.active-track {
    border-color: var(--primary-neon) !important;
    background: rgba(0, 243, 255, 0.1) !important;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}
.active-track .track-title::before {
    content: '▶ '; color: var(--primary-neon); animation: blink 1s infinite;
}
@keyframes blink { 50% { opacity: 0.5; } }

/* === CARD BUTTONS (Like, Playlist, Share) === */
.like-btn, .add-playlist-btn, .share-btn {
    position: absolute; right: 15px; width: 35px; height: 35px;
    background: rgba(0, 0, 0, 0.6); border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; z-index: 100 !important; color: #fff;
    transition: all 0.2s ease; backdrop-filter: blur(4px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
.like-btn { top: 15px; }
.add-playlist-btn { top: 55px; }
.share-btn { top: 95px; }

.like-btn:hover { background: #fff; color: #ff0055; transform: scale(1.1); }
.add-playlist-btn:hover { background: #fff; color: var(--primary-neon); transform: scale(1.1); }
.share-btn:hover { background: #fff; color: var(--secondary-neon); transform: scale(1.1); }

.liked { color: #ff0055 !important; background: rgba(255, 255, 255, 0.9); text-shadow: 0 0 10px #ff0055; }
.like-btn:active { transform: scale(0.9); }

/* === PLAYER BAR & VISUALIZER FIX === */
.player-bar {
    grid-column: 1 / -1;
    background: #111;
    border-top: 1px solid var(--secondary-neon);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 50;
    position: relative; /* Важно для позиционирования визуализатора */
    overflow: hidden; /* Чтобы визуализатор не вылезал */
    height: 90px; /* Фикс высоты */
}

/* Визуализатор (ФОН) */
#visualizer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1; /* Самый нижний слой */
    pointer-events: none; opacity: 0.6; display: block;
}

/* Элементы управления (ПОВЕРХ фона) */
.player-info, .player-controls, .player-extra {
    position: relative; z-index: 10; background: transparent;
}

.player-info { display: flex; align-items: center; width: 30%; }
.player-info img { width: 50px; height: 50px; border-radius: 4px; margin-right: 10px; object-fit: cover; z-index: 11; }
.player-text h4 { font-size: 14px; margin-bottom: 2px; }
.player-text p { font-size: 12px; color: #888; }

.player-controls { display: flex; align-items: center; gap: 20px; font-size: 24px; flex-grow: 1; justify-content: center; }
.player-controls i { cursor: pointer; color: #888; transition: 0.3s; }
.player-controls i:hover { color: #fff; }
#play-btn { font-size: 40px; color: var(--primary-neon); }
.control-active { color: var(--primary-neon) !important; text-shadow: 0 0 10px var(--primary-neon); }

.player-extra { width: 20%; display: flex; justify-content: flex-end; }
.mobile-progress-container { position: absolute; top: -5px; left: 0; width: 100%; height: 5px; z-index: 20; }
#progress-bar { width: 100%; height: 4px; cursor: pointer; }

/* Repeat Badge */
.repeat-container { position: relative; display: flex; align-items: center; justify-content: center; }
#repeat-one-badge {
    position: absolute; top: 6px; right: -4px; font-size: 8px; font-weight: bold;
    color: #000; background: var(--primary-neon); border-radius: 50%;
    width: 12px; height: 12px; display: flex; justify-content: center; align-items: center; pointer-events: none;
}

/* Animations */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spin-animation { animation: spin 3s linear infinite; }

/* === AUTH & MODALS === */
.auth-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); backdrop-filter: blur(5px);
    z-index: 2000; display: flex; justify-content: center; align-items: center;
}
.auth-box {
    background: var(--bg-panel); padding: 30px; border-radius: 10px;
    border: 1px solid var(--primary-neon); width: 90%; max-width: 350px;
    text-align: center; box-shadow: 0 0 20px rgba(0,243,255,0.2);
}
.auth-box h2 { margin-bottom: 20px; }
.auth-box input { margin-bottom: 15px; }
.auth-link { margin-top: 15px; font-size: 14px; color: #888; }
.auth-link span { color: var(--primary-neon); cursor: pointer; text-decoration: underline; }
.auth-close { margin-top: 10px; font-size: 12px; color: #555; cursor: pointer; }
.auth-close:hover { color: #fff; }
.auth-btn-small { color: #fff; font-size: 20px; padding: 5px; cursor: pointer; }

/* Toast Notification */
.toast {
    visibility: hidden; min-width: 250px; background-color: var(--secondary-neon); color: #fff;
    text-align: center; border-radius: 50px; padding: 16px; position: fixed; z-index: 3000;
    left: 50%; bottom: 100px; transform: translateX(-50%); font-size: 16px; font-weight: bold;
    box-shadow: 0 0 20px rgba(188, 19, 254, 0.4); opacity: 0; transition: opacity 0.5s, bottom 0.5s;
}
.toast.show { visibility: visible; opacity: 1; bottom: 110px; }

/* ADMIN STYLES */
.login-overlay, .login-box { z-index: 2000; }
input[type=range] { -webkit-appearance: none; background: transparent; }
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; height: 10px; width: 10px; background: var(--primary-neon);
    border-radius: 50%; margin-top: -3px;
}
input[type=range]::-webkit-slider-runnable-track { height: 4px; background: #444; }

/* === MOBILE ADAPTATION === */
@media (max-width: 768px) {
    .app-container { display: block; position: relative; height: 100%; }

    /* HEADER */
    .mobile-header {
        display: flex; justify-content: space-between; align-items: center;
        padding: 15px 20px; background: var(--bg-panel);
        border-bottom: 1px solid rgba(255,255,255,0.1);
        height: 60px; position: fixed; top: 0; left: 0; width: 100%; z-index: 100;
    }
    .logo-mobile { margin-bottom: 0; font-size: 20px; }
    #mobile-lang-container select { padding: 5px; background: #000; color: #fff; border: 1px solid #333; }

    /* CONTENT */
    .main-content { padding: 80px 15px 160px 15px; height: 100vh; }
    .tracks-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

    /* NAVIGATION */
    .sidebar {
        position: fixed; bottom: 0; left: 0; width: 100%; height: 60px;
        flex-direction: row; border-right: none; border-top: 1px solid #333;
        padding: 0; z-index: 100; background: #000;
    }
    .desktop-only { display: none !important; }
    
    .nav-links { display: flex; width: 100%; justify-content: space-around; align-items: center; height: 100%; margin: 0; }
    .nav-links li { margin: 0; flex-direction: column; font-size: 10px; color: #666; }
    .nav-links li i { margin: 0 0 4px 0; font-size: 20px; }
    .nav-links li.active { color: var(--primary-neon); }

    /* PLAYER ON MOBILE */
    .player-bar {
        position: fixed; bottom: 60px; left: 0; width: 100%; height: 60px;
        background: rgba(15, 16, 22, 0.95); backdrop-filter: blur(10px);
        padding: 0 10px;
    }
    .player-info { width: 70%; }
    .player-info img { width: 40px; height: 40px; }
    .player-controls { width: 30%; justify-content: flex-end; gap: 15px; }
    #play-btn { font-size: 32px; }
    .player-extra { display: none; }
    
    /* Visualizer less opacity on mobile */
    #visualizer { opacity: 0.3; }
    .like-btn, .add-playlist-btn, .share-btn { width: 40px; height: 40px; background: rgba(0,0,0,0.8); }
}