* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #1a1a1a;
    color: #fff;
    overflow: hidden;
}

.container {
    display: grid;
    grid-template-rows: auto 1fr;
    grid-template-columns: 1fr 300px;
    height: 100vh;
    gap: 10px;
    padding: 10px;
}

.header {
    background-color: #2d2d2d;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #444;
    grid-column: 1 / -1;
}

.header h1 {
    margin-bottom: 8px;
    color: #e74c3c;
    font-size: 1.5em;
}

.controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.controls-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* Базовые стили для элементов управления */
.controls button, .controls select, .controls input {
    padding: 6px 10px;
    color: white;
    border: 1px solid #4a6572;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 0.9em;
}

/* Базовые цвета для кнопок */
.controls button:not(.help-btn) {
    background-color: #34495e;
}

.controls button:not(.help-btn):hover {
    background-color: #4a6572;
}

/* Специфичные кнопки */
.controls button#addMarkerBtn,
.controls button#searchBtn,
.controls button#addMarkerByCoords,
.controls button#imHereBtn {
    background-color: #3498db !important;
}

.controls button#addMarkerBtn:hover,
.controls button#searchBtn:hover,
.controls button#addMarkerByCoords:hover,
.controls button#imHereBtn:hover {
    background-color: #2980b9 !important;
}

.controls button#clearMarkersBtn {
    background-color: #e74c3c !important;
}

.controls button#clearMarkersBtn:hover {
    background-color: #c0392b !important;
}

.controls button#centerCoordsBtn {
    background-color: #9b59b6 !important;
}

.controls button#centerCoordsBtn:hover {
    background-color: #8e44ad !important;
}

/* Кнопка экспорта */
.controls button:last-child:not(.help-btn) {
    background-color: #f39c12 !important;
}

.controls button:last-child:not(.help-btn):hover {
    background-color: #e67e22 !important;
}

/* Поля ввода и селекты */
.controls input,
.controls select {
    background-color: #34495e;
    flex-grow: 1;
    min-width: 150px;
}

.controls input:focus,
.controls select:focus {
    outline: none;
    border-color: #3498db;
}

/* Основные контейнеры */
.map-container {
    background-color: #2d2d2d;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #444;
    grid-column: 1;
}

#map {
    width: 100%;
    height: 100%;
    background-color: #121212;
}

.sidebar {
    background-color: #2d2d2d;
    border-radius: 8px;
    border: 1px solid #444;
    display: flex;
    flex-direction: column;
    grid-column: 2;
    min-height: 0;
}

/* Поиск меток */
.markers-search {
    padding: 12px;
    background: #2d2d2d;
    border-bottom: 1px solid #444;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.markers-search input,
.markers-search select {
    width: 100%;
    padding: 8px;
    background: #444;
    color: white;
    border: 1px solid #666;
    border-radius: 3px;
    font-size: 0.9em;
}

.search-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.search-buttons button {
    flex: 1;
    padding: 6px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85em;
    min-width: 60px;
}

/* Цвета кнопок поиска */
.search-buttons button#searchBtn { background: #3498db !important; }
.search-buttons button#searchBtn:hover { background: #2980b9 !important; }

.search-buttons button#showAllBtn { background: #27ae60 !important; }
.search-buttons button#showAllBtn:hover { background: #229954 !important; }

.search-buttons button#hideOthersBtn,
.search-buttons button#exportFilteredToServersBtn { 
    background: #f39c12 !important; 
}
.search-buttons button#hideOthersBtn:hover,
.search-buttons button#exportFilteredToServersBtn:hover { 
    background: #e67e22 !important; 
}

.search-buttons button:disabled {
    background: #7f8c8d !important;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Список меток */
.markers-list {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.markers-list h3 {
    margin-bottom: 10px;
    color: #e74c3c;
    font-size: 1.1em;
    display: flex;
    align-items: center;
}

#markersContainer {
    flex: 1;
    overflow-y: auto;
}

/* Элемент метки - ОПТИМИЗИРОВАНО: объединены дублирующиеся стили */
.marker-item {
    background-color: #34495e;
    padding: 8px;
    margin: 4px 0;
    border-radius: 4px;
    border-left: 4px solid #e74c3c;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    transition: all 0.2s ease;
    cursor: pointer;
}

.marker-item:hover {
    background-color: #3d566e !important;
    transform: translateX(2px);
}

.marker-item.selected {
    background-color: #2c3e50 !important;
    border-left: 6px solid #f39c12 !important; /* Увеличили толщину и яркость */
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.4); /* Добавили свечение */
    z-index: 1;
    position: relative;
}

/* УБЕДИТЕСЬ, ЧТО ЦВЕТ ТЕКСТА ХОРОШО ЧИТАЕТСЯ */
.marker-item.selected strong {
    color: #ecf0f1 !important;
}

.marker-item.selected .coords {
    color: #bdc3c7 !important;
}

.marker-item.selected .type {
    color: #f39c12 !important; /* Оранжевый цвет для типа */
    font-weight: bold;
}

/* Переопределение для выбранных меток - ВАЖНО: оранжевая полоса всегда ПРИОРИТЕТНА */
.marker-item.selected {
    border-left-color: #f39c12 !important;
}

/* Усилим анимацию подсветки на карте */
.marker-highlighted {
    animation: pulse 2s ease-in-out infinite; /* Бесконечная анимация */
    z-index: 1000;
}

@keyframes pulse {
    0%, 100% {
        filter: drop-shadow(0 0 5px rgba(243, 156, 18, 0.7));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(243, 156, 18, 1));
    }
}

.marker-item .coords {
    color: #95a5a6;
    font-size: 0.8em;
}

.marker-item .type {
    color: #bdc3c7;
    font-size: 0.8em;
    margin-top: 2px;
}

.marker-item .delete {
    background-color: #c0392b;
    color: white;
    border: none;
    padding: 3px 6px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.2s ease;
}

.marker-item .delete:hover {
    background-color: #e74c3c;
    transform: scale(1.1);
}

/* Цвета типов меток - ОПТИМИЗИРОВАНО: убран !important где возможно */
.marker-default { border-left-color: #3498db; }
.marker-home { border-left-color: #e74c3c; }
.marker-camp { border-left-color: #27ae60; }
.marker-safezone { border-left-color: #2ecc71; }
.marker-blackmarket { border-left-color: #34495e; }
.marker-hospital { border-left-color: #e74c8c; }
.marker-sniper { border-left-color: #c0392b; }
.marker-player { border-left-color: #9b59b6; }
.marker-flag { border-left-color: #d35400; }
.marker-star { border-left-color: #f1c40f; }
.marker-car { border-left-color: #16a085; }
.marker-parking { border-left-color: #7f8c8d; }
.marker-heli { border-left-color: #2980b9; }
.marker-rail { border-left-color: #8e44ad; }
.marker-ship { border-left-color: #3498db; }
.marker-scooter { border-left-color: #1abc9c; }
.marker-bank { border-left-color: #f39c12; }
.marker-restaurant { border-left-color: #e67e22; }
.marker-post { border-left-color: #95a5a6; }
.marker-castle { border-left-color: #7d3c98; }
.marker-ranger-station { border-left-color: #27ae60; }
.marker-water { border-left-color: #3498db; }
.marker-triangle { border-left-color: #e74c3c; }
.marker-cow { border-left-color: #8b4513; }
.marker-bear { border-left-color: #2c3e50; }
.marker-car-repair { border-left-color: #d35400; }
.marker-communications { border-left-color: #9b59b6; }
.marker-roadblock { border-left-color: #c0392b; }
.marker-stadium { border-left-color: #f1c40f; }
.marker-skull { border-left-color: #2c3e50; }
.marker-rocket { border-left-color: #e74c3c; }
.marker-bbq { border-left-color: #d35400; }
.marker-ping { border-left-color: #2ecc71; }
.marker-circle,
.marker-cross { border-left-color: #3498db; }

/* Переопределение для выбранных меток - ВАЖНО: оранжевая полоса всегда */
.marker-item.selected {
    border-left-color: #f39c12 !important;
}

/* Leaflet стили */
.custom-marker,
.marker-popup,
.grid-label,
.leaflet-div-icon {
    background: none !important;
    border: none !important;
}

.marker-popup {
    font-family: 'Arial', sans-serif;
}

.no-results {
    padding: 10px;
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    font-size: 0.9em;
}

/* Скрыть кнопку "Скрыть остальные" */
#hideOthersBtn {
    display: none !important;
}

/* Слайдеры прозрачности */
.control-group {
    background: #2d2d2d;
    padding: 10px;
    margin: 5px 0;
    border-radius: 5px;
    border: 1px solid #444;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #ecf0f1;
}

.control-group input[type="range"] {
    width: 100%;
    margin: 5px 0;
}

.control-group span {
    font-size: 0.8em;
    color: #bdc3c7;
}

#markersCounter {
    color: #95a5a6;
    font-size: 0.9em;
    font-weight: normal;
    margin-left: 8px;
    transition: color 0.3s;
}

.markers-list:hover #markersCounter {
    color: #bdc3c7;
}

/* Оси карты */
#map-axes-container,
.axis-label {
    pointer-events: none !important;
}

.axis-label {
    z-index: 500 !important;
}

/* Координатные поля */
.coord-inputs {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
}

.coord-inputs input {
    width: 80px;
    padding: 6px;
    background: #444;
    color: white;
    border: 1px solid #666;
    border-radius: 3px;
    font-size: 0.9em;
}

.coord-inputs input[type="text"] {
    width: 200px;
}

.coord-inputs button {
    padding: 6px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
    white-space: nowrap;
}

/* Разделители */
.control-separator {
    width: 1px;
    height: 30px;
    background: #555;
    margin: 0 5px;
}

/* Модальные окна */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
}

.modal-overlay.active {
    display: block;
}

.marker-modal {
    position: fixed !important;
    background: #2d2d2d !important;
    border: 2px solid #444 !important;
    border-radius: 8px !important;
    color: white !important;
    z-index: 10000 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    user-select: none !important;
    min-width: 420px;
    max-width: 90vw;
    max-height: 90vh;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
}

.modal-header {
    cursor: move;
    background: #34495e;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    user-select: none;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    color: white;
    font-size: 1.2em;
    font-weight: bold;
    padding: 0;
    line-height: 1.2;
    flex: 1;
    margin-right: 15px;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
    flex-shrink: 0;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-right: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #34495e;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #7f8c8d;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* Элементы модального окна */
.modal-field {
    margin-bottom: 0;
}

.modal-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #ecf0f1;
    font-size: 14px;
}

.modal-field input,
.modal-field select {
    width: 100%;
    padding: 10px;
    background: #444;
    color: white;
    border: 1px solid #666;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.modal-field input:focus,
.modal-field select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-shrink: 0;
}

.modal-buttons button {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s;
    flex: 1;
}

/* Цвета кнопок модальных окон */
.modal-buttons button {
    background: #34495e;
    color: white;
}

.modal-buttons button:hover {
    background: #4a6572;
}

.modal-buttons button#saveNewMarker,
.modal-buttons button#saveEdit {
    background: #27ae60 !important;
}

.modal-buttons button#saveNewMarker:hover,
.modal-buttons button#saveEdit:hover {
    background: #229954 !important;
}

.modal-buttons button#deleteMarker {
    background: #e74c3c !important;
}

.modal-buttons button#deleteMarker:hover {
    background: #c0392b !important;
}

.modal-buttons button#cancelNewMarker,
.modal-buttons button#cancelEdit {
    background: #7f8c8d !important;
}

.modal-buttons button#cancelNewMarker:hover,
.modal-buttons button#cancelEdit:hover {
    background: #95a5a6 !important;
}

/* Цветовая палитра */
.color-palette-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.color-inputs {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.color-palette-wrapper {
    flex-shrink: 0;
}

.color-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.color-rgb-inputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-rgb-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-rgb-row span {
    min-width: 20px;
    font-size: 14px;
    font-weight: bold;
}

.color-rgb-row input {
    width: 70px;
    padding: 8px;
    margin: 0;
    background: #444;
    color: white;
    border: 1px solid #666;
    border-radius: 4px;
    font-size: 14px;
}

.color-preview {
    width: 80px;
    height: 60px;
    border: 2px solid white;
    border-radius: 4px;
    flex-shrink: 0;
    margin-top: 8px;
}

/* Анимации */
.marker-highlighted {
    animation: pulse 2s ease-in-out;
    z-index: 1000;
}

@keyframes pulse {
    0%, 100% {
        filter: drop-shadow(0 0 5px rgba(243, 156, 18, 0.7));
    }
    50% {
        filter: drop-shadow(0 0 15px rgba(243, 156, 18, 1));
    }
}

/* Сортировка */
.search-hint-v1 {
	color: #e74c3c;
    font-size: 1.1em;
}

.sort-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.sort-controls h3 {
    margin: 0;
    color: #e74c3c;
    font-size: 1.1em;
    text-align: center;
}

.sort-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.sort-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    color: white;
    border: 1px solid #4a6572;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    transition: all 0.3s ease;
    min-height: 40px;
    position: relative;
    background: #34495e !important;
}

.sort-btn.active {
    background: #3498db !important;
    border-color: #2980b9;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.sort-btn::before {
    content: "";
    font-size: 1em;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sort-btn.asc::before {
    content: "↑";
    opacity: 1;
    color: white;
}

.sort-btn.desc::before {
    content: "↓";
    opacity: 1;
    color: white;
}

/* Кнопки помощи */
.coord-inputs .help-btn {
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    background: none !important;
    color: #3498db !important;
    border: 2px solid #3498db !important;
    font-weight: bold !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
    flex-shrink: 0 !important;
    margin-left: 5px !important;
    padding: 0 !important;
    min-width: auto !important;
}

.coord-inputs .help-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.5);
}

/* Тултипы */
.help-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #3498db;
    max-width: 280px;
    z-index: 10000;
    font-size: 13px;
    line-height: 1.4;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    text-align: center;
}

.help-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #3498db;
}

/* Стили для активного фильтра */
.search-active {
    border: 2px solid #3498db !important;
    background: #2c3e50 !important;
}

/* Подсветка активных полей фильтра */
/*#searchMarkers:not(:placeholder-shown),*/
#searchType:not([value=""]) {
    border-color: #3498db !important;
    background: #2c3e50 !important;
}

/* Стили для выбора серверов */
.servers-selection {
    border: 1px solid #444;
    border-radius: 4px;
    padding: 10px;
    background: #2d2d2d;
}

.server-checkbox {
    transition: background-color 0.3s;
}

.server-checkbox:hover {
    background: #3d566e;
}

.server-checkbox label {
    font-size: 14px;
    color: #ecf0f1;
}

.server-checkbox input[type="checkbox"] {
    transform: scale(1.2);
}

/* Стили для формы экспорта на серверы */
.servers-config {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.server-presets details {
    background: #34495e;
    border-radius: 4px;
    padding: 10px;
}

.server-presets summary {
    cursor: pointer;
    font-weight: bold;
    color: #ecf0f1;
    padding: 5px;
}

.server-presets summary:hover {
    background: #3d566e;
    border-radius: 3px;
}

.preset-servers {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.preset-server {
    padding: 8px 12px;
    background: #2d2d2d;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.preset-server:hover {
    background: #3498db;
    border-color: #2980b9;
}

.custom-servers {
    border: 1px solid #444;
    border-radius: 4px;
    padding: 15px;
    background: #2d2d2d;
}

.servers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.servers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.server-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.server-input-row input {
    flex: 1;
    padding: 8px;
    background: #444;
    color: white;
    border: 1px solid #666;
    border-radius: 4px;
    font-size: 0.9em;
}

.server-ip {
    min-width: 120px;
}

.server-port {
    min-width: 80px;
    max-width: 100px;
}

.remove-server-btn {
    background: #e74c3c !important;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.remove-server-btn:hover {
    background: #c0392b !important;
}

.small-btn {
    padding: 4px 8px !important;
    font-size: 0.8em !important;
    min-width: auto !important;
}

.servers-count {
    font-size: 0.9em;
    color: #bdc3c7;
    text-align: center;
    padding: 5px;
    background: #34495e;
    border-radius: 3px;
}

/* Адаптивность для формы серверов */
@media (max-width: 768px) {
    .server-input-row {
        flex-direction: column;
        gap: 5px;
    }
    
    .server-input-row input {
        width: 100%;
    }
    
    .servers-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .servers-header button {
        width: 100%;
    }
}

/* Стили для временного маркера-индикатора */
.temporary-marker-indicator {
    background: none !important;
    border: none !important;
}

.pulsating-circle {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inner-circle {
    width: 20px;
    height: 20px;
    background: #e74c3c;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 3px #e74c3c, 0 0 20px rgba(231, 76, 60, 0.8);
    z-index: 10;
    position: relative;
    animation: bounce 2s infinite;
}

.pulse-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 60px;
    border: 3px solid #e74c3c;
    border-radius: 50%;
    animation: pulse 2s infinite;
    opacity: 0;
}

.pulse-ring.delay-1 {
    animation-delay: 0.7s;
}

.pulse-ring.delay-2 {
    animation-delay: 1.4s;
}

.coordinates-label {
    position: absolute;
    top: 65px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(231, 76, 60, 0.95);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
    border: 1px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    z-index: 100;
}

/* Анимации для индикатора */
@keyframes pulse {
    0% {
        transform: scale(0.1);
        opacity: 1;
    }
    70% {
        transform: scale(1);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Анимация для плавного появления */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.temporary-marker-indicator {
    animation: fadeIn 0.3s ease-out;
}

/* Поддержка */
.support-info {
    background: #2d2d2d;
    padding: 8px;
    margin: 5px 0;
    border-radius: 5px;
    border: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.support-text {
    color: #ecf0f1;
    font-size: 0.85em;
    font-weight: bold;
}

.support-links {
    display: flex;
    gap: 8px;
}

.telegram-link, .github-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    color: white;
    text-decoration: none;
    border-radius: 3px;
    transition: background-color 0.3s;
    font-size: 0.8em;
}

.telegram-link {
    background: #0088cc;
}

.telegram-link:hover {
    background: #0077b3;
}

.github-link {
    background: #333;
}

.github-link:hover {
    background: #555;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
    
    .sidebar {
        grid-column: 1;
        max-height: 200px;
    }
    
    .controls-row,
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .controls input {
        min-width: auto;
    }
    
    .control-separator {
        width: 100%;
        height: 1px;
        margin: 4px 0;
        background: #555;
    }
    
    .coord-inputs {
        flex-direction: column;
        gap: 5px;
    }
    
    .coord-inputs input[type="text"] {
        width: 100%;
    }
    
    .coord-inputs button {
        width: 100%;
    }
    
    .sort-btn {
        padding: 6px 8px;
        font-size: 0.85em;
        min-height: 36px;
    }
    
    .marker-modal {
        min-width: 320px !important;
        max-width: 95vw !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        top: 20px !important;
        max-height: calc(100vh - 40px) !important;
    }
    
    .color-inputs {
        flex-direction: column;
        gap: 15px;
    }
    
    .color-preview {
        align-self: center;
    }
    
    .color-rgb-inputs {
        width: 100%;
    }
    
    .color-rgb-row input {
        flex: 1;
        width: auto;
    }
}

/* Стили для ползунка радиуса */
.radius-control {
    background: #34495e;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #4a6572;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #5d6d7e;
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #2980b9;
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Стили для модального окна с ближайшими метками */
.nearby-marker-item {
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.nearby-marker-item:hover {
    background: #3d566e !important;
    border-color: #3498db;
    transform: translateX(2px);
}

.edit-nearby-btn {
    transition: all 0.3s ease;
}

.edit-nearby-btn:hover {
    background: #e67e22 !important;
    transform: scale(1.05);
}

/* Адаптивность для ползунков */
@media (max-width: 768px) {
    .radius-control {
        flex-direction: column;
        gap: 8px;
    }
    
    .radius-control button {
        width: 100%;
    }
    
    .nearby-marker-item {
        flex-direction: column;
        gap: 8px;
        text-align: left;
    }
    
    .edit-nearby-btn {
        width: 100%;
        margin-left: 0 !important;
    }
}

/* Стили для круга поиска */
.search-circle {
    stroke-dasharray: 10, 10;
    animation: dash 20s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: -1000;
    }
}

/* Стили для круга поиска */
.search-radius-circle {
    animation: pulse-circle 2s ease-in-out infinite;
}

@keyframes pulse-circle {
    0%, 100% {
        stroke-width: 2px;
        opacity: 0.8;
    }
    50% {
        stroke-width: 3px;
        opacity: 1;
    }
}

.circle-radius-label {
    background: none !important;
    border: none !important;
}

/* Убедимся, что круг не перекрывает важные элементы */
.leaflet-overlay-pane {
    z-index: 400;
}

.leaflet-marker-pane {
    z-index: 500;
}

/* Адаптивность для модальных окон с ближайшими метками */
@media (max-width: 768px) {
    .nearby-marker-item {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .edit-nearby-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .sort-btn {
        padding: 5px 6px;
        font-size: 0.8em;
        min-height: 34px;
    }
    
    .marker-modal {
        min-width: 380px !important;
    }
    
    .color-inputs {
        flex-direction: column;
        gap: 15px;
    }
    
    .color-preview {
        align-self: center;
        width: 100px;
        height: 80px;
    }
}

@media (max-width: 400px) {
    .marker-modal {
        min-width: 350px !important;
    }
    
    .color-inputs {
        gap: 12px;
    }
}

@media (max-height: 800px) {
    .marker-modal {
        max-height: 95vh !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
    }
    
    .modal-content {
        padding: 15px;
        gap: 12px;
    }
    
    .modal-header {
        padding: 12px 15px;
    }
    
    .modal-field input,
    .modal-field select {
        padding: 8px;
    }
    
    .modal-buttons button {
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-height: 600px) {
    .marker-modal {
        max-height: 98vh !important;
        top: 10px !important;
        transform: translateX(-50%) !important;
    }
    
    .modal-content {
        padding: 10px;
        gap: 8px;
    }
    
    .modal-header {
        padding: 10px 12px;
    }
    
    .modal-header h3 {
        font-size: 1.1em;
    }
    
    .modal-field label {
        margin-bottom: 5px;
        font-size: 13px;
    }
    
    .modal-field input,
    .modal-field select {
        padding: 6px 8px;
        font-size: 13px;
    }
    
    .modal-buttons {
        gap: 8px;
        margin-top: 5px;
    }
    
    .modal-buttons button {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .coordinates-display {
        padding: 10px;
        font-size: 13px;
    }
    
    .color-preview {
        width: 50px;
        height: 50px;
    }
    
    .color-rgb-row input {
        width: 60px;
        padding: 6px;
    }
}

/* Стили для временного маркера при добавлении */
.temporary-add-marker-indicator {
    background: none !important;
    border: none !important;
}

.pulsating-add-circle {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-inner-circle {
    width: 24px;
    height: 24px;
    background: #e74c3c;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 3px #e74c3c, 0 0 20px rgba(231, 76, 60, 0.8);
    z-index: 10;
    position: relative;
    animation: add-bounce 2s infinite;
}

.add-pulse-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 60px;
    border: 3px solid #e74c3c;
    border-radius: 50%;
    animation: add-pulse 2s infinite;
    opacity: 0;
}

.add-pulse-ring.add-delay-1 {
    animation-delay: 0.7s;
}

.add-pulse-ring.add-delay-2 {
    animation-delay: 1.4s;
}

.add-coordinates-label {
    position: absolute;
    top: 65px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(231, 76, 60, 0.95);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
    border: 1px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    z-index: 100;
}

/* Анимации для индикатора добавления */
@keyframes add-pulse {
    0% {
        transform: scale(0.1);
        opacity: 1;
    }
    70% {
        transform: scale(1);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

@keyframes add-bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* Анимация для плавного появления */
@keyframes add-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.temporary-add-marker-indicator {
    animation: add-fadeIn 0.3s ease-out;
}

#searchMarkers {
    transition: all 0.3s ease;
}

#searchMarkers:focus {
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

/* Стиль для подсказки в поиске */
.search-hint {
    font-size: 0.8em;
    color: #95a5a6;
    margin-top: 5px;
}

/* Добавим стили для подсказки префиксов */
.search-hint strong {
    color: #e74c3c;
}

/* Подсветка префиксов в поле поиска */
#searchMarkers:not(:placeholder-shown) {
    background: #2c3e50;
}

/* Специальная подсветка для поиска по типу */
#searchMarkers[data-search-type="type"] {
    border-color: #f39c12 !important;
    box-shadow: 0 0 5px rgba(243, 156, 18, 0.5) !important;
}

#searchMarkers[data-search-type="exact-type"] {
    border-color: #e74c3c !important;
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.5) !important;
}

