/* Custom Maps Styles */

/* Global font inheritance */
.custom-map-wrapper,
.custom-map,
.leaflet-container,
.leaflet-popup-content,
.leaflet-popup-content-wrapper,
.leaflet-control,
.recenter-button {
    font-family: inherit;
}

/* Frontend Map Wrapper */
.custom-map-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: inherit;
}

.custom-map {
    width: 100%;
    height: 100%;
    min-height: inherit;
    z-index: 1;
    border: 0;
    border-radius: 8px;
    overflow: hidden;
}

.leaflet-container {
    background: #cdeab0 !important;
}

/* Prevent text selection when dragging routes */
.leaflet-container.leaflet-dragging-route {
    cursor: crosshair !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

.leaflet-container.leaflet-dragging-route * {
    cursor: crosshair !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Gesture handling styling */
.leaflet-gesture-handling:after {
    transition: opacity 0.6s ease-in-out 0.3s !important;
    font-size: 1.2rem !important;
    font-family: inherit;
}

.leaflet-gesture-handling-warning.leaflet-gesture-handling-touch:after {
    content: attr(data-gesture-handling-touch-content) !important;
    font-size: 1.2rem !important;
    font-family: inherit;
}

.leaflet-gesture-handling-warning:not(.leaflet-gesture-handling-touch):after {
    content: attr(data-gesture-handling-scroll-content) !important;
    font-size: 1.2rem !important;
    font-family: inherit;
}

/* Popup styling */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.leaflet-popup-content {
    margin: 13px 19px;
    line-height: 1.4;
}

/* Override popup bottom position */
.leaflet-popup {
    bottom: -15px !important;
}

.leaflet-popup-content a {
    font-weight: bold;
    color: #eebb00;
    text-decoration: none;
}

.leaflet-popup-content a:hover {
    text-decoration: underline;
}

.leaflet-popup-tip-container {
    width: 40px;
    height: 20px;
    position: absolute;
    left: 50%;
    margin-top: -1px;
    margin-left: -21px;
    overflow: hidden;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .leaflet-gesture-handling:after {
        font-size: 1rem !important;
    }
}

/* Loading and error states */
.custom-map.loading {
    background: #f0f0f0 url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50"><circle cx="25" cy="25" r="20" fill="none" stroke="%23666" stroke-width="2" stroke-linecap="round" stroke-dasharray="31.416" stroke-dashoffset="31.416"><animate attributeName="stroke-dasharray" dur="2s" values="0 31.416;15.708 15.708;0 31.416" repeatCount="indefinite"/><animate attributeName="stroke-dashoffset" dur="2s" values="0;-15.708;-31.416" repeatCount="indefinite"/></circle></svg>') center center no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-map.loading::after {
    content: 'Indlæser kort...';
    color: #666;
    font-size: 14px;
    font-family: inherit;
    margin-top: 60px;
}

.custom-map-error {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 20px;
    text-align: center;
    color: #d63638;
    font-family: inherit;
    border-radius: 4px;
}

/* Admin Styles */
#admin-map-preview {
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 500px !important;
    min-height: 500px;
    background: #f0f0f0;
    position: relative;
    z-index: 1;
    border: 0;
    border-radius: 8px;
    overflow: hidden;
}

.marker-row {
    position: relative;
    transition: all 0.3s ease;
}

.marker-row.highlight {
    background: #fff8dc !important;
    border-color: #eebb00 !important;
    box-shadow: 0 0 10px rgba(238, 187, 0, 0.3);
}

.route-row {
    position: relative;
    transition: all 0.3s ease;
}

.route-row.highlight {
    background: #e0f0ff !important;
    border-color: #3388ff !important;
    box-shadow: 0 0 10px rgba(51, 136, 255, 0.3);
}

.marker-row input.error {
    border-color: #d63638;
    background: #fff8f8;
}

.coordinate-error {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hide Leaflet Routing Machine UI elements */
.leaflet-routing-container {
    display: none !important;
}

.leaflet-routing-alternatives-container {
    display: none !important;
}

.leaflet-control-container .leaflet-routing-container {
    display: none !important;
}

/* Keep only the route line visible */
.leaflet-routing-geocoders {
    display: none !important;
}


