/* Скопировано из index.html блока <style> */
body {
    /* margin: 0; */ /* Избегайте установки margin для body в CSS плагина */
    /* padding: 0; */ /* Избегайте установки padding для body */
    font-family: Arial, sans-serif;
}

/* Добавьте класс-обертку для лучшего управления стилями */
.mrc-calculator-wrapper {
     width: 100%;
     max-width: 1200px; /* Или сделайте это настраиваемым */
     margin: 20px auto; /* Добавьте отступы */
     padding: 10px;
     box-sizing: border-box;
     border: 1px solid #eee; /* Опциональная граница */
     background-color: #fff; /* Опциональный фон */
}

.mrc-calculator-wrapper .header { /* Ограничение стилей */
    text-align: center;
    margin-bottom: 10px;
}

.mrc-calculator-wrapper .header h1 {
    margin: 0;
    font-size: 24px;
}

#search-form { /* ID достаточно уникален обычно */
    display: flex;
    margin-bottom: 10px;
}

#address-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
    font-size: 16px;
}

#search-form button { /* Рассмотрите использование ID #search-button */
    padding: 10px 15px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 16px;
}
#search-form button:hover {
     background-color: #45a049;
}

.mrc-calculator-wrapper .buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.mrc-calculator-wrapper .buttons button {
    flex-grow: 1;
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}
.mrc-calculator-wrapper .buttons button:hover:not(:disabled) {
     background-color: #45a049;
}

.mrc-calculator-wrapper .buttons button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

#search-container {
    position: relative;
    margin-bottom: 10px;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1001; /* Убедитесь, что он выше элементов управления картой */
    display: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-result-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.search-result-item:hover {
    background-color: #f5f5f5;
}

.search-result-item:last-child {
    border-bottom: none;
}

#map {
    width: 100%;
    height: 50vh; /* Настройте по необходимости */
    min-height: 300px; /* Обеспечьте минимальную высоту */
    margin-bottom: 10px;
    border-radius: 4px;
    z-index: 1; /* Убедитесь, что карта находится ниже результатов поиска/модальных окон */
}

/* Установите курсор как перекрестие при добавлении круга */
.cursor-crosshair {
    cursor: crosshair !important;
}

.mrc-calculator-wrapper .info {
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #eee;
}

.mrc-calculator-wrapper .info p {
    margin: 8px 0; /* Настройте интервалы */
    font-size: 14px;
    word-wrap: break-word; /* Предотвратите переполнение длинными числами */
}

.circles-list {
    margin-top: 10px;
    max-height: 150px; /* Ограничьте высоту */
    overflow-y: auto; /* Добавьте прокрутку при необходимости */
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.circle {
    display: flex;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 5px;
    align-items: center;
    background-color: #fff;
    transition: background-color 0.2s, border-color 0.2s;
}
.circle.selected { /* Добавьте класс для выбранного */
    border-color: #2196F3;
    background-color: #e3f2fd;
}

.circle-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0; /* Предотвратите сжатие */
}

.circle-info {
    flex-grow: 1;
    font-size: 13px; /* Немного меньше */
    cursor: pointer; /* Указывает на кликабельность */
    margin-right: 10px;
}
.circle-info div {
    line-height: 1.4;
}

.delete-btn, .edit-btn {
    padding: 5px 10px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 5px;
    font-size: 13px;
    flex-shrink: 0;
    transition: background-color 0.2s;
}

.delete-btn {
    background-color: #f44336;
}
.delete-btn:hover {
    background-color: #e53935;
}

.edit-btn {
     background-color: #2196F3;
}
.edit-btn:hover {
     background-color: #1e88e5;
}

.mobile-tooltip {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    z-index: 9999;
    max-width: 90%;
    text-align: center;
    font-size: 14px; /* Немного меньше */
    display: none;
    pointer-events: none; /* Предотвратить взаимодействие */
}

.cursor-tooltip {
    position: fixed;
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    z-index: 10001; /* Выше модального наложения */
    pointer-events: none;
    font-size: 13px;
    display: none;
    white-space: nowrap; /* Предотвратить перенос */
}

/* Стили для модального окна ввода радиуса */
.modal {
    display: none;
    position: fixed;
    z-index: 10000; /* Выше других элементов */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto; /* Включить прокрутку при необходимости */
    align-items: center; /* Вертикально по центру */
    justify-content: center; /* Горизонтально по центру */
    display: none; /* Скрыть изначально, использовать flex позже */
}

.modal.active { /* Класс для показа модального окна */
    display: flex;
}

.modal-content {
    background-color: #fefefe;
    /* margin: 15% auto; */ /* Заменено на flex центрирование */
    padding: 20px;
    border: 1px solid #ccc;
    width: 300px;
    max-width: 90%;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.close-button {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1; /* Лучшее выравнивание */
}

.close-button:hover,
.close-button:focus { /* Добавьте стиль фокуса */
    color: black;
    text-decoration: none;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.input-group input {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.input-with-units {
    display: flex;
    gap: 10px;
    flex-direction: column;
}

.input-with-units input {
    flex: 1;
}

.input-with-units select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px; /* Добавьте пространство */
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* Стиль для маркера изменения размера на круге */
.resize-handle {
    cursor: grab !important; /* Обеспечьте курсор захвата */
    background-color: white; /* Обеспечьте видимость */
    border: 2px solid #3388ff; /* Цвет по умолчанию или соответствующий кругу */
    border-radius: 50%;
    width: 14px !important; /* Обеспечьте размер */
    height: 14px !important;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

.resize-handle:active {
    cursor: grabbing !important; /* Обеспечьте курсор захвата */
}

/* Добавьте переопределения специфичные для Leaflet при необходимости */
.leaflet-control-scale-line {
    background-color: rgba(255, 255, 255, 0.7); /* Сделайте шкалу слегка прозрачной */
    border-radius: 3px;
    padding: 2px 5px;
}



/* Добавьте в ваш style.css файл */

/* Стили для поиска адресов */
#search-container {
    position: relative;
    margin-bottom: 15px;
}

#search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 5px;
}

#address-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

#address-input:focus {
    outline: none;
    border-color: #4CAF50;
}

#search-button {
    padding: 8px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

#search-button:hover {
    background-color: #45a049;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.search-result-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.search-result-item:hover {
    background-color: #f5f5f5;
}

.search-result-item:last-child {
    border-bottom: none;
}

/* Индикатор коррекции координат */
.correction-indicator {
    color: #4CAF50 !important;
    font-weight: bold;
    margin-left: 5px;
    font-size: 12px;
    flex-shrink: 0;
}

.search-result-item:hover .correction-indicator {
    color: #45a049 !important;
}

/* Всплывающие подсказки для коррекции */
.correction-info {
    background-color: #e8f5e8;
    border: 1px solid #4CAF50;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 12px;
    color: #2e7d32;
    margin-top: 5px;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    #search-form {
        flex-direction: column;
    }
    
    #search-button {
        margin-top: 5px;
    }
    
    .search-results {
        max-height: 150px;
    }
    
    .search-result-item {
        padding: 12px;
        font-size: 16px; /* Больше для мобильных */
        flex-direction: column;
        align-items: flex-start;
    }
    
    .correction-indicator {
        margin-left: 0;
        margin-top: 2px;
    }
}



/* Добавьте в ваш style.css файл */

/* Стили для маркеров результатов поиска */
.search-result-marker {
    z-index: 1000;
}

/* Анимация пульсации для маркера поиска */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Стили для всплывающих окон маркеров */
.leaflet-popup-content {
    margin: 8px 12px;
    line-height: 1.4;
    font-size: 13px;
    font-family: inherit;
    min-height: 1px;
}

.leaflet-popup-content button {
    transition: background-color 0.3s ease;
    font-size: 12px;
    font-family: inherit;
}

.leaflet-popup-content button:hover {
    background-color: #45a049 !important;
    transform: translateY(-1px);
}

/* Улучшенные стили для результатов поиска */
.search-result-item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 20px;
}

.search-result-item:hover {
    background-color: #f8f9fa;
    border-left: 3px solid #4CAF50;
    padding-left: 9px;
}

.search-result-item:last-child {
    border-bottom: none;
}

/* Индикатор коррекции координат */
.correction-indicator {
    color: #4CAF50 !important;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
    margin-left: 8px;
    padding: 2px 4px;
    border-radius: 3px;
    background-color: rgba(76, 175, 80, 0.1);
}

.search-result-item:hover .correction-indicator {
    color: #2e7d32 !important;
    background-color: rgba(76, 175, 80, 0.2);
}

/* Стили для контейнера текста в результатах */
.search-result-item > div:first-child {
    flex: 1;
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .search-result-item {
        padding: 14px 12px;
        font-size: 16px;
        flex-direction: column;
        align-items: flex-start;
        min-height: auto;
    }
    
    .search-result-item > div:first-child {
        white-space: normal;
        margin-bottom: 4px;
    }
    
    .correction-indicator {
        margin-left: 0;
        align-self: flex-end;
        font-size: 12px;
    }
    
    .leaflet-popup-content {
        font-size: 14px;
        margin: 10px 14px;
    }
    
    .leaflet-popup-content button {
        font-size: 14px;
        padding: 8px 12px !important;
        margin-top: 8px;
    }
}

/* Стили для отладочной информации в консоли */
.debug-info {
    font-family: 'Courier New', monospace;
    background-color: #f5f5f5;
    padding: 5px;
    border-radius: 3px;
    font-size: 11px;
    color: #666;
    margin-top: 5px;
}



/* --- СТИЛИ ДЛЯ ИНФОРМАЦИОННОГО БЛОКА ПОД КАРТОЙ --- */

/* Основной контейнер блока */
.mrc-map-notice {
    display: flex;
    align-items: flex-start; /* Выравнивание по верху для иконки и текста */
    background-color: #eef4f8; /* Мягкий синеватый фон */
    border: 1px solid #c9dce7;
    border-left-width: 4px; /* Акцентная линия слева */
    border-left-color: #5d9cec; /* Приятный синий цвет */
    color: #3c4858; /* Темный, но не черный текст для читаемости */
    padding: 12px 15px;
    margin: 0 0 15px 0; /* Отступ только снизу, до следующего блока */
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.5;
}

/* Контейнер для иконки */
.mrc-map-notice-icon {
    flex-shrink: 0; /* Запрещаем иконке сжиматься */
    margin-right: 12px;
    margin-top: 1px; /* Небольшая коррекция для идеального выравнивания */
    color: #5d9cec; /* Цвет иконки совпадает с акцентной линией */
}

/* Контейнер для текста */
.mrc-map-notice-text {
    flex-grow: 1; /* Текст занимает все оставшееся место */
}

/* Заголовок в блоке */
.mrc-map-notice-text strong {
    font-weight: 600; /* Более насыщенный шрифт */
    display: block; /* Заголовок на отдельной строке */
    margin-bottom: 2px;
    color: #333; /* Сделаем заголовок чуть темнее */
}