@font-face {
    font-family: 'Inter';
    src: url('/fonts/Inter.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}


html, body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: black;
    color: white;
}

.canvas {
    display: block;
    background-color: black;
    width: 100%;
    height: 100%;
}

/*Элементы управления радио*/

.radio-controls {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
}

.radio-controls button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.radio-display {
    text-align: center;
    overflow: hidden;
    width: 60px;
    font-size: 12px;   
    font-weight: bold;
    margin-bottom: 8px;
    user-select: none; 
}

#prev-radio {
    width: 40px;
    height: 40px;
    margin-right: 4px;
}

#next-radio {
    width: 40px;
    height: 40px;
    margin-left: 4px;
}

/*Кнопки*/

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 13px;
    color: white;
    transition: all 0.3s ease;
    margin: 0 2.5px;
    border-style: hidden;
    user-select: none; 
}

.button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

@media (hover: hover) {
    .button:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
}

@media (hover: none) {
    .button:active {
        background-color: rgba(255, 255, 255, 0.1);
    }
}

.button:active {
    transform: scale(0.95);
}

/*Панель управления и scroll-view*/

.player-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(100, 100, 100, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 17px;
    position: absolute;
    bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    width: auto; /* Container resizes automatically */
    transition: opacity 0.5s ease;
}

.hover-area {
    position: relative;
}

.hidden {
    opacity: 0;
}

.controls {
    display: flex;
    justify-content: center;
    margin-top: 5px;
    margin-bottom: 5px;
    margin-left: 2.5px;
    margin-right: 2.5px;
}

.panel {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px); 
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(100, 100, 100, 0.15);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 17px;
    z-index: 2;
    flex-direction: column;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.03);
    width: 200px;
    max-height: 600px; 
    overflow: hidden; 
    transition: opacity 0.5s ease, visibility 0.5s ease-in-out, transform 0.5s ease;
}

.panel-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%; /* Добавление высоты для корректного заполнения panel */
}

.panel-title {
    margin-bottom: 15px;
    font-size: 1.5em;
    transition: all 0.3s ease;
    user-select: none; 
}

.section-title {
    font-size: 1.2em;
    margin: 15px 0 5px;
    margin-bottom: 15px;
    user-select: none; 
}


.mini-panel {
    background-color: transparent;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 17px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: 190;
}


.scroll-view {
    overflow-y: auto;
    width: 100%;
    max-height: 100%; 
}

.panel.show {
    display: flex;
}

::-webkit-scrollbar {
    display: none;
}

@media (min-height: 800px) {
    .panel {
        max-height: 450px;
        overflow-y: auto;
    }
}

@media (max-height: 800px) {
    .panel {
        max-height: 300px;
        overflow-y: auto;
    }
}

@media (max-height: 600px) {
    .panel {
        max-height: 200px;
        overflow-y: auto;
    }
}

@media (max-height: 400px) {
    .panel {
        max-height: 150px;
        overflow-y: auto;
    }
}

@media (max-width: 600px) {
    .button {
        width: 50px;
        height: 50px;
    }
    
    .player-container {
        bottom: 20px;
    }
    
    .panel {
        /* Ensure the panel adjusts its size according to the container even on smaller screens */
        max-width: calc(100% - 20px); /* Ensure panels do not exceed container width */
        padding: 20px;
    }
}

.vibe-text {
    margin-top: 10px;
    text-align: center;
    font-size: 16px;
    white-space: nowrap;
    color: white;
    opacity: 0;
    animation: fadeInOut 20s infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    10%, 90% { opacity: 1; }
}

@media (max-width: 900px) {
    .vibe-text {
        display: none;
    }
}

/*Слайдеры*/

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 170px;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    outline: none;
    opacity: 0.7;
    transition: opacity 0.5s;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 17px;
    height: 17px;
    background: #EBEBEB;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

input[type="range"]:disabled::-webkit-slider-thumb {
    background: #888;
    cursor: not-allowed;
}

input[type="range"]:not(:disabled):hover,
input[type="range"]:not(:disabled):focus {
    opacity: 1;
}

input[type="range"]:not(:disabled):hover::-webkit-slider-thumb,
input[type="range"]:not(:disabled):focus::-webkit-slider-thumb {
    transform: scale(1.2);
}

.slider-label {
    user-select: none;
}

#amb-slider{
    width: 40%;
    margin-top: 15px;
    margin-bottom: 15px;
}

#volume-slider{
    margin-top: 15px;
    margin-bottom: 15px;
}

#red{
    margin-top: 10px;
    margin-bottom: 10px;    
}

#green{
    margin-top: 10px;
    margin-bottom: 10px;    
}

#blue{
    margin-top: 10px;
    margin-bottom: 10px;    
}

#speed{
    margin-top: 10px;
    margin-bottom: 10px;    
}

#amb-slider{
    margin-right: 10px;
}


/*Переключатели*/

.switch {
    position: relative;
    display: inline-block;
    width: 45px; /* 75% of 60px */
    height: 25.5px; /* 75% of 34px */
    margin-right: 10px; /* Space between toggle and text */
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.check-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 25.5px; /* match height */
}

.check-slider:before {
    position: absolute;
    content: "";
    height: 19.5px; /* 75% of 26px */
    width: 19.5px; /* 75% of 26px */
    left: 3px; /* 75% of 4px */
    bottom: 3px; /* 75% of 4px */
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .check-slider {
    background-color: rgba(145, 145, 145, 0.8);
}

input:checked + .check-slider:before {
    transform: translateX(19.5px); /* 75% of 26px */
}

.check-container {
    display: flex;
    align-items: center;
}

.sound-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 2px;
    user-select: none;
}

.sound-button i {
    margin-left: 10px;
}

.sound-button.active,
.sound-button.active .slider {
    background-color: rgba(255, 255, 255, 0.05); 
    border-radius: 13px;
    margin-top: 2px;
}

/*Таймер сна*/

.timer-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
    width: 100%;
}

.timer-controls .button-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 10px 0;
}

.button-group{
    border-bottom: 1px solid rgba(255, 255, 255, 0.05); 
    border-radius: 17px;
}

.timer-display {
    font-size: large;
    font-weight: bold;
    user-select: none;
}

.timer-span {
    display: inline-block;
    width: 400px; /* Фиксированная ширина для span */
    font-size: 17px; /* Размер текста */
    margin-bottom: 10px;
    user-select: none;
}

#controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#line {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);  
    margin-bottom: 10px;
}

#line-2 {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);  
}

.span {
    user-select: none;
}

.volume-button:hover {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.panel .button {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 13px;
    color: white;
    transition: all 0.3s ease;
    text-decoration: none;
    width: 100%;  /* Ensures buttons fill the panel width */
    height: 50px;
}

.panel .button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.panel .button:active {
    transform: scale(0.95);
}


/*Панель микшера*/

.mixer-panel .slider {
    width: 50%; /* Slider width should not exceed 50% of the panel */
    margin: 10px 0;
}

.mixer-panel .sound-button {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: space-between;
}

.mixer-panel .sound-button i {
    margin-left: 10px; /* Small margin between icon and text */
}

.mixer-panel .sound-button span {
    margin-right: 10px; /* Small margin between text and slider */
}

#mute-all-button {
    width: 195px;
}

#amb-scroll-view .sound-button {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.5s ease;
    padding: 5px 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 10px;
    border-radius: 17px;
    box-sizing: border-box;
    width: 100%;
}

#amb-scroll-view .sound-button.active span {
    opacity: 0;
    transform: translateX(-10px);
    max-width: calc(100% - 60px); /* Устанавливаем максимальную ширину */
    overflow: hidden; /* Скрываем переполнение */
    white-space: nowrap; /* Текст не переносится */
    text-overflow: ellipsis; /* Добавляем многоточие */
}

#amb-scroll-view i,
#amb-scroll-view span,
#amb-scroll-view .slider {
    transition: all 0.5s ease;
}

#amb-scroll-view i {
    margin-right: 10px; /* Устанавливаем одинаковые отступы */
}

#amb-scroll-view span {
    opacity: 1;
    transform: translateX(0);
    margin-right: 10px; /* Устанавливаем одинаковые отступы */
}

#amb-scroll-view .sound-button.active span {
    opacity: 0;
    transform: translateX(-10px);
}

#amb-scroll-view .slider {
    opacity: 0;
    width: 0;
    transform: translateX(-10px);
    margin-left: 0; /* Устанавливаем минимальные отступы */
}

#amb-scroll-view .sound-button.active .slider {
    opacity: 1;
    width: calc(100% - 45px); /* Учитывая отступы */
    transform: translateX(0);
    margin-left: 10px; /* Устанавливаем одинаковые отступы */
}

#amb-scroll-view .sound-button.active i {
    transform: translateX(-15px); /* Сдвиг влево с учетом отступов */
}

.preset-scroll-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%; /* Контейнер растянется от края до края */
    box-sizing: border-box;
    padding: 10px
}

.preset-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 135px; /* Увеличиваем ширину для текста */
    border-radius: 13px;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 10px;
    margin-bottom: 10px;
    transition: all 0.5s ease;
    position: relative;
}

.preset-button {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1; /* Расширяем контейнер для текста и иконки */
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: white;
    text-align: center;
    transition: all 0.5s ease;
    user-select: none;
}

.preset-button i {
    margin-right: 5px;
    transition: all 0.5s ease;
}

.preset-button span {
    display: inline-block;
    max-width: 50px; /* Предел для отображения текста */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: all 0.5s ease;
}

.preset-container .edit-preset,
.preset-container .delete-preset {
    opacity: 0;
    cursor: default; /* Делаем некликабельными */
    pointer-events: none; /* Отключаем кликабельность */
    background: transparent;
    border: none;
    font-size: 12px;
    color: white;
    transition: all 0.5s ease;
    margin-right: -10px;
}

.preset-container.active .edit-preset,
.preset-container.active .delete-preset {
    opacity: 1;
    cursor: pointer;
    pointer-events: all; /* Включаем кликабельность */
}

.preset-container.active .preset-button span {
    opacity: 0;
    transform: translateX(-10px);
}

.preset-container.active .preset-button i {
    transform: translateX(-10px);
}

.preset-container.active {
    justify-content: space-around; /* Раздвигаем кнопки когда пресет активен */
}

#preset-panel{
    width: 178px;
}

/*Интро*/

#intro-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    opacity: 1;
    transition: opacity 2s;
    pointer-events: none; /* Отключаем все взаимодействия с интро-экраном */
}

#intro-screen.hidden {
    opacity: 0;
    transition: opacity 2s;
}

/* Скрытие основного контента первоначально */
#hover-area {
    display: none;
    opacity: 0;
    transition: opacity 2s;
}

/* Плавное появление основного контента */
#hover-area.visible {
    display: block;
    opacity: 1;
}


/* Анимация снега */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#snow-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.7);
    color: #000000;
    padding: 10px 20px;
}

/*Часы*/

.clock {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.5s;
    background-color: rgba(100, 100, 100, 0.15);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 17px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    text-align: center;
    color: white;
    user-select: none; 
    
}

.show {
    opacity: 1;
}

.time {
    font-size: 36px;
    margin-bottom: 10px;
    pointer-events: none;
}

.date {
    font-size: 20px;
    pointer-events: none;
}

.separator {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); 
    margin: 10px 0;
}

/*Прозрачные кнопки и поля ввода*/

.input-container {
    position: relative;
    align-items: center;
}

.translucent-button, .translucent-input {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid #ccc;
    border-radius: 13px;
    padding: 10px;
    color: white;
    border-style: hidden;
    transition: all 0.3s ease;
    text-decoration: none;
    margin-top: 10px;
    width: 170px;
    user-select: none;
}
.translucent-input {
    width: 150px;
    display: inline-block;
    margin-top: 20px;
    white-space: nowrap; /* Запретить перенос текста */
    overflow: hidden; /* Скрыть выходящий за границы текст */
    text-overflow: ellipsis; /* Отображать "..." для длинного текста */
}

.translucent-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.translucent-button:active {
    transform: scale(0.95);
}

/*Управление YouTube*/

#youtube-controls {
    display: none;
    user-select: none;
}

.refresh-button {
    position: absolute;
    right: 5px;
    background: none;
    border: none;
    cursor: pointer;
    color: #ccc;
    margin-top: 30px;
    margin-right: 5px;
}