/* Стили для аудиоплеера */
.audio-player {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 10px 5px 5px 5px;
    border-radius: 5px;
    background: #646464;
    display: grid;
    grid-template-columns: minmax(120px, 40%) 1fr;
    grid-template-areas: "cover info";
    gap: 20px;
    box-sizing: border-box;
    position: relative;
    min-height: 180px;
    align-items: stretch;
}

.left-block {
    grid-area: cover;
    overflow: hidden;
    position: relative;
    min-width: 0;
    aspect-ratio: 1;
}

.cover-spacer {
    width: 100%;
    height: auto;
    display: block;
    visibility: hidden;
}

.right-block {
    grid-area: info;
    min-width: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.cover-button {
    width: 100%;
    height: 100%;
    border-radius: 5px;
    display: block;
    cursor: pointer;
    transition: transform 0.5s ease;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.cover-button:hover {
    transform: scale(1.01);            
}

.visualizer-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}
            
.info-block {
    position: relative;
    width: 100%;
    z-index: 1;
    text-align: left; 
    margin-top: 20px;
    padding-bottom: 120px; /* Увеличиваем место для bottom-block (плейлист + контролы) */
    transition: opacity 5s;
    flex: 1;
    min-width: 0;
}

.title {
    font-size: clamp(20px, 4vw, 32px);
    font-weight: 300;
    color: #fff;
    margin: 0 0 8px 0;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.subtitle {
    font-family: "Brandon Grotesque Condensed Light", sans-serif;
    font-weight: 300;
    font-size: clamp(14px, 2.5vw, 18px);
    color: #ccc;
    margin: 0 0 12px 0;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.description {
    font-size: clamp(12px, 2vw, 14px);
    color: #ccc;
    margin: 0;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.description a {
    color: #fff;
    text-decoration: underline;
}

.visualizer {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(80px, 20vw, 200px);
    height: clamp(80px, 20vw, 200px);
    animation: rotate 15s linear infinite;
    opacity: 0;
    transition: opacity 5s;
    z-index: 10;
    pointer-events: none;
}

.visualizer.visible {
    opacity: 1;
}

@keyframes rotate {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.bottom-block {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 3px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1;
}

.playlist-container {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    flex: 0 0 auto;
}

.playlist {
    margin: 0;
    max-width: 500px;
    width: 100%;
    transform: translateX(-5px) translateY(5px);
    margin-bottom: -5px;
    margin-left: -6px;
    max-height: 70px; /* Ограничиваем высоту плейлиста */
    overflow-y: auto; /* Добавляем прокрутку при необходимости */
}  

.playlist ul {
    list-style-type: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.playlist li {
    cursor: pointer;
    margin-bottom: 2px;
    color: #ccc;
    font-size: 13px;
    width: 100%;
    text-align: left;
    padding: 4px 8px;
    border-radius: 3%;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.playlist li.playing {
    font-weight: regular;
    color: white;
}

.controls {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.play-pause-button-1 {
    margin-left: -10px;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.play-pause-button-1:focus {
    outline: none;
}

.play-pause-button-1 svg {
    width: clamp(16px, 3vw, 20px);
    height: clamp(16px, 3vw, 20px);
    fill: white;
}

.current-time, .duration {
    font-family: "Brandon-Grot-W01-Light", sans-serif;
    color: #ccc;
    font-size: clamp(10px, 1.8vw, 12px);
    min-width: 35px;
    text-align: center;
    flex-shrink: 0;
}

.seek-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    min-width: 50px;
    height: 4px;
    background: gray;
    outline: none;
    opacity: 1;
    transition: background 0.02s, value 0.2s linear;
    margin: 0 4px;
    border-radius: 2px;
}

.seek-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
}

.seek-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
}

.audio-player.playing .info-block {
    opacity: 0;
}

.audio-player.playing .visualizer {
    opacity: 1;
}

/* Адаптивные стили */

/* Средние экраны (планшеты в ландшафте) */
@media (max-width: 900px) {
    .audio-player {
        grid-template-columns: minmax(100px, 35%) 1fr;
        gap: 15px;
        padding: 8px 4px 4px 4px;
    }
    
    .info-block {
        margin-top: 15px;
        padding-bottom: 100px; /* Корректируем отступ для средних экранов */
    }
    
    .bottom-block {
        bottom: 15px;
        gap: 10px;
    }
    
    .playlist li {
        padding: 3px 6px;
        font-size: 12px;
    }
}

/* Планшеты в портрете */
@media (max-width: 768px) {
    .audio-player {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "cover"
            "info";
        gap: 20px;
        min-height: auto;
        padding: 0;
        background: transparent;
        border-radius: 0;
        max-width: 80%; /* Уменьшаем размер для планшетов */
        margin: 0 auto;
    }
    
    .left-block {
        max-width: 100%;
        margin: 0;
        aspect-ratio: 1;
        width: 100%;
    }
    
    .right-block {
        position: static;
    }
    
    .info-block {
        margin-top: 0;
        padding-bottom: 0;
        text-align: left;
        width: 100%;
    }
    
    .title {
        font-size: 30px;
        font-weight: 330;
        margin-bottom: 8px;
    }
    
    .subtitle {
        font-size: 20px;
        font-weight: 330;
        margin-bottom: 15px;
    }
    
    .description {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .bottom-block {
        position: static;
        margin-top: 20px;
        gap: 15px;
    }
    
    .controls {
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }
    
    .play-pause-button-1 {
        margin-left: 0;
        order: -1;
    }
    
    .current-time {
        order: 1;
    }
    
    .seek-slider {
        order: 2;
        flex: 1;
        margin: 0 15px;
    }
    
    .duration {
        order: 3;
    }
    
    .visualizer {
        left: 50%;
    }
}

/* Мобильные устройства */
@media (max-width: 600px) {
    .audio-player {
        padding: 0;
        gap: 15px;
        background: transparent;
        border-radius: 0;
        max-width: 75%; /* Уменьшаем размер для мобильных */
        margin: 0 auto;
    }
    
    .left-block {
        max-width: 100%;
        margin: 0;
        aspect-ratio: 1;
        width: 100%;
        transition: opacity 5s;
    }
    
    .info-block {
        margin-top: 0;
        padding-bottom: 0;
        text-align: left;
        width: 100%;
    }
    
    .title {
        font-size: 28px;
        font-weight: 330;
        margin-bottom: 6px;
    }
    
    .subtitle {
        font-size: 18px;
        font-weight: 330;
        margin-bottom: 12px;
    }
    
    .description {
        font-size: 13px;
        margin-bottom: 18px;
    }
    
    .bottom-block {
        margin-top: 15px;
        gap: 12px;
    }
    
    .playlist {
        display: none;
    }
    
    .playlist li {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .controls {
        gap: 10px;
        align-items: center;
        width: 100%;
    }
    
    .play-pause-button-1 {
        margin-left: 0;
    }
    
    .seek-slider {
        margin: 0 12px;
    }
    
    .audio-player.playing .left-block {
        opacity: 0;
        pointer-events: none;
    }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
    .audio-player {
        padding: 0;
        gap: 12px;
        background: transparent;
        border-radius: 0;
        max-width: 70%; /* Еще больше уменьшаем для маленьких экранов */
        margin: 0 auto;
    }
    
    .left-block {
        max-width: 100%;
        margin: 0;
        aspect-ratio: 1;
        width: 100%;
    }
    
    .info-block {
        margin-top: 0;
        padding-bottom: 0;
        text-align: left;
        width: 100%;
    }
    
    .title {
        font-size: 24px;
        font-weight: 330;
        margin-bottom: 5px;
    }
    
    .subtitle {
        font-size: 16px;
        font-weight: 330;
        margin-bottom: 10px;
    }
    
    .description {
        font-size: 12px;
        margin-bottom: 15px;
    }
    
    .bottom-block {
        margin-top: 12px;
        gap: 10px;
    }
    
    .playlist {
        display: none;
    }
    
    .playlist li {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .controls {
        gap: 8px;
        align-items: center;
        width: 100%;
    }
    
    .current-time, .duration {
        min-width: 30px;
        font-size: 11px;
    }
    
    .seek-slider {
        margin: 0 8px;
    }
} 