/**
 * Modern OSM Maps (MOM) - Premium Design System (Version 3.1.5)
 * 100% maßgeschneidertes CSS für High-End Interfaces
 */

:root {
    --mom-primary: #3b82f6;
    --mom-primary-hover: #2563eb;
    --mom-bg-dark: #0f172a;
    --mom-bg-glass: rgba(15, 23, 42, 0.6);
    --mom-border-glass: rgba(255, 255, 255, 0.08);
    --mom-text-light: #f8fafc;
    --mom-text-muted: #94a3b8;
    --mom-shadow-glow: 0 0 40px rgba(59, 130, 246, 0.15);
    --mom-radius: 20px;
}

/* Äußerer Dashboard-Rahmen */
.mom-dashboard-wrapper {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background: var(--mom-bg-dark);
    border-radius: var(--mom-radius);
    padding: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), var(--mom-shadow-glow);
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
    box-sizing: border-box;
}

/* Dashboard-Header (Mac-Style Fenstertitel) */
.mom-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 6px;
}

.mom-header-dots {
    display: flex;
    gap: 8px;
}

.mom-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.mom-dot.red { background: #ef4444; }
.mom-dot.yellow { background: #f59e0b; }
.mom-dot.green { background: #10b981; }

.mom-header-title {
    color: var(--mom-text-light);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    opacity: 0.8;
}

.mom-header-badge {
    background: rgba(59, 130, 246, 0.15);
    color: var(--mom-primary);
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 9999px;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Kartenbereich (Höhen-Responsivität) */
.mom-map-viewport-container {
    position: relative;
    width: 100%;
    /* Verwendet den dynamischen Wert aus der Shortcode-Höhe oder fällt elegant auf 500px zurück */
    height: var(--mom-map-height, 500px);
    max-height: 60vh; /* Verhindert ein Überlaufen auf Mobilgeräten */
    min-height: 320px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--mom-border-glass);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8);
    box-sizing: border-box;
}

.mom-map-viewport {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Floating Locate Button auf der Karte */
.mom-btn-floating-locate {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    background: #ffffff;
    border: none !important;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: pointer;
    color: #1e293b;
    transition: all 0.2s;
    padding: 0 !important;
}

.mom-btn-floating-locate:hover {
    transform: scale(1.05);
    color: var(--mom-primary);
}

/* Zentriertes Control-Deck UNTER der Karte */
.mom-control-deck {
    margin: 24px auto 0 auto;
    width: 100%;
    max-width: 720px;
    background: var(--mom-bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--mom-border-glass);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    box-sizing: border-box;
}

/* Control-Deck Tabs */
.mom-deck-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 20px;
}

.mom-deck-tab-btn {
    flex: 1;
    background: transparent !important;
    border: none !important;
    padding: 10px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--mom-text-muted) !important;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.mom-deck-tab-btn.active {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--mom-text-light) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.mom-deck-tab-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

/* Deck Content Panes */
.mom-deck-pane {
    display: none;
}

.mom-deck-pane.active {
    display: block;
}

/* Inputs & Formelemente */
.mom-search-flex-row {
    position: relative;
    width: 100%;
}

.mom-search-input, .mom-route-input {
    width: 100% !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: rgba(0, 0, 0, 0.2) !important;
    border-radius: 10px !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    color: var(--mom-text-light) !important;
    outline: none !important;
    box-shadow: none !important;
    transition: all 0.2s;
    box-sizing: border-box;
}

.mom-search-input:focus, .mom-route-input:focus {
    border-color: var(--mom-primary) !important;
    background: rgba(0, 0, 0, 0.3) !important;
}

/* Route Grid Layout */
.mom-route-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.mom-route-field {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mom-route-field label {
    font-size: 11px;
    font-weight: 700;
    color: var(--mom-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mom-route-input-wrapper {
    position: relative;
}

.mom-btn-locate {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent !important;
    border: none !important;
    color: var(--mom-text-muted);
    cursor: pointer;
    padding: 4px !important;
}

.mom-btn-locate:hover {
    color: var(--mom-primary);
}

/* Action Row */
.mom-deck-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}

.mom-travel-modes {
    display: flex;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    padding: 4px;
}

.mom-mode-btn {
    background: transparent !important;
    border: none !important;
    padding: 10px 14px !important;
    border-radius: 8px;
    cursor: pointer;
    color: var(--mom-text-muted);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mom-mode-btn.active {
    background: var(--mom-primary) !important;
    color: #ffffff;
}

.mom-btn-primary {
    background: var(--mom-primary) !important;
    border: none !important;
    color: #ffffff !important;
    padding: 12px 24px !important;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.mom-btn-primary:hover {
    background: var(--mom-primary-hover) !important;
}

/* Autocomplete Dropdowns */
.mom-search-results, .mom-route-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    margin: 6px 0 0 0 !important;
    padding: 6px 0 !important;
    list-style: none !important;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1001;
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
    display: none;
    box-sizing: border-box;
}

.mom-search-item {
    padding: 11px 16px;
    font-size: 13px;
    color: var(--mom-text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}

.mom-search-item:hover {
    background: rgba(59, 130, 246, 0.12);
    color: var(--mom-primary);
}

.mom-search-item-icon {
    margin-right: 10px;
    color: var(--mom-text-muted);
}

.mom-search-status {
    padding: 12px;
    text-align: center;
    font-size: 13px;
    color: var(--mom-text-muted);
}

/* Wegbeschreibung / Turn-by-Turn Panel */
.mom-directions-panel {
    margin-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 20px;
}

.mom-route-summary {
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--mom-text-light);
    margin-bottom: 14px;
}

.mom-summary-divider {
    margin: 0 8px;
    color: var(--mom-text-muted);
}

.mom-directions-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    max-height: 250px;
    overflow-y: auto;
}

.mom-direction-step {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px dashed rgba(255,255,255,0.05);
}

.mom-step-icon {
    margin-right: 12px;
    color: var(--mom-primary);
}

.mom-step-instruction {
    margin: 0 !important;
    font-size: 13px;
    color: var(--mom-text-light);
}

.mom-step-meta {
    margin: 2px 0 0 0 !important;
    font-size: 11px;
    color: var(--mom-text-muted);
}

/* Polyline Animation */
.mom-polyline-route {
    stroke-dasharray: 12, 12;
    animation: mom-dash 30s linear infinite;
}

@keyframes mom-dash {
    to {
        stroke-dashoffset: -1000;
    }
}

/* Custom Zoom-Controls für Leaflet */
.leaflet-bar {
    border: none !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
    border-radius: 8px !important;
    overflow: hidden;
}

.leaflet-bar a {
    background-color: #1e293b !important;
    color: var(--mom-text-light) !important;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
    transition: all 0.2s;
}

.leaflet-bar a:hover {
    background-color: var(--mom-primary) !important;
}

/* RESPONSIVE DESIGN - Nahtlose Anpassung */
@media (max-width: 768px) {
    .mom-dashboard-wrapper {
        padding: 12px;
        border-radius: 12px;
    }
    
    .mom-map-viewport-container {
        height: 380px !important; /* Smarter Mobile-Standardwert */
    }

    .mom-route-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .mom-deck-action-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .mom-travel-modes {
        justify-content: space-around;
    }

    .mom-btn-primary {
        width: 100%;
        text-align: center;
    }
}