/* XPED Location Map – Frontend Styles */

:root {
    --xped-primary: #007acc;
    --xped-bg:      #062940;
    --xped-surface: #ffffff;
    --xped-text:    #062940;
    --xped-accent:  #ffd617;
}

/* ──────────────────────────────────────────
   Map Container
────────────────────────────────────────── */
.xped-location-map-wrapper {
    padding: 12px !important;
    background: #062940 !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    position: relative !important;
    z-index: 0 !important;
    isolation: isolate !important;
}

/* ──────────────────────────────────────────
   Layout: Sidebar + Map nebeneinander
────────────────────────────────────────── */
.xped-map-layout {
    display: flex !important;
    gap: 10px !important;
    align-items: stretch !important;
}

/* Sidebar */
.xped-map-sidebar {
    width: 200px !important;
    flex-shrink: 0 !important;
    background: rgba(255,255,255,0.05) !important;
    border-radius: 4px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    /* Höhe wird per JS gesetzt – align-items:stretch reicht bei dynamischem Content nicht */
}

.xped-sidebar-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 4px 0 !important;
}

.xped-sidebar-item {
    padding: 9px 14px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: rgba(255,255,255,0.75) !important;
    cursor: pointer !important;
    line-height: 1.35 !important;
    border-left: 3px solid transparent !important;
    transition: background 0.15s, color 0.15s, border-color 0.15s !important;
    word-break: break-word !important;
}

.xped-sidebar-item:hover {
    background: rgba(255,255,255,0.08) !important;
    color: #ffffff !important;
    border-left-color: rgba(255,214,23,0.5) !important;
}

.xped-sidebar-item.is-active {
    background: rgba(255,214,23,0.12) !important;
    color: #ffd617 !important;
    border-left-color: #ffd617 !important;
}

/* Karte nimmt restlichen Platz ein */
#xped-location-map-canvas {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    border-radius: 4px !important;
    overflow: hidden !important;
}

/* ──────────────────────────────────────────
   Custom Marker
────────────────────────────────────────── */
.xped-marker-icon {
    background: transparent !important;
    border: none !important;
}

.xped-marker-pin {
    width: 32px !important;
    height: 42px !important;
    position: relative !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
}

.xped-marker-pin::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 50% !important;
    width: 32px !important;
    height: 32px !important;
    background: #ffd617 !important;
    border-radius: 50% 50% 50% 0 !important;
    transform: translateX(-50%) rotate(-45deg) !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35) !important;
}

.xped-marker-pin::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 8px !important;
    height: 8px !important;
    background: #ffd617 !important;
    border-radius: 50% !important;
    opacity: 0.4 !important;
    filter: blur(2px) !important;
}

.xped-marker-pin svg {
    position: relative !important;
    z-index: 1 !important;
    margin-top: 7px !important;
}

/* ──────────────────────────────────────────
   Popup Wrapper
────────────────────────────────────────── */
.xped-popup .leaflet-popup-content-wrapper {
    background: #ffffff !important;
    color: #062940 !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 16px rgba(6,41,64,0.2) !important;
    border: none !important;
    padding: 0 !important;
    width: 200px !important;
    max-width: 200px !important;
}

.xped-popup .leaflet-popup-content {
    margin: 0 !important;
    font-family: inherit !important;
    width: 200px !important;
    max-width: 200px !important;
}

.xped-popup .leaflet-popup-tip {
    background: #ffffff !important;
}

/* Close-Button */
.xped-popup .leaflet-popup-close-button {
    font-size: 18px !important;
    font-weight: 300 !important;
    color: #062940 !important;
    top: 8px !important;
    right: 10px !important;
    width: 22px !important;
    height: 22px !important;
    line-height: 22px !important;
    text-align: center !important;
    opacity: 0.4 !important;
    transition: opacity 0.15s !important;
    background: none !important;
}

.xped-popup .leaflet-popup-close-button:hover {
    opacity: 1 !important;
    background: none !important;
    color: #062940 !important;
}

/* ──────────────────────────────────────────
   Popup Content
────────────────────────────────────────── */
.xped-popup-content {
    padding: 10px 12px 8px 12px !important;
    box-sizing: border-box !important;
}

.xped-popup-name {
    font-size: 12px !important; /*12!*/
    font-weight: 700 !important;
    color: #062940 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.07em !important;
    margin: 0 0 5px 0 !important;
    line-height: 1.3 !important;
    opacity: 0.45 !important;
    padding: 0 16px 0 0 !important;
    display: block !important;
}

.xped-popup-description {
    font-size: 11px !important;
    color: #062940 !important;
    margin: 0 0 6px 0 !important;
    line-height: 1.4 !important;
}

.xped-popup-description p {
    font-size: 11px !important;
    color: #062940 !important;
    margin: 0 0 3px 0 !important;
    line-height: 1.4 !important;
}

.xped-popup-description p:first-child { margin-top: 0 !important; }
.xped-popup-description p:last-child  { margin-bottom: 0 !important; }

.xped-popup-address {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #062940 !important;
    margin: 0 0 6px 0 !important;
    line-height: 1.35 !important;
    display: block !important;
    word-break: break-word !important;
}

.xped-popup-contacts {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    margin: 6px 0 0 0 !important;
    padding: 6px 0 0 0 !important;
    border-top: 1px solid rgba(6,41,64,0.1) !important;
}

.xped-popup-link {
    font-size: 11px !important;
    font-weight: 500 !important;
    color: #007acc !important;
    text-decoration: none !important;
    word-break: break-all !important;
    transition: color 0.15s !important;
    display: block !important;
}

.xped-popup-link:hover {
    color: #062940 !important;
    text-decoration: underline !important;
}

/* ──────────────────────────────────────────
   Responsive
────────────────────────────────────────── */
@media (max-width: 700px) {
    .xped-location-map-wrapper {
        padding: 6px !important;
        border-radius: 4px !important;
    }

    /* Auf Mobile: Sidebar oben, Karte darunter */
    .xped-map-layout {
        flex-direction: column !important;
    }

    .xped-map-sidebar {
        width: 100% !important;
        max-height: 140px !important;
        border-radius: 4px 4px 0 0 !important;
    }

    .xped-sidebar-list {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        padding: 4px !important;
        gap: 0 !important;
    }

    .xped-sidebar-item {
        white-space: nowrap !important;
        border-left: none !important;
        border-bottom: 3px solid transparent !important;
        flex-shrink: 0 !important;
    }

    .xped-sidebar-item.is-active {
        border-left-color: transparent !important;
        border-bottom-color: #ffd617 !important;
    }

    .xped-popup .leaflet-popup-content-wrapper,
    .xped-popup .leaflet-popup-content {
        width: 180px !important;
        max-width: 180px !important;
    }
}
