/* 1. Золотая кнопка вызова на странице (Круглая с иконкой, размер оптимизирован) */
.ambient-trigger-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 48px; /* Уменьшено до размера стандартной кнопки чата */
    height: 48px;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    border: none;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4), inset 0 2px 4px rgba(255,255,255,0.5);
    -webkit-tap-highlight-color: transparent;
    
    /* Новые параметры: фиксируем над календарем */
    position: fixed;
    bottom: 115px;
    left: 20px;
    z-index: 99999;
}
.ambient-trigger-btn svg {
    width: 22px; /* Иконка также пропорционально уменьшена */
    height: 22px;
    stroke: #fff;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}
.ambient-trigger-btn:hover {
    background: linear-gradient(135deg, #ffd700 0%, #d4af37 100%);
    box-shadow: 0 6px 18px rgba(212, 175, 55, 0.6), inset 0 2px 4px rgba(255,255,255,0.6);
    transform: translateY(-2px) scale(1.05);
}

/* 2. Общий темный оверлей (не трогаем) */
.ambient-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 10, 0.85); 
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* 3. Светлый плеер (Модальное окно) */
.ambient-sandbox-modal {
    background: rgba(236, 230, 218, 0.95); 
    border: 1px solid rgba(255, 255, 255, 0.5);
    width: 90%;
    max-width: 550px;
    max-height: 85vh;
    overflow-y: auto;
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #3e3832;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), inset 0 0 30px rgba(255, 255, 255, 0.8);
    border-radius: 28px; 
    position: relative;
    transform: translateY(30px);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    scrollbar-width: none; 
    -ms-overflow-style: none;
}
.ambient-sandbox-modal::-webkit-scrollbar { 
    display: none; 
}

/* Кнопка закрытия */
.ambient-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    color: #fff;
    cursor: pointer;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}
.ambient-close-btn:hover { 
    background: rgba(212, 175, 55, 0.6); 
    transform: scale(1.08);
    border-color: rgba(212, 175, 55, 0.8);
}

/* Шапка */
.ambient-header-image {
    width: 100%;
    height: 200px; 
    background-color: #dcd3b6;
    background-image: url('/wp-content/uploads/2026/09/qjuzkpqjuzkpqjuz.webp'); 
    background-size: cover;
    background-position: center;
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
    position: relative;
}
/* Градиент в шапке (переход в цвет модального окна) */
.ambient-header-image::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0; height: 80px;
    background: linear-gradient(to top, rgba(236, 230, 218, 0.95) 0%, transparent 100%);
}

.ambient-content { padding: 30px; position: relative; z-index: 2; }

.ambient-sandbox-title {
    text-align: center;
    font-size: 26px;
    font-weight: normal;
    margin-top: 0;
    margin-bottom: 25px;
    letter-spacing: 1px;
    color: #3e3832;
}

/* 4. Плашки и главная панель с фоновой картинкой (Темное мокрое стекло) */
.ambient-master-switch-wrapper {
    background: linear-gradient(135deg, rgba(35, 25, 18, 0.85) 0%, rgba(10, 5, 0, 0.95) 100%);
    border-radius: 26px;
    border: 1px solid rgba(0, 0, 0, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.9);
    box-shadow: 
        0 12px 25px rgba(0, 0, 0, 0.35),
        inset 0 4px 12px rgba(255, 255, 255, 0.06),
        inset 0 -6px 20px rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.ambient-control-group { 
    position: relative;
    z-index: 1;
    overflow: hidden; /* Обрезает картинку по радиусу углов */
    margin-bottom: 22px; 
    padding: 16px 20px;
    border-radius: 26px;
    background: linear-gradient(135deg, rgba(35, 25, 18, 0.75) 0%, rgba(10, 5, 0, 0.85) 100%);
    border: 1px solid rgba(0, 0, 0, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.9);
    box-shadow: 
        0 12px 25px rgba(0, 0, 0, 0.35),
        inset 0 4px 12px rgba(255, 255, 255, 0.06),
        inset 0 -6px 20px rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease, border-top 0.4s ease;
}

/* Контейнер картинки под стеклом плашки */
.ambient-panel-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    z-index: -1; /* Опускаем под текст и слайдеры */
    opacity: 0.3; /* Высокая прозрачность для сохранения читаемости текста */
    transition: opacity 0.4s ease, transform 0.8s ease;
    pointer-events: none;
}

.ambient-control-group:hover {
    transform: translateY(-6px);
    box-shadow: 
        0 18px 35px rgba(0, 0, 0, 0.45), 
        inset 0 6px 15px rgba(255, 255, 255, 0.08), 
        inset 0 -8px 25px rgba(0, 0, 0, 1);
    border-top: 1px solid rgba(255, 255, 255, 0.25);
}
/* Картинка чуть светлеет и увеличивается при наведении */
.ambient-control-group:hover .ambient-panel-bg {
    opacity: 0.45;
    transform: scale(1.05);
}

.ambient-master-label { 
    font-size: 17px; 
    font-variant: small-caps; 
    letter-spacing: 1px;
    color: #f5f0e6; 
    text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}

.ambient-control-label {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 14px; margin-bottom: 14px; color: #f5f0e6;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

/* Заголовки категорий */
.ambient-category {
    font-size: 12px; font-weight: bold; text-transform: uppercase; letter-spacing: 2px;
    color: #8b7d6b; 
    border-bottom: 1px solid rgba(139, 125, 107, 0.2); 
    padding-bottom: 6px;
    margin-bottom: 20px; margin-top: 35px;
}
.ambient-category:first-child { margin-top: 0; }

/* Индикатор буферизации (главный) */
.ambient-loader {
    display: none;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.ambient-loader-dots span {
    display: inline-block;
    width: 4px; height: 4px;
    background-color: #d4af37;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}
.ambient-loader-dots span:nth-child(1) { animation-delay: -0.32s; }
.ambient-loader-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

/* Индивидуальная буферизация звука */
.channel-loader {
    display: none;
    font-size: 10px;
    color: #d4af37;
    font-style: italic;
    margin-left: 6px;
    animation: pulse-opacity 1.2s infinite ease-in-out;
    text-shadow: none;
}
.channel-loader.active { display: inline-block; }
@keyframes pulse-opacity { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* Тумблеры */
.switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider-toggle {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8); 
    transition: .4s cubic-bezier(0.4, 0.0, 0.2, 1); 
    border-radius: 26px;
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.9);
}
.slider-toggle:before {
    position: absolute; content: ""; height: 18px; width: 18px; left: 4px; bottom: 3px;
    background: #aaa;
    transition: .4s cubic-bezier(0.4, 0.0, 0.2, 1); 
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
input:checked + .slider-toggle { 
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.4);
}
input:checked + .slider-toggle:before { 
    transform: translateX(22px); 
    background: linear-gradient(135deg, #ffd700, #b8860b);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5), 0 2px 4px rgba(0,0,0,0.6);
}

/* Маленький тумблер для каналов */
.switch-small { width: 36px; height: 20px; margin-right: 8px; margin-top: 0px;}
.switch-small .slider-toggle:before { height: 14px; width: 14px; left: 3px; bottom: 2px; }
.switch-small input:checked + .slider-toggle:before { transform: translateX(16px); }

.ambient-controls { opacity: 0.4; pointer-events: none; transition: opacity 0.5s ease; }

.ambient-val-wrap { display: flex; align-items: center; gap: 5px; }
.val-text { min-width: 38px; text-align: right; display: inline-block; font-size: 13px; color: #a09a8e;}

/* Ползунки */
.ambient-slider {
    width: 100%; -webkit-appearance: none; 
    background: rgba(0,0,0,0.8); 
    height: 6px; border-radius: 4px; outline: none;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.9);
    border: 1px solid rgba(255,255,255,0.05);
    position: relative;
}
.ambient-slider {
    background: linear-gradient(to right, #b8860b 0%, #ffd700 var(--percent, 0%), rgba(0,0,0,0.8) var(--percent, 0%));
}
.ambient-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 18px; height: 18px;
    border-radius: 50%; 
    background: radial-gradient(circle at 30% 30%, #fff, #ffd700, #b8860b);
    cursor: pointer; 
    border: 1px solid rgba(255,255,255,0.8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.8), 0 0 8px rgba(212, 175, 55, 0.4); 
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.ambient-slider::-webkit-slider-thumb:hover { transform: scale(1.25); }

/* 5. Мобильная адаптация */
@media (max-width: 600px) {
    .ambient-trigger-btn {
        width: 35px;
        height: 35px;
        bottom: 68px;
        left: 16px;
    }
    .ambient-trigger-btn svg {
        width: 18px;
        height: 18px;
    }
    .ambient-sandbox-modal { width: 95%; max-height: 90vh; border-radius: 20px; }
    .ambient-header-image { height: 140px; border-top-left-radius: 20px; border-top-right-radius: 20px; }
    .ambient-header-image::after { height: 60px; }
    .ambient-content { padding: 20px; }
    .ambient-sandbox-title { font-size: 22px; margin-bottom: 20px; }
    .ambient-master-switch-wrapper { padding: 12px 16px; margin-bottom: 20px; border-radius: 20px; }
    .ambient-master-label { font-size: 15px; }
    .ambient-control-group { padding: 12px 14px; border-radius: 20px; margin-bottom: 15px; }
    .ambient-category { margin-top: 25px; margin-bottom: 12px; }
    .ambient-close-btn { top: 10px; right: 15px; width: 32px; height: 32px; font-size: 18px; }
}