/* Универсальные стили для кнопок управления */
.generic-control-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.generic-control-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Кнопки в панелях редактирования используют те же стили */
.route-edit-btn,
.polygon-edit-btn,
.route-control-btn {
    /* Наследуют стили от .generic-control-btn */
    /* Дополнительные стили не нужны */
}

/* Специфические стили для различных типов кнопок */
.generic-cancel-btn {
    background-color: #dc3545;
    color: white;
}

.generic-cancel-btn:hover {
    background-color: #c82333;
}

.generic-undo-btn {
    background-color: #ffc107;
    color: black;
}

.generic-undo-btn:hover {
    background-color: #e0a800;
}

.generic-save-btn {
    background-color: #28a745;
    color: white;
}

.generic-save-btn:hover {
    background-color: #218838;
}

.generic-continue-btn {
    background-color: #007bff;
    color: white;
}

.generic-continue-btn:hover {
    background-color: #0056b3;
}

.generic-continue-btn:disabled,
.generic-continue-btn.disabled {
    background-color: #6c757d !important;
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

.generic-edit-nodes-btn {
    background-color: #6f42c1;
    color: white;
}

.generic-edit-nodes-btn:hover {
    background-color: #5a32a3;
}

/* Сброс стандартных стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    height: 100vh;
    overflow: hidden;
}

/* Контейнер карты */
#map {
    width: 100%;
    height: 100vh;
    z-index: 1;
}

/* Кнопка генерации точки (иконка) */
.generate-icon-btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    font-size: 24px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.generate-icon-btn:hover {
    background-color: #5a6268;
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.generate-icon-btn:active {
    transform: scale(0.98);
}

/* Стили для контролов карты */
.leaflet-control-layers {
    background-color: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Стили для контрола местоположения - размещение под контролом zoom */
.leaflet-top.leaflet-left {
    display: flex;
    flex-direction: column;
    gap: 5px; /* Небольшой зазор между контролами */
}

.leaflet-control-locate {
    position: static; /* Сбрасываем позиционирование */
}

/* Кнопка настроек */
.settings-btn {
    position: absolute;
    bottom: 20px;
    left: 20px;
    padding: 10px 15px;
    font-size: 18px;
    background-color: #ffffff;
    color: rgb(41, 41, 41);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    width: 130px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-btn:hover {
    background-color: #f5f5f5;
    box-shadow: 0 6px 6px rgba(0, 0, 0, 0.3);
}

/* Панель настроек */
.settings-panel {
    position: absolute;
    bottom: 80px;
    left: 20px;
    width: 300px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    padding: 20px;
    display: none; /* Скрыта по умолчанию */
}

.settings-panel.active {
    display: block; /* Отображается когда активна */
}

.settings-panel h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    text-align: center;
}

/* Заголовок панели настроек с кнопкой закрытия */
.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.close-settings-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
    margin-left: auto;
}

.close-settings-btn:hover {
    background-color: #f0f0f0;
    color: #333;
}

.routes-btn {
    position: absolute;
    bottom: 20px;
    left: 160px;
    padding: 10px 15px;
    font-size: 18px;
    background-color: #ffffff;
    color: rgb(41, 41, 41);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    width: 130px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.routes-btn:hover {
    background-color: #f5f5f5;
    box-shadow: 0 6px 6px rgba(0, 0, 0, 0.3);
}

/* Панель маршрутов */
.routes-panel {
    position: absolute;
    bottom: 80px;
    left: 20px;
    width: 430px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    padding: 20px;
    display: none; /* Скрыта по умолчанию */
}

.routes-panel.active {
    display: block; /* Отображается когда активна */
}

.routes-panel h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    text-align: center;
}

/* Заголовок панели маршрутов с кнопкой закрытия */
.routes-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 10px;
}

.close-routes-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-routes-btn:hover {
    background-color: #f0f0f0;
    color: #333;
}

/* Стили для элемента маршрута */
.route-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
    background-color: #f9f9f9;
}

.route-info {
    flex-grow: 1;
}

.route-name {
    font-size: 14px;
    /*font-weight: bold;*/
    margin-bottom: 5px;
}

.route-distance {
    font-size: 14px;
    color: #666;
}

.route-actions {
    display: flex;
    gap: 5px;
}

.route-action-btn {
    background: none;
    border: 1px solid #ddd;
    font-size: 16px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.route-action-btn:hover {
    background-color: #e0e0e0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.create_route-btn {
    position: absolute;
    bottom: 20px;
    left: 300px;
    padding: 10px 15px;
    font-size: 18px;
    background-color: #ffffff;
    color: rgb(41, 41, 41);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.create_route-btn:hover {
    background-color: #f5f5f5;
    box-shadow: 0 6px 6px rgba(0, 0, 0, 0.3);
}

.create-point-btn {
    position: absolute;
    bottom: 20px;
    left: 360px;
    padding: 10px 15px;
    font-size: 18px;
    background-color: #ffffff;
    color: rgb(41, 41, 41);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.create-point-btn:hover {
    background-color: #f5f5f5;
    box-shadow: 0 6px 6px rgba(0, 0, 0, 0.3);
}

.create-point-btn.active {
    background-color: #007bff;
    color: white;
}

/* Кнопки для работы с полигонами */
.polygon-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    font-size: 16px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.polygon-btn:hover {
    background-color: #5a6268;
}

.polygon-btn:last-child {
    margin-bottom: 0;
}

.polygon-btn.active {
    background-color: #007bff;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}

.save-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #4CAF50;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1000;
}

.save-indicator.show {
    opacity: 1;
}

/* Стили для заголовка приложения */
.app-title {
    position: absolute;
    top: 20px;
    left: 70px;
    font-size: 18px;
    font-weight: bold;
    color: #292e42;
    /*text-shadow:
        -2px 0 black,
        2px -2px 0 black,
        -2px 2px 0 black,
        2px 2px 0 black;*/
    z-index: 1000;
    pointer-events: none;
    background-color: rgba(255, 255, 255, 0.932);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    padding: 5px 10px;
    border-radius: 5px;
}

/* Стили для модального окна с координатами */
.coordinate-modal {
    position: fixed;
    top: 50%;
    left: 10%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    min-width: 300px;
    text-align: center;
}

.coordinate-modal h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.coordinate-display {
    font-size: 18px;
    margin: 15px 0;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 5px;
    word-break: break-all;
}

.coordinate-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.coordinate-btn {
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    color: white;
}

.copy-btn {
    background-color: #2196F3;
}

.copy-btn:hover {
    background-color: #1976D2;
}

.google-maps-btn {
    background-color: #4CAF50;
}

.google-maps-btn:hover {
    background-color: #45a049;
}

.yandex-maps-btn {
    background-color: #FF9800;
}

.yandex-maps-btn:hover {
    background-color: #F57C00;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
}

/* Стили для чекбокса "Скрыть области" */
.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Панель управления созданием маршрута */
.route-controls {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: none; /* Скрыта по умолчанию */
    flex-direction: row;
    gap: 10px;
    z-index: 1000;
    background-color: white;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.route-controls.active {
    display: flex; /* Отображается когда активна */
}

.checkbox-label {
    display: flex;
    align-items: center;
    margin: 10px 0;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Стили для плавающего окна редактирования маршрута */
.route-edit-controls {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: none; /* Скрыта по умолчанию */
    flex-direction: row;
    gap: 10px;
    z-index: 1000;
    background-color: white;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.route-edit-controls.active {
    display: flex;
}


/* Стили для плавающего окна редактирования полигона */
.polygon-edit-controls {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: none; /* Скрыта по умолчанию */
    flex-direction: row;
    gap: 10px;
    z-index: 1000;
    background-color: white;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.polygon-edit-controls.active {
    display: flex;
}


/* Стили для модального окна настроек маршрута */
.route-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    min-width: 400px;
    max-width: 500px;
    text-align: center;
    position: relative;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.modal-body {
    margin: 20px 0;
}

.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input[type="text"],
.form-group textarea,
.form-group input[type="color"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.form-group textarea {
    height: 80px;
    resize: vertical;
}

.form-group input[type="color"] {
    height: 40px;
    cursor: pointer;
}

/* Палитра готовых цветов */
.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.color-swatch:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.color-swatch.selected {
    border-color: #888;
    transform: scale(1.1);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    color: white;
}

.modal-btn.save-btn {
    background-color: #28a745;
}

.modal-btn.save-btn:hover {
    background-color: #218838;
}

.modal-btn.cancel-btn {
    background-color: #dc3545;
}

.modal-btn.cancel-btn:hover {
    background-color: #c82333;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
}

.close-modal:hover {
    color: #333;
}

/* Стили для иконки обратной связи через Telegram */
.telegram-feedback {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #ffffff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 0;
}

.telegram-feedback img {
    width: 30px;
    height: 30px;
}

.telegram-feedback:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.4);
    background-color: #2aabee;
}

/* Кнопка доната */
.donate-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #ffffff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 0;
    font-size: 22px;
}

.donate-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.4);
    background-color: #fff3cd;
}

/* Модальное окно доната */
.donate-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}

.donate-modal.active {
    display: flex;
}

.donate-modal-content {
    background: white;
    padding: 30px 25px 25px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    min-width: 320px;
    max-width: 420px;
    text-align: center;
    position: relative;
    animation: modalFadeIn 0.2s ease;
}

.donate-modal-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 20px;
}

.donate-modal-text {
    color: #555;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 25px;
}

.donate-link-btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: #f5a623;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.donate-link-btn:hover {
    background-color: #e0951a;
    transform: scale(1.03);
    box-shadow: 0 4px 10px rgba(245, 166, 35, 0.4);
}

.close-donate-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-donate-modal:hover {
    background-color: #f0f0f0;
    color: #333;
}

@media (max-width: 600px) {
    .donate-modal-content {
        min-width: 290px;
        margin: 20px;
    }
}

/* Стили для модального окна обратной связи */
.feedback-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}

.feedback-modal.active {
    display: flex;
}

.feedback-modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    min-width: 400px;
    max-width: 500px;
    text-align: center;
    position: relative;
}

.feedback-modal-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.feedback-modal-body {
    margin: 20px 0;
}

.feedback-modal-body .form-group {
    margin-bottom: 15px;
    text-align: left;
}

.feedback-modal-body .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.feedback-modal-body .form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    resize: vertical;
    font-family: inherit;
}

.feedback-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.feedback-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    color: white;
}

.send-telegram-btn {
    background-color: #0088cc;
}

.send-telegram-btn:hover {
    background-color: #0077b5;
}

.close-feedback-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-feedback-modal:hover {
    background-color: #f0f0f0;
    color: #333;
}

/* ===============================
   ПОИСК
   =============================== */
.search-container {
    position: absolute;
    top: 20px;
    left: 210px;
    display: flex;
    gap: 5px;
    z-index: 1000;
    background: white;
    padding: 5px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

@media (max-width: 600px) {
    .search-container {
        top: 20px;
        left: 180px;
    }
    .search-input {
        width: 140px;
    }
}

.search-input {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 14px;
    width: 250px;
    outline: none;
    font-family: Arial, sans-serif;
}

.search-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.15);
}

.search-btn {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background-color: #0056b3;
}

/* ===============================
   НАСТРОЙКИ маркера узла маршрута
   =============================== */

:root {
    --vertex-size: 10px;                 /* базовый размер */
    --vertex-hover-size: 14px;           /* размер при наведении */
    --vertex-drag-size: 16px;            /* размер при перетаскивании */

    --vertex-color: #ffffff;             /* цвет заливки */
    --vertex-opacity: 0.9;               /* прозрачность */

    --vertex-border-color: #ff1515;      /* цвет обводки */
    --vertex-border-width: 1px;          /* толщина обводки */

    --vertex-hover-color: #ff1515;       /* цвет при hover / drag */

    --vertex-shadow: 0 0 2px rgba(0,0,0,0.4);
    --vertex-hover-shadow: 0 0 8px rgba(255, 21, 21, 0.9);
    --vertex-drag-shadow: 0 0 12px rgba(255, 21, 21, 1);
}

/*
   ОБЫЧНОЕ СОСТОЯНИЕ
*/

.leaflet-editing-icon {
    width: var(--vertex-size) !important;
    height: var(--vertex-size) !important;

    margin-left: calc(var(--vertex-size) / -2) !important;
    margin-top: calc(var(--vertex-size) / -2) !important;

    border-radius: 50%;

    background-color: var(--vertex-color);
    opacity: var(--vertex-opacity);

    border: var(--vertex-border-width) solid var(--vertex-border-color);
    box-shadow: var(--vertex-shadow);

    cursor: pointer;

    transition:
        width 0.12s ease,
        height 0.12s ease,
        margin 0.12s ease,
        background-color 0.12s ease,
        opacity 0.12s ease,
        box-shadow 0.12s ease;
}

/*
   HOVER
*/

.leaflet-editing-icon:hover {
    width: var(--vertex-hover-size) !important;
    height: var(--vertex-hover-size) !important;

    margin-left: calc(var(--vertex-hover-size) / -2) !important;
    margin-top: calc(var(--vertex-hover-size) / -2) !important;

    background-color: var(--vertex-hover-color);
    opacity: 1;
    box-shadow: var(--vertex-hover-shadow);
}

/*
   ACTIVE DRAG
*/

/*.leaflet-editing-icon.leaflet-drag-target {
    width: var(--vertex-drag-size) !important;
    height: var(--vertex-drag-size) !important;

    margin-left: calc(var(--vertex-drag-size) / -2) !important;
    margin-top: calc(var(--vertex-drag-size) / -2) !important;

    background-color: var(--vertex-hover-color);
    opacity: 1;
    box-shadow: var(--vertex-drag-shadow);
}*/

/* Стили для кнопок контактов */
.contact-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: pointer;
}

.contact-btn img {
    width: 24px;
    height: 24px;
}

.telegram-contact {
    background-color: #0088cc;
    color: white;
    border: none;
}

.telegram-contact:hover {
    background-color: #006699;
    transform: scale(1.02);
}

.email-contact {
    background-color: #ea4335;
    color: white;
    border: none;
}

.email-contact:hover {
    background-color: #c5221f;
    transform: scale(1.02);
}

.vk-contact {
    background-color: #4a76a8;
    color: white;
    border: none;
}

.vk-contact:hover {
    background-color: #3a5a80;
    transform: scale(1.02);
}

/* Адаптация для мобильных устройств */
@media (max-width: 600px) {
    .feedback-modal-content {
        min-width: 300px;
        margin: 20px;
    }

    .contact-btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .contact-btn img {
        width: 20px;
        height: 20px;
    }
}

/* Стили для универсальных модальных окон */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.custom-modal-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    min-width: 300px;
    max-width: 90%;
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.custom-modal-content {
    position: relative;
    padding: 20px;
}

.custom-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.custom-modal-close:hover {
    background-color: #f0f0f0;
    color: #333;
}

.custom-modal-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    text-align: center;
    padding-right: 20px;
}

.custom-modal-body {
    margin: 20px 0;
}

.custom-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.custom-modal-buttons .modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    color: white;
    transition: all 0.2s;
}

.custom-modal-buttons .modal-btn.save-btn {
    background-color: #28a745;
}

.custom-modal-buttons .modal-btn.save-btn:hover {
    background-color: #218838;
}

.custom-modal-buttons .modal-btn.cancel-btn {
    background-color: #dc3545;
}

.custom-modal-buttons .modal-btn.cancel-btn:hover {
    background-color: #c82333;
}

/* Стили для ряда кнопок управления полигонами */
.polygon-actions-row {
    display: flex;
    gap: 6px;
    margin-bottom: 15px;
}

/* Квадратные кнопки с эмодзи */
.polygon-action-btn {
    width: 25px;
    height: 25px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    /* Убираем flex: 1 */
}

.polygon-action-btn:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.polygon-action-btn:active {
    transform: translateY(0);
}

.polygon-action-btn.active {
    background-color: #007bff;
    box-shadow: 0 0 4px rgba(0, 123, 255, 0.5);
}

/* Стили для тултипов при наведении */
.polygon-action-btn[title] {
    position: relative;
}

.polygon-action-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    font-family: Arial, sans-serif;
}

/* Адаптация для мобильных устройств */
@media (max-width: 600px) {
    .polygon-action-btn {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }
    
    .polygon-action-btn[title]:hover::after {
        font-size: 9px;
        bottom: -25px;
        padding: 3px 6px;
    }
}

/* Стили для email кнопки с копированием */
.email-contact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 15px;
    background-color: #ea4335;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.email-contact:hover {
    background-color: #c5221f;
    transform: scale(1.02);
}

.email-text {
    flex: 1;
    font-size: 14px;
    font-weight: normal;
    text-align: left;
}

.copy-email-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 5px;
    padding: 5px 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-email-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.copy-email-btn:active {
    transform: scale(0.95);
}

/* Адаптация для мобильных устройств */
@media (max-width: 600px) {
    .email-text {
        font-size: 12px;
    }
    
    .copy-email-btn {
        padding: 4px 6px;
        font-size: 12px;
    }
}

/* ===============================
   ВКЛАДКИ В ПАНЕЛИ "МАРШРУТЫ"
   =============================== */

.routes-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.routes-tab {
    flex: 1;
    padding: 8px 12px;
    background-color: #f5f5f5;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    transition: all 0.2s ease;
}

.routes-tab:hover {
    background-color: #e8e8e8;
}

.routes-tab.active {
    background-color: #007bff;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.routes-tab-content {
    display: none;
}

.routes-tab-content.active {
    display: block;
}

/* ===============================
   СПИСОК СОХРАНЁННЫХ ТОЧЕК
   =============================== */

.tab-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    margin-bottom: 10px;
}

.toolbar-btn {
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.toolbar-btn:hover {
    background-color: #f0f0f0;
}

.saved-points-empty {
    text-align: center;
    color: #999;
    font-size: 14px;
    padding: 20px 10px;
}

.saved-point-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 6px;
    margin-bottom: 8px;
    background-color: #fafafa;
    transition: background-color 0.2s;
}

.saved-point-item:hover {
    background-color: #f0f0f0;
}

.saved-point-info {
    flex: 1;
    min-width: 0;
    margin-right: 8px;
}

.saved-point-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    word-break: break-all;
    margin-bottom: 4px;
}

.saved-point-coords {
    font-size: 11px;
    color: #888;
}

.saved-point-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.saved-point-btn {
    width: 30px;
    height: 30px;
    background: none;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.saved-point-btn:hover {
    background-color: #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#tab-content-points {
    max-height: 400px;
    overflow-y: auto;
}

/* ===============================
   ВКЛАДКИ В ПАНЕЛИ "ОБЛАСТИ"
   =============================== */

.settings-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.settings-tab {
    flex: 1;
    padding: 8px 12px;
    background-color: #f5f5f5;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    transition: all 0.2s ease;
}

.settings-tab:hover {
    background-color: #e8e8e8;
}

.settings-tab.active {
    background-color: #007bff;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.settings-tab-content {
    display: none;
}

.settings-tab-content.active {
    display: block;
}

/* ===============================
   СПИСОК СЛУЧАЙНЫХ ТОЧЕК
   =============================== */

.random-points-empty {
    text-align: center;
    color: #999;
    font-size: 14px;
    padding: 20px 10px;
}

.random-point-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 6px;
    margin-bottom: 8px;
    background-color: #fafafa;
    transition: background-color 0.2s;
}

.random-point-item:hover {
    background-color: #f0f0f0;
}

.random-point-info {
    flex: 1;
    min-width: 0;
    margin-right: 8px;
}

.random-point-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    word-break: break-all;
    margin-bottom: 4px;
}

.random-point-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
}

.random-point-distance {
    color: #007bff;
    font-weight: 500;
}

.random-point-date {
    color: #888;
}

.random-point-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.random-point-btn {
    width: 30px;
    height: 30px;
    background: none;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.random-point-btn:hover {
    background-color: #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.clear-points-btn {
    width: 100%;
    padding: 8px;
    margin-top: 10px;
    font-size: 13px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-points-btn:hover {
    background-color: #c82333;
}

#tab-points {
    max-height: 400px;
    overflow-y: auto;
}

/* Адаптация для мобильных устройств */
@media (max-width: 600px) {
    .random-point-name {
        font-size: 12px;
    }

    .random-point-meta {
        font-size: 10px;
    }

    .random-point-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}