#map {
  width: 100%;
  height: 100%; /* Занимает всю высоту контейнера */
  border: none; /* Убираем границу */
  border-radius: 0; /* Убираем скругление углов */
}

.date-navigator {
    flex-wrap: wrap; /* ??? */
}

.date-selector {
    width: 85px;
    flex-shrink: 0;
}

#date-picker {
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    height: 30px;
}

.nav-btn {
    padding: 5px 5px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    flex-shrink: 0;
    min-width: 30px;
    width: auto;
    text-align: center;
    height: 30px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
	
    position: relative;
    font-family: Arial, sans-serif; /* Более предсказуемый шрифт */
    line-height: 1; /* Сбрасываем высоту строки */
    /* top: -1px; /* Искусственное смещение вверх */ */
}

.nav-btn:hover {
    background: #e0e0e0;
}

.nav-btn:disabled {
    background: #f8f8f8;
    color: #aaa;
    cursor: not-allowed;
    opacity: 0.7;
}

.nav-btn.disabled:hover {
    background: #f8f8f8;
    cursor: not-allowed;
}

.coordinates-search {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.coord-input {
    padding: 5px 8px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 162px; 
    height: 17px;
}

#cities-dropdown {
    padding: 5px 8px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 50px;
    height: 30px;
}

.current-center {
  display:none!important;
    /* display: flex; */
    align-items: center;
    gap: 5px;
    margin-left: 10px;
    font-size: 1rem;
}

#current-center-coords {
    font-family: monospace;
    background: #f5f5f5;
    padding: 2px 5px;
    border-radius: 3px;
}

.current-coords-display {
    font-family: monospace;
    background: #f5f5f5;
    padding: 2px 5px;
    border-radius: 3px;
}

#copy-coords-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

#copy-coords-btn:hover {
    background-color: #f0f0f0;
    border-radius: 3px;
}

.copy-coords-btn.copied {
    background-color: #4CAF50 !important;
    color: white !important;
    border-color: #4CAF50 !important;
}

#copy-coords-btn-clone.copied {
    background-color: #4CAF50 !important;
    color: white !important;
}



/* Для скрытия элементов в дартс */

#nav-menu-toggle {
    display: none;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    height: 30px;
    width: 40px;
    justify-content: center;
    align-items: center;
    margin-left: 5px;    
}

/* Адаптация выпадающего меню */
.dart-menu-container {
    position: relative;
    display: inline-block;
}

.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    z-index: 3000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    min-width: 250px;
    flex-direction: column;
    gap: 10px;
	width: 25%;
}

.nav-dropdown.active {
    display: flex;
    flex-direction: column;
}

/* Стили для элементов в выпадающем меню */
.nav-dropdown .dropdown-item {
    width: 100%;
    /* margin-bottom: 8px; */
}

.nav-dropdown .city-coord-group {
    flex-direction: column;
    align-items: flex-start;
}

.nav-dropdown .current-center {
  display:none!important;
    /* display: flex; */
    flex-wrap: wrap;
    /* gap: 5px; */
    align-items: center;
}

/* Скрываем элементы, когда они не нужны */
.hideable-nav-item.hidden {
    display: none !important;
}

.dropdown-items-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
}

/* Для мобильной адаптации */
@media (max-width: 1837px) { /* Когда схлопываем в дартс-меню */
    #nav-menu-toggle {
        display: flex !important;
    }
    
    .hideable-nav-item:not(.keep-visible) {
        display: none !important;
    }
    
    .hideable-nav-item {
        display: none !important;
    }
    
    .nav-dropdown {
        min-width: 300px;
        width: auto;
	    z-index: 3001 !important;
    }
    
    .coord-input,
    #cities-dropdown {
        width: 100%;
        max-width: 200px;
        height: 22px;
    }
	
    .leaflet-top.leaflet-right {
	    z-index: 1000 !important;
    }	
}

@media (min-width: 1838px) {
    #nav-menu-toggle {
        display: none !important;
    }
    
    #centerOn-label {
        display: none !important;
    }
}


@media (max-width: 901px) {
	.date-selector {
		width: 85px;
		flex-shrink: 0;
	}
    
    .nav-btn {
        flex: 1;
        flex-shrink: 0;
    }
    
    .coord-input,
    #cities-dropdown {
        width: 100%;
        max-width: 200px;
    }
    
    .city-coord-group {
        flex-direction: row;
        flex-wrap: nowrap;
        width: 100%;
    }
    
    #nav-menu-toggle {
        flex-shrink: 0;
    }
}


/* Исправление для выпадающего меню на узких экранах */
.nav-dropdown {
    box-sizing: border-box; /* Учитываем padding в общей ширине */
    max-width: 100vw; /* Ограничиваем ширину экраном */
    /* overflow: hidden; Скрываем выходящие за пределы элементы */
    margin-right: 5px;
	font-family: 'Arial';
}

.dropdown-items-container {
    /* width: 95%; /* Занимаем всю доступную ширину */
    margin: 0;
}

/* Фиксируем ширину элементов управления */
.nav-dropdown .city-coord-group {
    /* width: 100%; */
    box-sizing: border-box;
}

.nav-dropdown .coord-input {
    /* width: 100% !important; Принудительная полная ширина */
    max-width: 100%;
    box-sizing: border-box; /* Учитываем padding */
}

.nav-dropdown #cities-dropdown-clone {
    /* width: 100% !important; */
    max-width: 100%;
    box-sizing: border-box;
	text-align: center;
}

.nav-dropdown #copy-coords-external-btn-clone{
	width:100%;
}

.nav-dropdown .current-center {
  display:none!important;
    flex-wrap: wrap; /* Разрешаем перенос элементов */
    /* gap: 5px; Добавляем промежутки */
    box-sizing: border-box;
}

.nav-dropdown .current-center > * {
  display:none!important;
    flex: 1 1 auto; /* Гибкое распределение пространства */
    min-width: min-content; /* Минимальная ширина по содержимому */
    box-sizing: border-box;
}

.nav-dropdown .current-coords-display {
     /* overflow: hidden;Скрываем переполнение */
     /* text-overflow: ellipsis;Многоточие при переполнении */
    white-space: nowrap; /* Запрещаем перенос строк */
     /* max-width: calc(100% - 30px);Оставляем место для кнопки */
    box-sizing: border-box;
}


/* Слои карты */

.leaflet-control-layers-toggle {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"></path></svg>');
    background-repeat: no-repeat;
    background-position: center;
    width: 36px;
    height: 36px;
    display: block;
}

.leaflet-control-layers {
    /* display: none; */
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
    background: #fff;
    border-radius: 5px;
    padding: 10px;
}
.leaflet-control-layers:not(.leaflet-control-layers-expanded) {
    display: none !important;
}

.leaflet-control-layers-expanded {
    display: block!important;
	pointer-events: auto !important;
    position: absolute;
    top: 45px;
    right: 0;
    width: 250px;
    z-index: 2000;
	    opacity: 1 !important; /* Гарантируем видимость */
    visibility: visible !important; /* Гарантируем видимость */
}

.leaflet-control-layers-list {
    margin: 0;
    padding: 0;
}

.leaflet-control-layers-base {
    margin-bottom: 10px;
}

.leaflet-top.leaflet-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 1001;
}

.leaflet-control-layers-toggle {
    margin-bottom: 10px;
    background-color: white;
    border-radius: 4px;
    width: 36px;
    height: 36px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
    
    cursor: pointer;
    position: relative;
}

.leaflet-control-layers-toggle a {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.leaflet-control-layers-toggle.active {
    background-color: #e6f2ff;
    box-shadow: inset 0 0 3px rgba(0,0,0,0.3);
}




/* Линейка */

/* Стили для переключателя линейки */
.leaflet-control-ruler-toggle {
    position: relative;
    width: 30px;
    height: 30px;
    display: block;
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
}

.leaflet-control-ruler-toggle.active {
    background-color: #e6f2ff;
    box-shadow: inset 0 0 3px rgba(0,0,0,0.3);
}
.leaflet-control-ruler-toggle a {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.leaflet-control-ruler-toggle.active a { /* Прожатая кнопка линейки-менюшки */
    background-color: #e6f2ff !important;
    box-shadow: inset 0 0 3px rgba(0,0,0,0.3) !important;
}

.polyline-measure-controlOnBgColor { /* Прожатая кнопка линейки-рисовашки */
    background-color: #e6f2ff !important;
    box-shadow: inset 0 0 3px rgba(0,0,0,0.3) !important;
}

.leaflet-control-ruler-panel {
    position: absolute;
    top: 100%;
    left: 0;
    border-radius: 0px;
    padding: 0;
    z-index: 1000;
    display: none;
}

.leaflet-control-polyline-measure {
  display: none !important;
  position: absolute;
  left: 0;
  z-index: 1001;
  
    /* top: 100%; */
    /* left: 0; */
    /* background: white; */
    /* padding: 10px; */
    /* border-radius: 4px; */
    /* box-shadow: 0 1px 5px rgba(0,0,0,0.4); */
    /* z-index: 1000; */
}

/* Показываем при активации */
.leaflet-control-ruler-toggle.active + .leaflet-control-polyline-measure {
  display: block !important;
}


.kml-label {
    background: transparent;
    border: none;
    color: black;
    text-shadow: 
        -1px -1px 0 white, 
        1px -1px 0 white, 
        -1px 1px 0 white, 
        1px 1px 0 white;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    pointer-events: none;
}


/* Стили для перетаскиваемого маркера */
.fixed-marker {
    cursor: move !important;
    /* transition: transform 0.2s ease; */
    will-change: transform; /* Предупреждаем браузер об изменении трансформации */
    backface-visibility: hidden; /* Улучшает производительность анимации */
    transform: translateZ(0); /* Аппаратное ускорение */
}

.fixed-marker:hover {
    transform: scale(1.1);
}

.leaflet-marker-dragging {
    opacity: 0.7;
    filter: drop-shadow(0 0 8px rgba(0, 0, 255, 0.5));
    transition: none; /* Убираем переходы при перетаскивании */
}

/* Отключаем некоторые эффекты во время перетаскивания для производительности */
.leaflet-dragging .leaflet-marker-pane,
.leaflet-dragging .leaflet-shadow-pane {
    transition: none;
}

.nav-dropdown #currentCenter-label-clone {
  display: none !important;
}
.nav-dropdown #current-center-coords-clone {
  display: none !important;
}
.nav-dropdown #copy-coords-btn-clone{
  display: none !important;
}