/* css/embed-player.css - Специальные стили для встраиваемого плеера */

/* Базовые сбросы и стили для страницы */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow: hidden;
    background-color: transparent;
    height: 100%;
    font-family: 'Arial', sans-serif;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

/* === Стили самого плеера === */
.player {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 1rem 1.5rem;
    background: #202124;
    border: 1px solid #3c4043;
    border-radius: 20px;
    padding: 20px;
    width: 100%;
    max-width: 380px;
    color: #ffffff;
}

/* === Новый контейнер для левой колонки === */
.player-art-section {
    grid-column: 1 / 2;
    grid-row: 1 / -1;
    display: flex;
    flex-direction: column; /* Располагаем элементы друг под другом */
}

.embed-logo {
    text-align: center;
    margin-bottom: 10px; /* Отступ между лого и обложкой */
}

.embed-logo img {
    max-width: 40px;
    height: auto;
    opacity: 0.8;
}

.album-art-container {
    width: 100%;
    padding-top: 100%;
    position: relative;
    background-color: transparent;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 10px;
    transition: opacity 0.5s ease;
}

.album-art-container.fade-out {
    opacity: 0;
}

.player-main {
    grid-column: 2 / 3;
    grid-row: 1 / -1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
    min-width: 0;
}

#now-playing-info {
    width: 100%;
    margin-bottom: 0.25rem;
}

.track-info-styled-box {
    padding: 0;
    background: none;
    border: none;
}

.track-title-marquee-viewport {
    overflow: hidden;
    white-space: nowrap;
}

#now-playing-info .track-title {
    font-size: clamp(1rem, 4vw, 1.3rem);
    font-weight: 700;
    color: #e8eaed;
    display: inline-block;
    padding-left: 100%;
    animation: marquee-animation 25s linear infinite;
}

@keyframes marquee-animation {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.dj-info {
    color: #bdc1c6;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dj-icon {
    border: 1px solid #00FF66;
    padding: 2px 6px;
    border-radius: 4px;
    color: #00FF66;
    font-size: 0.8em;
    font-weight: bold;
}

.equalizer-canvas {
    width: 100%;
    height: 45px;
    display: block;
    margin: 0.75rem 0;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.play-button {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background-color: #00FF66;
    box-shadow: 0 2px 8px rgba(0, 255, 102, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.play-icon {
    width: 0;
    height: 0;
    border-left: 14px solid #0a0a0a;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    margin-left: 3px;
    transition: all 0.2s ease-in-out;
}

.play-button.playing .play-icon {
    border: none;
    width: 14px;
    height: 16px;
    background: transparent;
    margin: 0;
    display: flex;
    justify-content: space-between;
}

.play-button.playing .play-icon::before,
.play-button.playing .play-icon::after {
    content: ''; display: block; width: 4px; height: 16px;
    background: #0a0a0a; border-radius: 2px;
}

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

.play-button.loading .play-icon {
    width: 24px; height: 24px; border: 3px solid rgba(10, 10, 10, 0.3);
    border-top-color: #0a0a0a; border-radius: 50%; animation: spin 0.8s linear infinite;
    margin: 0; border-left-style: none; border-bottom-style: none; border-top-style: solid; background: transparent;
}
.play-button.loading .play-icon::before, .play-button.loading .play-icon::after { display: none; }

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}
.volume-icon {
    color: #9aa0a6;
    font-size: 1.1rem;
    cursor: pointer;
}
.volume-slider {
    width: 100%; height: 4px; background: #5f6368; border-radius: 2px;
    outline: none; cursor: pointer; appearance: none; -webkit-appearance: none;
}
.volume-slider::-webkit-slider-thumb {
    appearance: none; -webkit-appearance: none; width: 14px; height: 14px;
    background: #fff; border-radius: 50%; cursor: pointer; border: none;
}
.volume-slider::-moz-range-thumb {
    width: 14px; height: 14px; background: #fff; border-radius: 50%; cursor: pointer; border: none;
}

.player-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #3c4043;
    padding-top: 0.75rem;
}

.player.platform-ios .player-footer {
    justify-content: center;
}

.stream-selector { position: relative; }
.stream-select {
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    background-color: #303134; border: 1px solid #5f6368;
    color: #e8eaed; border-radius: 8px; padding: 6px 30px 6px 12px;
    font-size: 0.8rem;
    cursor: pointer;
}
.stream-selector::after {
    content: '▾'; position: absolute; top: 50%; right: 10px;
    transform: translateY(-50%); color: #9aa0a6; pointer-events: none;
}

#notificationContainer {
    position: fixed; top: 10px; right: 10px; z-index: 3000; width: calc(100% - 20px); max-width: 350px;
}
.notification {
    background-color: rgba(34, 34, 34, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: #fff; padding: 10px 15px; border-radius: 8px; margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); opacity: 0;
    transform: translateY(-100%); transition: opacity 0.5s ease, transform 0.5s ease;
    font-size: 0.9rem; border-left: 4px solid;
}
.notification.show { opacity: 1; transform: translateY(0); }
.notification.success { border-left-color: #00FF66; }
.notification.error { border-left-color: #ff4444; }


/* Адаптация плеера для мобильных устройств */
@media (max-width: 400px) {
    body {
        padding: 0;
    }
    
    .player {
        grid-template-columns: 110px 1fr;
        gap: 0.5rem 1rem;
        height: auto;
        border-radius: 20px;
        border: 1px solid #3c4043;
        margin: 1rem;
        padding: 1rem;
    }

    .player-art-section {
        grid-column: 1 / 2;
        grid-row: 1 / -1;
    }
    
    .embed-logo {
        display: block;
    }
    
    .album-art-container {
        max-width: none;
        margin: 0;
    }

    .player-main {
        grid-column: 2 / 3;
        grid-row: 1 / -1;
        align-items: initial;
        text-align: left;
    }

    #now-playing-info,
    .dj-info,
    .player-controls,
    .equalizer-canvas,
    .player-footer {
        order: initial;
        width: 100%;
        margin: 0;
    }
    
    .dj-info {
        justify-content: flex-start;
    }

    .player-controls {
        margin-bottom: 0.75rem;
        /* === ИЗМЕНЕНИЕ: Центрируем кнопку Play === */
        justify-content: center; 
    }
    
    /* === ИЗМЕНЕНИЕ: Скрываем регулятор громкости === */
    .volume-control {
        display: none;
    }

    .equalizer-canvas {
        margin: 0.5rem 0;
    }
}