/* Kartenhöhe an Bildschirm anpassen */
#map {
    height: 100vh;
    width: 100%;
}

/* Button zum Öffnen des Modals (nur auf Mobilgeräten sichtbar) */
.controls-toggle {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
    padding: 8px 12px;
    font-size: 1rem;
    display: none;
}

/* Seitenleiste für Desktop */
.sidebar-controls {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
    padding: 15px;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
    transform: translateX(0);
}

/* Modal für kleinere Bildschirme */
@media (max-width: 576px) {
    .controls-toggle {
        display: block;
    }

    .modal-dialog {
        margin: 0;
        width: 100%;
        max-width: 100%;
        height: 80vh;
    }

    .modal-content {
        height: 100%;
        border-radius: 0;
    }

    .modal-body {
        padding: 10px;
    }

    .year-control-container {
        flex-direction: row;
        align-items: center;
        gap: 5px;
    }

    .year-control-container input[type="range"] {
        width: 100%;
        margin-bottom: 10px;
    }

    .year-control-container button {
        width: 50px;
        margin: 5px 0;
    }

    #yearSlider {
        width: 100%;
    }

    #datePicker {
        width: 100%;
    }

    #eventsDisplay,
    #dateEventsDisplay {
        font-size: 0.85rem;
        max-height: 150px;
    }

    .line-controls label {
        font-size: 0.9rem;
    }

    .stops-checkbox,
    .fotos-checkbox {
        margin-left: 15px;
    }

    .sidebar-controls {
        display: none;
    }

    #map {
        width: 100%;
    }
}

/* Seitenleiste auf Desktop anzeigen */
@media (min-width: 577px) {
    .sidebar-controls {
        display: block;
    }

    #map {
        width: calc(100% - 350px);
    }

    .controls-toggle {
        display: none;
    }

    .modal {
        display: none;
    }
}

/* Allgemeines Styling für Steuerungselemente */
.control-group {
    margin-bottom: 15px;
}

.line-controls {
    margin-bottom: 10px;
}

.line-controls label {
    display: flex;
    align-items: center;
}

.line-controls input[type="checkbox"] {
    margin-right: 10px;
}

.stops-checkbox,
.fotos-checkbox {
    margin-left: 20px;
}

.lines-checkbox {
    margin-left: 20px;
    display: block;
}

#yearSlider {
    width: 200px;
}

#yearLabel,
#dateLabel {
    font-weight: bold;
    margin-left: 10px;
}

.year-control label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.year-control #yearDisplayDesktop {
    display: inline-block;
    min-width: 50px;
}

#datePicker {
    margin-top: 5px;
    width: 200px;
}

#eventsDisplay,
#dateEventsDisplay,
#eventsDisplayDesktop,
#dateEventsDisplayDesktop {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 5px;
    max-height: 400px;
    overflow-y: auto;
}

#quellenListe,
#quellenListeDesktop {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9em;
}

.leaflet-popup-content img {
    max-width: 300px;
    max-height: 200px;
    object-fit: contain;
}

.form-check-input {
    transform: scale(1.2);
    margin-right: 12px;
}

.map-date-overlay {
    position: absolute;
    top: 3%;
    left: 30%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    z-index: 1000;
    display: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@media (max-width: 576px) {
    .map-date-overlay {
        display: block;
    }
}

/* CSS-Filter für OpenTopoMap */
.leaflet-tile-pane img {
    filter: grayscale(80%) brightness(100%) contrast(100%) opacity(0.5);
}

/* Farbige Checkboxen */
#toggleLblauLines,
#toggleLblauStops,
#toggleLblauFotos {
    accent-color: blue;
}

#toggleLrotLines,
#toggleLrotStops,
#toggleLrotFotos {
    accent-color: red;
}

#toggleLgelbLines,
#toggleLgelbStops,
#toggleLgelbFotos {
    accent-color: orange;
}

#toggleLbetriebLines,
#toggleLbetriebStops,
#toggleLbetriebFotos {
    accent-color: green;
}