/* =================== Чекбоксы =================== */

/* Общий контейнер для чекбоксов */
#checkboxContainer {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 220px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Индивидуальные стили для чекбоксов */
#checkboxContainer label {
    font-size: 18px;
    display: flex;
    align-items: center;
}

/* Стили для вложенных чекбоксов OpenWeather */
#weatherLayers {
    margin-left: 20px;
    display: none;
    flex-direction: column;
    gap: 5px;
}

/* Стили для переключателей слоёв */
.layer-toggle {
    margin-top: 10px;
}

.layer-toggle label {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.layer-toggle input {
    margin-right: 10px;
    cursor: pointer;
}

/* =================== Бургер-меню для сравнения слоев =================== */

/* Контейнеры для меню чекбоксов слоев сравнения */
.compare-layer-controls {
    position: absolute;
    top: 10px; /* Выравниваем по высоте с бургер-меню */
    z-index: 20;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    width: 200px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.compare-layer-controls.open {
    max-height: 300px;
    opacity: 1;
    margin-top: 0;
}

#beforeLayerControls {
    left: 60px;
}

#afterLayerControls {
    right: 60px;
}

/* Метка для бургер-меню сравнения слоев */
.compare-menu-toggle {
    position: absolute;
    top: 10px; /* Оставляем в верху */
    z-index: 21;
    width: 40px; /* Вернули к исходному размеру */
    height: 40px; /* Вернули к исходному размеру */
    border-radius: 50%;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

#beforeMenuToggle {
    left: 10px;
}

#afterMenuToggle {
    right: 10px;
}

.compare-menu-toggle span {
    display: block;
    width: 20px; /* Вернули к исходному размеру */
    height: 3px; /* Вернули к исходному размеру */
    background-color: #333;
    margin: 2px 0;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.compare-menu-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px); /* Вернули к исходным значениям */
}

.compare-menu-toggle.open span:nth-child(2) {
    opacity: 0;
}

.compare-menu-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px); /* Вернули к исходным значениям */
}

/* Стили для чекбоксов в меню слоев */
.compare-layer-item {
    margin-bottom: 10px;
}

.compare-layer-item label {
    display: flex;
    align-items: center;
    font-size: 16px;
    cursor: pointer;
}

.compare-layer-item input[type="checkbox"] {
    margin-right: 10px;
    width: 16px;
    height: 16px;
}

/* Стиль для активной метки чекбокса */
.compare-layer-item input[type="checkbox"]:checked + span {
    font-weight: bold;
    color: #2980b9;
}

/* =================== Бургер-меню для основных настроек =================== */

/* Скрытый чекбокс для бургер-меню */
.menu-toggle-checkbox {
    display: none;
}

/* Метка-бургер */
.menu-toggle-label {
    display: none; /* Скрыть по умолчанию, показать в медиазапросах */
    position: absolute;
    top: 10px;
    left: 10px;
    width: 30px;
    height: 25px;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle-label span {
    display: block;
    width: 100%;
    height: 4px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Анимация бургер-иконки при открытии меню */
.menu-toggle-checkbox:checked + .menu-toggle-label span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle-checkbox:checked + .menu-toggle-label span:nth-child(2) {
    opacity: 0;
}

.menu-toggle-checkbox:checked + .menu-toggle-label span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
} 

/* Поисковый контейнер */
.search-container {
    position: relative; /* Важно для абсолютного позиционирования дочерних элементов */
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

/* Стиль для текстовых полей */
#combinedSearchBox {
    width: 100%;
    padding: 8px 40px 8px 5px; /* Выравниваем левый отступ с секциями */
    margin-top: 5px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    flex: 1; /* Поле ввода занимает все доступное пространство */
}

/* Стили для предложений поиска */
.search-suggestions {
    position: absolute;
    top: 100%; /* Позиционируем под полем ввода */
    left: 0;
    width: 100%;
    background-color: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1002;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.search-suggestions div {
    padding: 8px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.search-suggestions div:hover {
    background-color: #f0f0f0;
}

/* Убираем общие стили для кнопок в .controls, чтобы не конфликтовать */
.controls button {
    /* Эти стили больше не нужны здесь */
}

/* Новые стили для кнопки поиска */
.search-button {
    position: absolute;
    right: 0px; /* Небольшой отступ справа */
    top: calc(50% - 3px); /* Смещаем на 1px вверх */
    transform: translateY(-50%);

    border: none;
    cursor: pointer;
    padding: 0;
    width: 36px; /* Фиксированная ширина */
    height: 35px; /* Фиксированная высота */
    font-size: 16px;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover {
    color: #000;
}

/* Сообщение об ошибке */
.error-message {
    color: red;
    font-size: 14px;
    margin-top: 5px;
}

/* Стиль для кнопок */
button {
    width: 100%;
    margin-top: 10px;
    padding: 8px 15px;
    background-color: #2980b9;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #3498db;
} 

.controls {
    /* Сбрасываем абсолютное позиционирование */
    position: static;
    width: auto; /* Автоматическая ширина, чтобы вписаться в сайдбар */
    box-shadow: none;
    background-color: transparent;
    padding: 0 0 15px 0; /* Добавляем отступ снизу */
}

/* Глобальные стили для кнопок, если нужны */
button {
    width: 100%;
    margin-top: 10px;
    padding: 8px 15px;
    background-color: #2980b9;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #3498db;
} 