/* Styling for the entire map and page */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

#map {
    width: 100%;
    height: 100%;
}

/* The main control box at the top-left of the map. */
.map-controls {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1000;
    background: rgba(255,255,255,0.8);
    padding: 8px 12px;
    font-family: Arial, Helvetica, sans-serif;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    border-radius: 5px;
    text-align: left;
}

/* Media Query for a more advanced mobile layout */
@media (max-width: 768px) {
    .map-controls {
        font-size: 0.9em;
        padding: 6px 10px;
    }

    /* Position the zoom control on the top-right side */
    .leaflet-control-zoom {
        top: 80px !important; /* Den Wert deutlich erhöhen */
        right: 10px !important;
        left: auto !important;
        z-index: 1001 !important;
    }

    /* Position the geolocate button below the zoom control on the right side */
    .geolocate-button {
        top: 150px !important; /* Passt den Abstand von oben an */
        right: 10px !important;
        left: auto !important;
        z-index: 1001 !important;
    }
}

/* Styling for the header of the control box (title + button) */
.map-controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Styling for the expand/collapse button */
.toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5em;
    padding: 0;
    line-height: 1;
    transition: transform 0.3s ease;
    z-index: 10;
}

/* Animation for the button when collapsed */
.toggle-btn.collapsed .bi-chevron-up {
    transform: rotate(180deg);
}

/* The collapsible content box */
#controls-content {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding-top 0.3s ease-out;
    padding-top: 10px;
}

/* State when the box is collapsed */
#controls-content.collapsed {
    max-height: 0;
    padding-top: 0;
}

.map-controls h1 {
    margin: 0;
    font-size: 1.5em;
    color: #333;
    font-weight: normal;
}

.map-style-switcher {
    margin-top: 5px;
    font-size: 0.9em;
    text-align: left;
}

.leaflet-tooltip.my-label {
    background: rgba(255,255,255,0.8);
    border: 1px solid #333;
    color: #333;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

/* The legend box at the bottom-left of the map. */
.info.legend {
    background: white;
    padding: 6px 8px;
    font: 14px/16px Arial, Helvetica, sans-serif;
    background-color: rgba(255,255,255,0.8);
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    border-radius: 5px;
    position: relative;
    max-width: 90%;
    cursor: pointer;

    /* Smaller font size for the legend text */
    font-size: 10px;
    line-height: 1.2;
}

.info.legend h4 {
    margin: 0 0 5px;
    color: #777;
    /* Smaller font size for the legend header */
    font-size: 12px;
}

.info.legend ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.info.legend li {
    margin-bottom: 4px;
}

.legend-close-button {
    display: none;
}

.search-link {
    background: white;
    padding: 10px 15px;
    font: 16px/18px Arial, Helvetica, sans-serif;
    background-color: rgba(255,255,255,0.8);
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
}

.search-link a {
    color: #333;
    text-decoration: none;
    font-weight: bold;
}

.search-link a:hover {
    text-decoration: underline;
}

.h1-control, .h1-control-old {
    display: none;
}

.popup-content-wrapper {
    max-height: 400px;
    overflow-y: auto;
    max-width: 300px;
}

.small-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
    margin: 5px;
    border: 2px solid #ddd;
    border-radius: 5px;
    transition: transform 0.2s;
}

.small-image:hover {
    transform: scale(1.05);
    border-color: #007bff;
}

.image-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
}

.modal-content {
    display: block;
    width: auto;
    max-width: 90%;
    max-height: 90%;
    animation-name: zoom;
    animation-duration: 0.6s;
}

.modal-description {
    margin: auto;
    display: block;
    width: 90%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.5);
    padding: 5px 10px;
    border-radius: 5px;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 25px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    z-index: 10001;
    text-shadow: 2px 2px 4px #000;
    cursor: pointer;
}

.close-modal:hover, .close-modal:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

@keyframes zoom {
    from {transform:scale(0)}
    to {transform:scale(1)}
}

#uploadFormContainer h4 {
    margin-top: 5px;
    margin-bottom: 5px;
    font-size: 1.1em;
}

#uploadForm label {
    display: block;
    margin-top: 8px;
    font-weight: bold;
}

#uploadForm textarea {
    width: 100%;
    box-sizing: border-box;
    margin-top: 5px;
    resize: vertical;
}

#uploadForm input[type="file"], #uploadForm button {
    margin-top: 8px;
    display: block;
    width: 100%;
}

.leaflet-marker-icon.leaflet-zoom-animated.leaflet-interactive img.mushroom-icon {
    border-radius: 50%;
}

.mushroom-icon {
    border-radius: 50%;
}

.geolocate-button {
    background-color: #fff;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-compass"><circle cx="12" cy="12" r="10"></circle><polygon points="16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76"></polygon></svg>');
    background-repeat: no-repeat;
    background-position: center;
    width: 36px;
    height: 36px;
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 1px 5px rgba(0,0,0,0.65);
    text-align: center;
    line-height: 36px;
    color: transparent;
    font-size: 0;
    overflow: hidden;
    z-index: 1000;
}

.geolocate-button:hover {
    background-color: #f4f4f4;
}

.delete-button {
    color: red;
    cursor: pointer;
    font-size: 0.8em;
    margin-top: 5px;
    text-decoration: underline;
}

.delete-button:hover {
    color: darkred;
}

.privacy-switcher {
    margin-top: 10px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.9em;
}

.privacy-switcher label {
    display: inline-block;
    margin-left: 5px;
    vertical-align: middle;
}

.privacy-switcher input[type="checkbox"] {
    vertical-align: middle;
}

.visibility-switcher-popup {
    margin-top: 10px;
}

.visibility-switcher-popup label {
    font-weight: normal;
}
