/* ===== POPUP-STYLES.CSS ===== */
/* Alle Leaflet Popup-bezogenen Styles und Optimierungen */

/* ===== LEAFLET POPUP OVERRIDES ===== */
.leaflet-popup-content {
    margin: 6px; /* Reduziert von 8px */
    min-width: 120px; /* Reduziert von 140px */
    max-width: 160px; /* Maximale Breite begrenzen */
}

.leaflet-popup-content-wrapper {
    border-radius: 8px; /* Etwas runder */
}

.leaflet-popup-tip {
    width: 15px; /* Reduziert von Standard */
    height: 15px;
}

/* ===== POI POPUP BASIS ===== */
.poi-popup {
    font-size: 12px; /* Reduziert von 13px */
    line-height: 1.3;
}

/* ===== POPUP HEADER ===== */
.poi-popup-header {
    display: flex;
    align-items: center;
    gap: 4px; /* Reduziert von 6px */
    margin-bottom: 4px; /* Reduziert von 6px */
}

.poi-popup-number {
    background: #3498db;
    color: white;
    padding: 1px 4px; /* Reduziert */
    border-radius: 3px;
    font-size: 10px; /* Reduziert von 11px */
    font-weight: bold;
    flex-shrink: 0;
}

.poi-popup h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 13px; /* Reduziert von 14px */
    line-height: 1.2;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== KOMPAKTE META-ZEILE (KATEGORIE + ENTFERNUNG) ===== */
.poi-meta-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px; /* Reduziert */
    font-size: 11px; /* Kleiner */
    gap: 8px;
}

.poi-meta-line .poi-category {
    color: #7f8c8d;
    font-size: 0.9em;
    margin: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.poi-meta-line .poi-distance {
    color: #3498db;
    font-weight: 500;
    margin: 0;
    font-size: 0.9em;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ===== ROUTING BUTTON ===== */
.poi-route-btn {
    width: 100%;
    padding: 4px 6px; /* Reduziert von 6px 8px */
    background: linear-gradient(45deg, #2196f3, #1976d2);
    color: white;
    border: none;
    border-radius: 4px; /* Reduziert von 5px */
    cursor: pointer;
    font-size: 11px; /* Reduziert von 13px */
    margin-top: 4px; /* Reduziert von 6px */
    transition: background 0.2s;
    font-weight: 500;
}

.poi-route-btn:hover {
    background: linear-gradient(45deg, #1976d2, #1565c0);
}

/* ===== INFO FÜR MANUELLE STANDORTE ===== */
.poi-route-info {
    width: 100%;
    padding: 4px 6px; /* Reduziert */
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
    border-radius: 4px; /* Reduziert */
    font-size: 10px; /* Reduziert von 12px */
    margin-top: 4px; /* Reduziert */
    text-align: center;
    font-style: italic;
}

/* ===== NO RESULTS POPUP ===== */
.no-results-popup {
    text-align: center;
    padding: 10px;
}

.no-results-popup strong {
    color: #dc3545;
}

/* ===== MOBILE OPTIMIERUNGEN ===== */
@media (max-width: 768px) {
    .leaflet-popup-content {
        margin: 5px;
        min-width: 110px; /* Noch kleiner auf Mobile */
        max-width: 140px;
    }
    
    .poi-popup {
        font-size: 11px;
    }
    
    .poi-popup h4 {
        font-size: 12px;
    }
    
    .poi-meta-line {
        font-size: 10px;
        gap: 6px;
    }
    
    .poi-route-btn {
        font-size: 10px;
        padding: 3px 5px;
    }
    
    .poi-route-info {
        font-size: 9px;
        padding: 3px 5px;
    }
}

/* ===== SEHR KLEINE BILDSCHIRME ===== */
@media (max-width: 480px) {
    .leaflet-popup-content {
        margin: 4px;
        min-width: 100px;
        max-width: 130px;
    }
    
    .poi-popup-header {
        gap: 3px;
        margin-bottom: 3px;
    }
    
    .poi-popup-number {
        padding: 1px 3px;
        font-size: 9px;
    }
    
    .poi-popup h4 {
        font-size: 11px;
    }
    
    .poi-meta-line {
        font-size: 9px;
        gap: 4px;
        margin-bottom: 3px;
    }
    
    .poi-route-btn {
        font-size: 9px;
        padding: 2px 4px;
        margin-top: 3px;
    }
    
    .poi-route-info {
        font-size: 8px;
        padding: 2px 4px;
        margin-top: 3px;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .poi-route-btn {
        transition: none !important;
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    .poi-popup-number {
        background: #000;
        border: 1px solid #fff;
    }
    
    .poi-meta-line .poi-distance {
        color: #000;
        font-weight: bold;
    }
    
    .poi-route-btn {
        background: #000 !important;
        border: 2px solid #fff;
    }
}