/* ================================================================
   Langstreckenplaner 2 – benzinpreis.de
   ================================================================ */

/* Seiten-Wrapper: volle Höhe ohne Standard-Seitenabstand */
#lsp2-wrap {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px);
    overflow: hidden;
}

/* Steuerleiste oben */
#lsp2-controls {
    flex-shrink: 0;
    padding: 12px 16px 8px;
    background: #fff;
    border-bottom: 3px solid #ccc;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Titelzeile */
#lsp2-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

#lsp2-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: 0;
}

/* Formular-Grid */
.lsp2-form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
}

.lsp2-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.lsp2-field-start,
.lsp2-field-end {
    flex: 1 1 160px;
    min-width: 140px;
}

.lsp2-field label {
    font-size: 10px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.lsp2-field input[type="text"],
.lsp2-field input[type="time"],
.lsp2-field input[type="number"],
.lsp2-field select {
    padding: 7px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 13px;
    background: #fff;
    color: #222;
    outline: none;
    transition: border-color .15s;
    min-width: 0;
}

.lsp2-field input[type="text"]::placeholder { color: #aaa; }

.lsp2-field input:focus,
.lsp2-field select:focus {
    border-color: #e8451e;
    box-shadow: 0 0 0 2px rgba(232,69,30,.15);
}

.lsp2-buffer-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lsp2-buffer-wrap input[type="number"] {
    width: 68px;
}

.lsp2-buffer-unit {
    color: #888;
    font-size: 12px;
}

#lsp2-btn {
    padding: 8px 18px;
    background: #3a8a3a;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    transition: background .15s;
}

#lsp2-btn:hover { background: #2c6e2c; }
#lsp2-btn:disabled { background: #ccc; cursor: default; }

#lsp2-status {
    font-size: 12px;
    color: #888;
    min-height: 14px;
    padding-bottom: 2px;
}
#lsp2-status.error { color: #c0392b; }

/* Karte + Sidebar nebeneinander */
#lsp2-main {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
}

/* Routen-Info-Box über der Karte (unten links) */
#lsp2-route-info {
    position: absolute;
    bottom: 28px;
    left: 10px;
    z-index: 1000;
    background: rgba(20,20,40,0.82);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 5px 11px;
    border-radius: 5px;
    pointer-events: none;
    display: none;
    letter-spacing: 0.02em;
    box-shadow: 0 1px 6px rgba(0,0,0,.35);
}
#lsp2-route-info:not(:empty) { display: block; }

/* Routen-Info in der Sidebar */
#lsp2-route-summary {
    font-size: 11px;
    color: #888;
    font-weight: normal;
    margin-top: 2px;
}

/* Karte: position:relative damit Info-Box absolut darin platziert werden kann */
#lsp2-map {
    flex: 1;
    min-width: 0;
    position: relative;
}

/* Stationsliste rechts */
#lsp2-sidebar {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #ddd;
    background: #fafafa;
    overflow: hidden;
}

#lsp2-list-header {
    padding: 10px 14px;
    background: #fff;
    border-bottom: 2px solid #ccc;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#lsp2-list-header strong {
    font-size: 11px;
    font-weight: 700;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

#lsp2-list-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

#lsp2-count {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #e8451e;
    border-radius: 10px;
    padding: 1px 8px;
}

#lsp2-route-summary {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    letter-spacing: 0.01em;
}

#lsp2-list {
    flex: 1;
    overflow-y: auto;
}

/* Einzelne Station in der Liste */
.lsp2-station {
    padding: 8px 12px;
    border-bottom: 1px solid #e8e8e8;
    cursor: pointer;
    transition: background .1s;
}

.lsp2-station:hover { background: #f5f5f5; }
.lsp2-station.active { background: #fff4f1; border-left: 3px solid #e8451e; padding-left: 9px; }
.lsp2-station.cheapest { border-left: 3px solid #27ae60; padding-left: 9px; }
.lsp2-station.cheapest.active { border-left: 3px solid #e8451e; }

/* Obere Zeile: km-Badge + Ankunfts-Badge */
.lsp2-item-top {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
}

.lsp2-km-badge {
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: #555;
    border-radius: 3px;
    padding: 1px 6px;
    letter-spacing: 0.03em;
}

.lsp2-arrival-badge {
    font-size: 10px;
    color: #666;
    background: #eee;
    border-radius: 3px;
    padding: 1px 6px;
}

/* Hauptzeile: Info links, Preis rechts */
.lsp2-item-body {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.lsp2-item-info {
    min-width: 0;
    flex: 1;
}

.lsp2-station-brand {
    font-weight: bold;
    font-size: 13px;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lsp2-station-addr {
    font-size: 11px;
    color: #888;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lsp2-station-rise {
    font-size: 10px;
    color: #c0392b;
    font-weight: bold;
    margin-top: 3px;
}

/* Preis-Block rechts */
.lsp2-item-price {
    flex-shrink: 0;
    text-align: right;
}

.lsp2-price-main {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.1;
}

.lsp2-price-main.stale { color: #aaa !important; }

.lsp2-price-sub {
    font-size: 9px;
    color: #aaa;
    text-align: right;
    line-height: 1.6;
    white-space: nowrap;
    margin-top: 3px;
}

.lsp2-prognose-badge {
    display: inline-block;
    background: #e8451e;
    color: #000;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: 0.05em;
}

/* Leaflet-Popup: kein X, kompakter Rahmen */
.leaflet-popup-content-wrapper {
    border-radius: 4px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.leaflet-popup-content {
    margin: 2px 2px 4px 2px !important;
}
.leaflet-popup-close-button { display: none !important; }
.leaflet-popup-tip-container { margin-top: -1px; }

/* LRM-Steuerelement ausblenden (wir haben eigenes UI) */
.leaflet-routing-container { display: none !important; }

/* Responsive: Sidebar unter Karte bei kleinen Screens */
@media (max-width: 700px) {
    #lsp2-main { flex-direction: column; }
    #lsp2-sidebar { width: 100%; height: 220px; border-left: none; border-top: 1px solid #ddd; }
    #lsp2-map { flex: none; height: 55vh; }
}
