/* Map Styles für alle Seiten */

/* Z-Index Hierarchie:
 * 1000-1999: Karten-Steuerelemente
 * 2000-2999: Karten-Marker und Popups
 * 8000-8999: Wegpunkt-Marker
 * 9000-9999: Benutzer-Marker
 * 10000+: Modals und Overlays
 */

/* Karten-Styles */
.admin-map,
.map {
    height: 500px;
    width: 100%;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

/* Benutzer-Marker */
.user-marker-container {
    background: none;
}

.user-marker {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 16px;
    height: 16px;
    background-color: transparent;
    border: none;
    box-shadow: none;
    z-index: 9000 !important;
}

.user-marker i {
    display: none;
}

.user-marker .marker-label {
    position: absolute;
    top: 16px;
    white-space: nowrap;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 1px 1px 1px white, -1px -1px 1px white, 1px -1px 1px white, -1px 1px 1px white;
    z-index: 9001;
}

/* KM-Marker Styles - Schlicht und Modern */
.km-marker-icon {
    text-align: center;
    font-weight: 500;
    font-size: 11px;
    z-index: 2000;
}

.km-marker-label {
    background-color: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(108, 117, 125, 0.3);
    border-radius: 12px;
    padding: 3px 8px;
    font-size: 9px;
    font-weight: 500;
    color: #495057;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    white-space: nowrap;
    line-height: 1.2;
    min-width: 28px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
    display: inline-block;
    z-index: 2001;
}

.km-marker-label:hover {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

/* KM-Marker für umgekehrte Richtung - Schlicht und Modern */
.km-marker-reversed .km-marker-label {
    background-color: rgba(255, 152, 0, 0.95) !important;
    color: white !important;
    border: 1px solid rgba(255, 152, 0, 0.6) !important;
    box-shadow: 0 1px 3px rgba(255, 152, 0, 0.3) !important;
    z-index: 2002;
}

.km-marker-reversed .km-marker-label:hover {
    background-color: rgba(255, 152, 0, 0.98) !important;
    box-shadow: 0 2px 6px rgba(255, 152, 0, 0.4) !important;
    transform: translateY(-1px);
}

/* Karten-Steuerelemente */
.map-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.btn-map {
    margin-bottom: 5px;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background-color: white;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

/* Sichtbarkeitssteuerung */
.visibility-controls {
    background-color: white;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
    margin-bottom: 10px;
    min-width: 150px;
    z-index: 1100;
}

.control-title {
    font-weight: bold;
    margin-bottom: 8px;
    text-align: center;
    font-size: 14px;
}

.visibility-btn {
    display: block;
    padding: 6px 10px;
    margin: 5px 0;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    text-align: center;
    width: 100%;
}

.visibility-btn.active {
    background-color: #4CAF50;
    color: white;
    border-color: #388E3C;
}

.visibility-btn:hover {
    background-color: #e9ecef;
}

.visibility-btn.active:hover {
    background-color: #43A047;
}

/* Wegpunkt-Icon Styles */
.waypoint-icon-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #333;
    color: white;
    border-radius: 6px;
    width: 100%;
    height: 100%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    z-index: 8000 !important;
}

/* Wegpunkt-Icons über anderen Elementen anzeigen */
.leaflet-marker-icon.waypoint-icon,
.waypoint-icon-container {
    z-index: 8000 !important;
}

/* Sicherstellen, dass die Marker-Ebene über anderen Ebenen liegt */
.leaflet-marker-pane {
    z-index: 8000 !important;
}

/* Spezifische Überschreibung für Wegpunkt-Icons */
.leaflet-marker-icon.waypoint-icon {
    pointer-events: auto !important;
    z-index: 8001 !important;
}

.waypoint-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.waypoint-icon i {
    font-size: 14px;
    color: white;
}

/* Spezielle Styles für Start- und Zielsymbole */
.waypoint-start .waypoint-icon-container {
    background-color: #4CAF50;
    z-index: 8100 !important;
}

.waypoint-finish .waypoint-icon-container {
    background-color: #F44336;
    z-index: 8100 !important;
}

/* Leaflet Popup Styles */
.leaflet-popup-pane {
    z-index: 2500 !important;
}

.leaflet-popup {
    z-index: 2501 !important;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .map, .admin-map {
        height: 350px;
    }
}

@media (min-width: 992px) {
    .admin-map {
        height: 600px;
    }
}

/* Custom Map Controls */
.custom-map-controls {
    margin-bottom: 10px;
    z-index: 1200;
}

.custom-control-btn {
    display: block;
    width: 36px;
    height: 36px;
    font-size: 18px;
    line-height: 36px;
    text-align: center;
    background-color: white;
    margin-bottom: 5px;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
}

.custom-control-btn:hover {
    background-color: #f5f5f5;
}

/* Wegpunkt-Liste Styles */
.waypoint-item {
    display: flex;
    align-items: center;
}

.waypoint-symbol {
    margin-right: 8px;
    cursor: pointer;
}

.waypoint-symbol:hover {
    opacity: 0.8;
}

/* Symbol-Auswahl-Popup */
.symbol-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.symbol-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.symbol-option:hover {
    background-color: #f0f0f0;
}

.symbol-option.selected {
    border-color: #0078d7;
    background-color: #e6f2ff;
}

/* Modal Styles */
.modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 2147483647 !important;
    display: none;
    pointer-events: auto !important;
}

.modal {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background-color: #fff !important;
    padding: 20px !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3) !important;
    z-index: 2147483648 !important;
    display: none;
    pointer-events: auto !important;
    max-width: 90%;
}

.modal-header {
    margin-bottom: 15px;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--primary-color);
}

.modal-body {
    margin-bottom: 15px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
}

.modal-footer button {
    padding: 8px 15px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
} 