/* =========================================
   MODUL: REGIO (KARTE, FILTER, POPUPS)
   ========================================= */

/* --- FILTER CONTROL WRAPPER (Light Glassmorphism & Minimierbar) --- */
.regio-filter-wrapper {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    color: #2d3436;
    padding: 12px 15px;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    font-family: var(--font-stack, system-ui, sans-serif);
    margin-bottom: 25px;
    margin-left: 10px;
    min-width: 250px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.regio-filter-wrapper.minimized {
    min-width: 44px !important; width: 44px !important; height: 44px !important;
    padding: 0 !important; border-radius: 50% !important;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.regio-filter-wrapper.minimized .regio-filter-container { display: none !important; }
.filter-min-icon { display: none; font-size: 22px; line-height: 1; }
.regio-filter-wrapper.minimized .filter-min-icon { display: block; }

.filter-header-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; border-bottom: 1px dashed rgba(0,0,0,0.1); padding-bottom: 8px; }
.filter-header-title { font-weight: 800; font-size: 13px; color: #2d3436; }
.filter-min-btn { background: #f1f2f6; border: none; border-radius: 8px; width: 24px; height: 24px; font-size: 16px; cursor: pointer; color: #636e72; font-weight: bold; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.filter-min-btn:hover { background: #dfe6e9; color: #d63031; }

.regio-filter-container { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.regio-filter-row { display: flex; align-items: center; cursor: pointer; font-size: 11px; font-weight: bold; user-select: none; white-space: nowrap; margin: 0; }
.regio-filter-row:hover .regio-filter-box:not(.active) { border-color: #2d3436; }
.regio-filter-box { display: inline-flex; width: 14px; height: 14px; border: 2px solid #a4b0be; border-radius: 3px; margin-right: 5px; align-items: center; justify-content: center; font-size: 10px; font-weight: bold; transition: 0.2s; color: transparent; box-sizing: border-box; }
.regio-filter-box.active { color: #2d3436; border-color: #2d3436; }

/* --- ROUTING ELEVATION WRAPPER --- */
.regio-elevation-container {
    position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); width: 66vw; max-width: 1200px; min-width: 320px;
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    color: #2d3436; padding: 12px 15px; border-radius: 16px; border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2); font-family: var(--font-stack, system-ui, sans-serif); z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); overflow: hidden;
}

.regio-elevation-container.minimized {
    min-width: 44px !important; width: 44px !important; height: 44px !important; padding: 0 !important; border-radius: 50% !important;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.regio-elevation-container.minimized .regio-elevation-content, .regio-elevation-container.minimized .filter-header-title, .regio-elevation-container.minimized .elevation-close-btn { display: none !important; }
.regio-elevation-container.minimized .filter-header-bar { border: none; margin: 0; padding: 0; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center;}
.regio-elevation-container.minimized .filter-min-icon { display: block; }

/* =========================================
   MAP CONTEXT MENU (SLEEK GLASSMORPHISM)
   ========================================= */
.regio-popup .leaflet-popup-content-wrapper {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    color: var(--text-dark, #2d3436);
    border-radius: 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0,0,0,0.02) !important;
    padding: 6px !important;
}

.regio-popup .leaflet-popup-tip {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(4px) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
}

.regio-popup .leaflet-popup-close-button {
    color: #a4b0be !important; font-weight: bold; padding: 10px 10px 0 0 !important;
}
.regio-popup .leaflet-popup-close-button:hover { color: #d63031 !important; }

.regio-popup .leaflet-popup-content { margin: 12px 15px; font-family: var(--font-stack, sans-serif); }

.glass-context-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 200px;
}

/* Elegante, rahmenlose Buttons */
.glass-btn {
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    background: transparent;
    color: #2d3436;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.glass-btn:hover, .glass-btn:active {
    background: rgba(0, 0, 0, 0.04);
    transform: scale(1.02);
}

.glass-btn.btn-primary { color: #0984e3; }
.glass-btn.btn-primary:hover { background: rgba(9, 132, 227, 0.08); }

.glass-btn.btn-danger { color: #d63031; }
.glass-btn.btn-danger:hover { background: rgba(214, 48, 49, 0.08); }

/* Sehr dezente Trennlinie */
.menu-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: 4px 8px;
    border-radius: 1px;
}

.btn-cascade-trigger { color: #636e72; }
.btn-cascade-trigger:hover { color: #2d3436; }

/* Kaskaden-Untermenü */
.cascade-submenu {
    display: none;
    flex-direction: column;
    gap: 2px;
    margin-top: 2px;
    padding-left: 8px;
    border-left: 2px solid rgba(0,0,0,0.08);
    animation: slideDownMenu 0.2s ease-out forwards;
}

.cascade-submenu.show { display: flex; }

.cascade-submenu .sub-btn {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #636e72;
}
.cascade-submenu .sub-btn:hover { color: #2d3436; background: rgba(0,0,0,0.04); }

@keyframes slideDownMenu {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- MAP POPUP INNENLEBEN (Standard Marker) --- */
.map-popup-container { text-align: center; min-width: 170px; padding-bottom: 5px; }
.map-popup-title { margin: 0 0 5px 0; color: #2d3436; border-bottom: 1px dashed rgba(0,0,0,0.15); padding-bottom: 6px; font-size: 16px; font-weight: bold; }
.map-popup-title-link { display: block; margin-bottom: 12px; color: #2d3436; text-decoration: none; font-weight: bold; border-bottom: 1px dashed rgba(0,0,0,0.15); padding-bottom: 6px; cursor: pointer; font-size: 16px; transition: color 0.2s; }
.map-popup-title-link:hover { color: #0984e3; }
.map-popup-subtitle { font-size: 11px; color: #636e72; margin-bottom: 4px; font-style: italic; }
.map-popup-creator { font-size: 12px; margin-bottom: 10px; color: #636e72; }
.map-popup-creator a { color: #0984e3; text-decoration: none; font-weight: bold; }
.map-popup-creator a:hover { text-decoration: underline; }
.map-popup-meta { font-size: 12px; font-weight: bold; color: #2d3436; margin-bottom: 12px; background: rgba(0,0,0,0.05); padding: 6px; border-radius: 6px; display: flex; justify-content: space-around; align-items: center; }
.map-popup-meta-clickable { cursor: pointer; transition: all 0.2s ease; border: 1px solid transparent; }
.map-popup-meta-clickable:hover { background: rgba(9, 132, 227, 0.1); border: 1px solid rgba(9, 132, 227, 0.3); transform: translateY(-1px); box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.map-popup-desc { text-align: left; margin-bottom: 12px; font-size: 12px; color: #2d3436; }
.map-popup-desc-clamped { font-size: 12px; color: #636e72; font-style: italic; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; margin-top: 5px;}
.map-popup-tag { font-size: 11px; font-weight: bold; margin-bottom: 5px; }
.map-popup-tag.private { color: #d63031; }
.map-popup-tag.protected { color: #0984e3; }
.map-popup-tag.assigned { color: #e1b12c; }

/* --- MAP BUTTONS (Generische Marker Buttons) --- */
.map-btn { width: 100%; padding: 8px; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; box-shadow: 0 2px 4px rgba(0,0,0,0.1); transition: 0.2s; margin-bottom: 8px; font-size: 12px; text-align: center; display: block; box-sizing: border-box; text-decoration: none; }
.map-btn:last-child { margin-bottom: 0; }
.map-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,0,0,0.15); filter: brightness(1.05); }
.map-btn-primary { background: #0984e3; color: #fff; }
.map-btn-secondary { background: #8e44ad; color: #fff; }
.map-btn-warning { background: #f39c12; color: #fff; }
.map-btn-danger { background: #d63031; color: #fff; }
.map-btn-success { background: #27ae60; color: #fff; }
.map-btn-dark { background: #2d3436; color: #fff; border: 1px solid #555; }

/* --- MAP LABEL TOOLTIPS --- */
.map-label-tooltip { background: rgba(255, 255, 255, 0.95) !important; color: #000000 !important; border: 1px solid rgba(0, 0, 0, 0.15) !important; border-radius: 6px !important; font-size: 11px !important; font-weight: bold !important; padding: 4px 8px !important; box-shadow: 0 4px 10px rgba(0,0,0,0.15) !important; opacity: 0 !important; transition: opacity 0.2s ease !important; pointer-events: none !important; white-space: nowrap !important; margin-top: -5px !important; }
.map-label-tooltip.leaflet-tooltip-top:before { border-top-color: rgba(255, 255, 255, 0.95) !important; }
#map.show-labels .map-label-tooltip { opacity: 1 !important; }
.map-label-tooltip.hover-visible { opacity: 1 !important; }

/* --- EXIF POPUP --- */
#regio-exif-popup { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 999999; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); padding: 20px; border-radius: 12px; color: #2d3436; font-family: var(--font-stack, sans-serif); box-shadow: 0 10px 40px rgba(0,0,0,0.2); min-width: 280px; border: 1px solid rgba(0,0,0,0.1); }
#regio-exif-popup h3 { margin: 0 0 15px 0; border-bottom: 1px dashed rgba(0,0,0,0.15); padding-bottom: 10px; font-size: 18px; color: #2d3436; }
#regio-exif-popup p { font-size: 13px; color: #636e72; margin: 0; line-height: 1.5; }
.exif-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; border-bottom: 1px solid rgba(0,0,0,0.05); padding-bottom: 4px; }
.exif-row span { color: #636e72; }
.exif-row strong { color: #2d3436; }
