/* ==========================================================================
   1. ОБЩИЕ СТИЛИ ДЛЯ ВСЕХ УСТРОЙСТВ (Шрифты, Переменные, Оформление)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

:root {
    --primary-color: #ffb700;   /* Теплый золотистый */
    --secondary-color: #9d4edd; /* Насыщенный лиловый */
    --bg-dark: #070509;         /* Темный фон на случай задержки загрузки */
    --text-main: #ffffff;
    --text-muted: #a0a1b0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-dark);
}

/* Живой размытый фон (Аврора) */
body::before, body::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    opacity: 0.3;
    animation: float 12s infinite alternate ease-in-out;
    pointer-events: none;
}

body::before {
    background: var(--primary-color);
    top: -10%;
    left: -10%;
}

body::after {
    background: var(--secondary-color);
    bottom: -10%;
    right: -10%;
    animation-delay: -6s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(80px, 50px) scale(1.2); }
}

/* Оформление внутренностей плеера */
.player-container {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 15px;
    z-index: 100;
    transition: box-shadow 0.3s ease, opacity 0.3s ease;
}

.player-container:hover {
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.3);
}

.cover-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;      
    max-height: 290px;        
    margin-bottom: 25px; 
    overflow: hidden;         
    border-radius: 12px;
}

.cover-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: fill;         
    transition: transform 0.5s ease;
}

.player-container:hover .cover-wrapper img {
    transform: scale(1.05); 
}

.track-info {
    text-align: center;
    margin-bottom: 20px;
    min-width: 0; 
    width: 100%;
}

.track-title {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.4rem;
    font-weight: 800;                                             
    letter-spacing: 1px;                                   
    margin-bottom: 6px;
    color: #7adcc8;                                               
    text-shadow: 0 0 8px rgba(0, 255, 204, 0.6),                    
                 0 0 20px rgba(0, 255, 204, 0.3);
    text-transform: uppercase;                                     
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.track-artist {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    color: var(--primary-color);                                   
    font-weight: 700;                                             
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(255, 183, 0, 0.5);   
}

.progress-area {
    margin-bottom: 22px;
}

.progress-bar-container {
    width: 100%;
    height: 6px; 
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    cursor: pointer;
    margin-bottom: 8px;
    position: relative;
}

.progress-bar {
    height: 100%;
    width: 35%; 
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    border-radius: 10px;
    position: relative;
    transition: width 0.1s linear;
}

.progress-bar::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary-color);
    transition: transform 0.2s ease;
}

.progress-bar-container:hover .progress-bar::after {
    transform: translateY(-50%) scale(1);
}

.time-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    padding-left: 15px;  
    padding-right: 15px;
}

.btn-nav {
    background: rgba(255, 255, 255, 0.05); 
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    width: 45px;             
    height: 35px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-nav:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: var(--primary-color); 
}

.btn-play {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(7, 5, 9, 0.6); 
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 2px solid var(--primary-color); 
    color: var(--primary-color); 
    font-size: 1.4rem;
    opacity: 1;
    box-shadow: 0 0 15px rgba(255, 183, 0, 0.2), 
                inset 0 0 10px rgba(255, 183, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-play:hover {
    transform: scale(1.08);
    border-color: #ffffff;
    color: var(--bg-dark);
    background: #ffffff;
    box-shadow: 0 0 25px var(--primary-color), 
                0 0 50px rgba(255, 183, 0, 0.6);
    text-shadow: none;
}

.btn-play:active {
    transform: scale(0.95);
}

/* Оформление футера */
.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(7, 5, 9, 0.6); 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    box-sizing: border-box;
    z-index: 10;
}

.footer-copyright {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 300;
}

/* Новые стили для кнопок-иконок в футере */
.footer-links {
    display: flex;
    gap: 20px; /* Расстояние между значками */
    align-items: center;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1.35rem; /* Делаем иконки крупнее и заметнее */
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Эффект неонового свечения при наведении */
.footer-link:hover {
    color: #7adcc8; /* Бирюзовый цвет в цвет экрана плеера */
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.8), 
                 0 0 20px rgba(0, 255, 204, 0.4);
    transform: scale(1.15); /* Легкое увеличение при наведении */
}
.cockpit-interface {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; 
    z-index: 1;        
}

.btn-disabled {
    opacity: 0.2 !important;
    pointer-events: none !important;
    box-shadow: none !important;
}

.music-visualizer-glow {
    border-radius: 20px;
    pointer-events: none;
    box-shadow: 0 0 100px rgba(
        calc(var(--red-intensity) * 255), 
        calc(var(--green-intensity) * 255), 
        calc(var(--blue-intensity) * 255), 
        0.5
    );
    transition: box-shadow 0.1s ease-out;
}


/* ==========================================================================
   2. ДЕСКТОПНЫЕ СТИЛИ (Только для ПК, экраны шире 768px)
   ========================================================================== */
@media (min-width: 769px) {
    body {
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
        width: 100vw;
        height: 100vh;
        overflow: hidden;
    }

    .cockpit-wrapper {
        position: relative; 
        display: inline-block;
        line-height: 0;
    }

    .cockpit-image {
        display: block;      
        max-height: 100vh;   
        max-width: 100vw;
        width: auto;         
        height: auto;
    }

    .player-container {
        position: absolute;
        top: 36%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 310px;
    }

    .controls {
        display: flex;
        justify-content: center; 
        align-items: center;
        gap: 40px;               
        position: relative; 
        top: -25px;
    }

    .site-footer {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
    }

    #radio-toggle {
        position: absolute;
        left: 40.5%; 
        top: 78.5%;
        width: 40px;
        height: 26px;
        margin-left: -20px; 
        margin-top: -13px;
        background: rgba(0, 0, 0, 0.3); 
        border: 4px solid rgba(0, 255, 204, 1); 
        border-radius: 4px;
        cursor: pointer;
        z-index: 10;
    }

    #radio-toggle:hover {
        background: rgba(0, 255, 204, 0.15);
        border-color: rgb(248, 4, 4);
        box-shadow: 0 0 8px rgba(0, 255, 204, 0.6);
    }

    #radio-toggle:active {
        transform: scale(0.95);
        background: rgba(0, 255, 204, 0.3);
    }

    #deck-display {
        position: absolute;
        left: 48.4%;
        top: 73.3%;
        font-family: 'Courier New', monospace;
        font-size: 15px;
        color: #7adcc8;
        text-shadow: 0 0 8px #7adcc8;
        pointer-events: none;
        z-index: 10;
    }

    .music-visualizer-glow {
        position: absolute;
        top: 36%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 340px; 
        height: 520px;
        z-index: 99;
    }
}


/* ==========================================================================
   3. МОБИЛЬНЫЕ СТИЛИ (Только для смартфонов, экраны 768px и меньше)
   ========================================================================== */
@media (max-width: 768px) {
    body {
        display: flex !important;
        flex-direction: column !important;   
        justify-content: flex-start !important;
        align-items: center !important;      /* Ровно по центру по горизонтали */
        overflow-x: hidden !important;       
        overflow-y: auto !important;         
        height: auto !important;               
        min-height: 100vh !important;
        width: 100% !important;
    }
    
    /* Скрываем всё лишнее барахло десктопа */
    .cockpit-wrapper, #radio-toggle, #deck-display, .cockpit-interface, .cockpit-image {
        display: none !important;
    }
    
    body::before, body::after {
        width: 280px;
        height: 280px;
        opacity: 0.4;
    }

    /* МОБИЛЬНЫЙ ПЛЕЕР: Обнуляем десктопное позиционирование на 100% */
    .player-container {
        position: relative !important; 
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        transform: none !important; 
        
        width: 90% !important;
        max-width: 320px !important; 
        margin: 40px auto 30px auto !important; /* Умное центрирование контейнера */
        padding: 25px !important;               
        background: rgba(7, 5, 9, 0.9) !important; 
        border: 1px solid rgba(255, 255, 255, 0.05) !important;
        box-sizing: border-box !important;
    }

    /* Возвращаем кнопки управления на место */
    .controls {
        position: relative !important;
        top: 0 !important;                      
        margin-top: 25px !important;            
        margin-bottom: 5px !important;
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 25px !important;                   
    }

    /* Жесткая фиксация круглой кнопки Плей */
    .btn-play {
        width: 60px !important;
        height: 60px !important;
        min-width: 60px !important;             
        min-height: 60px !important;            
        flex-shrink: 0 !important;              
        border-radius: 50% !important;          
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 0 !important;
    }

    .btn-nav {
        flex-shrink: 0 !important;
    }

    .player-container:hover {
        transform: none !important;
        box-shadow: 0 0 15px rgba(0, 255, 204, 0.2) !important;
    }
    
    .player-container:hover .cover-wrapper img {
        transform: none !important;
    }
    
    .cover-wrapper {
        margin-bottom: 15px !important;
        width: 100% !important;
    }

    /* Визуализатор на фоне мобилки */
    .music-visualizer-glow {
        position: fixed !important;             
        top: 240px !important;                  
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 280px !important;
        height: 440px !important;
        z-index: -1 !important; 
    }

    /* МОБИЛЬНЫЙ ФУТЕР: Полный сброс десктопных привязок */
    .site-footer {
        position: static !important;          
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        transform: none !important;
        
        width: 100% !important;
        margin-top: auto !important;   /* Прижимаем ко дну телефона */        
        padding: 20px !important;        
        flex-direction: row !important;       
        justify-content: space-between !important;
        align-items: center !important;
        background: rgba(7, 5, 9, 0.95) !important;
        box-sizing: border-box !important;
    }

    .footer-copyright {
        font-size: 0.75rem !important;
        text-align: left !important;
    }

    .footer-links {
        gap: 15px !important;
    }
}
