.leaflet-popup-content h3 {
    margin-top: 0;
    color: #0078A8;
}

.leaflet-popup {
    cursor: pointer;
}

.marker-popup-actions {
    margin-top: 10px;
    display: flex;
    gap: 5px;
}

.marker-popup-container {
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    overflow: auto;
}

.leaflet-popup-content-wrapper {
    max-width: 100%;
}

@media (min-width: 768px) {
    .marker-popup-container {}

    .leaflet-popup-content-wrapper {
        width: 700px !important;
        max-width: 800px !important;
    }

    .leaflet-popup-content {
        width: auto !important;
    }

    .leaflet-popup-content {
        min-width: 400px;
    }
}

@media (max-width: 768px) {
    .leaflet-popup-content {
        min-width: calc(100vw - 30px);
        max-width: calc(100vw - 30px); /* для полной адаптивности */
        box-sizing: border-box; /* учитываем padding в расчетах */
    }

    .leaflet-popup-content-wrapper {
        min-width: calc(100vw - 30px);
    }
}

/* Добавьте это в ваш CSS файл */
.marker-popup .like-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

.marker-popup .like-button {
    font-size: 1.6rem !important;
    transition: all 0.2s ease;
}

.marker-popup .like-button:hover {
    transform: scale(1.1);
}

.marker-popup .likes-count {
    font-size: 0.9rem;
    color: #6c757d;
}

/* мастер создания метки */
.marker-wizard {
    max-width: 400px;
    width: 100%;
}

.wizard-step {
    display: none;
}

.wizard-step.active {
    display: block;
}

.wizard-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.summary-data {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
}

@media (max-width: 576px) {
    .marker-wizard {
        top: 0;
        left: 0;
        padding: 20px;
        background: white;
        z-index: 1300;
        overflow-y: auto;
    }
}

.leaflet-popup-content-wrapper {
    cursor: move; /* fallback if grab cursor is unsupported */
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Отключаем выделение текста при перетаскивании */
.leaflet-popup-content * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Для интерактивных элементов возвращаем возможность выделения */
.leaflet-popup-content input,
.leaflet-popup-content textarea,
.leaflet-popup-content [contenteditable] {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

@media (hover: none) {
    .leaflet-popup-content-wrapper {
        cursor: grab;
    }
}


.leaflet-pulsing-icon {
    border-radius: 100%;
    box-shadow: 1px 1px 8px 0 rgba(0, 0, 0, 0.75);
}

.leaflet-pulsing-icon:after {
    content: "";
    border-radius: 100%;
    height: 200%;
    width: 200%;
    position: absolute;
    margin: -50% 0 0 -50%;
}

@keyframes pulsate {
    0% {
        transform: scale(0.1, 0.1);
        opacity: 0;
        -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
        filter: alpha(opacity=0);
    }
    50% {
        opacity: 1;
        -ms-filter: none;
        filter: none;
    }
    100% {
        transform: scale(1.1, 1.1);
        opacity: 0;
        -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
        filter: alpha(opacity=0);
    }
}

.date_icon {
    border: 2px solid rgba(255, 0, 0, 0.5);
}

/* И так далее - все остальные ваши стили... */
/* Дополнительные улучшения для мобильных */
@media (max-width: 767.98px) {
    .map-control-panel.collapsed {
        transform: none;
    }

    #mapInfoCollapse {
        max-height: 40vh;
        overflow-y: auto;
        padding: 10px;
    }

    .user-item {
        min-width: 140px;
        flex: 0 0 auto;
    }

    #mapInfoCollapse .d-flex {
        gap: 1rem;
    }

    .requires_right {
        margin-left: 0 !important;
        justify-content: flex-start;
    }
}

@media (min-width: 768px) {
    .map-control-panel {
        left: 55px;
        right: 65px;
    }
}

#clearDateFilter, #applyDateFilter {
    height: 32px;
    min-height: 32px;
    max-height: 32px;
    line-height: 1;
}


/* Фикс для модальных окон */
.modal-backdrop {
    z-index: 1140 !important;
}

.modal {
    z-index: 1150 !important;
}

/* Фикс для вашего кастомного модального окна */
#myModal {
    z-index: 1160 !important;
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-map-content {
    position: relative;
    background-color: #fff;
    margin: 15% auto;
    padding: 20px;
    width: 80%;
    max-width: 600px;
    border-radius: 5px;
}

.close-modal-map {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 20px;
    cursor: pointer;
}


@media (max-width: 450px) {
    .map_main_title {
        font-size: 1rem;
    }
}

@media (max-width: 370px) {
    .map_main_title {
        font-size: 0.9rem;
    }
}

.marker-popup-comments {
    max-height: 180px;
    overflow: scroll;
}

.leaflet-popup-content {
    margin: 12px;
}

@media (max-width: 500.01px) {
    .dropdown-menu {
        position: fixed !important;
    }

    .dropdown-menu.show {
        position: fixed !important;
    }
}

/* Стили для маршрутов */
.leaflet-control-create-route {
    background-color: #fff;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    display: block;
    text-decoration: none;
    color: #333;
    font-size: 16px;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
}

.leaflet-control-create-route:hover {
    background-color: #f4f4f4;
}

.route-info {
    font-weight: bold;
    padding: 5px 10px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

.route-wizard .wizard-step {
    display: none;
    padding: 15px;
    min-width: 300px;
}

.route-wizard .wizard-step.active {
    display: block;
}

.route-wizard .wizard-nav {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
}

.route-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
    background: none;
    border: none;
}

.route-info-form {
    max-width: 500px;
}


.route-info-form .route-points-info {
    background-color: #f8f9fa;
    padding: 9px;
    border-radius: 5px;
    border: 1px solid #dee2e6;
}

.route-info-form .btn {
    margin-top: 10px;
}

/* Новые стили для маршрутов */
.route-marker.start-marker {
    color: #28a745;
    border: 3px solid #28a745;
    border-radius: 50%;
    padding: 2px;
}

.route-marker.end-marker {
    color: #dc3545;
    border: 3px solid #dc3545;
    border-radius: 50%;
    padding: 2px;
}

.route-direction-arrow {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%233388ff'%3E%3Cpath d='M12 2L4 12l8 10 8-10z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    width: 12px;
    height: 12px;
    position: absolute;
    transform: rotate(0deg);
}

.end-route-marker, .start-route-marker {
    font-size: 24px;
    text-align: center;
    line-height: 30px;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

.map-loading-indicator {
    background: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.map-loading-indicator .spinner-border {
    width: 1.5rem;
    height: 1.5rem;
}

.route_distance {
    margin-bottom: 5px;
    font-size: 14px;
    padding: 2px;
    width: 100%;
    border-bottom: 2px dashed #0d6efd;
}

/*#customPopup {*/
/*    position: fixed;*/
/*    top: 0;*/
/*    left: 0;*/
/*    width: 100%;*/
/*    height: 100%;*/
/*    background-color: rgba(0, 0, 0, 0.5);*/
/*    display: none;*/
/*    justify-content: center;*/
/*    align-items: flex-start;*/
/*    z-index: 999;*/
/*    padding-top: 150px;*/
/*}*/

/*.custom-popup-content {*/
/*    background: white;*/
/*    padding: 20px;*/
/*    border-radius: 8px;*/
/*    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);*/
/*    width: 90%;*/
/*    max-width: 800px;*/
/*    max-height: 70vh;*/
/*    overflow-y: auto;*/
/*}*/

/*.custom-popup-close {*/
/*    position: absolute;*/
/*    top: 10px;*/
/*    right: 10px;*/
/*    background: none;*/
/*    border: none;*/
/*    font-size: 20px;*/
/*    cursor: pointer;*/
/*}*/

.custom-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
}

.custom-popup-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    min-width: 300px;
}

.custom-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    z-index: 1300;
}