#map {
    height: 400px;
    margin: 0 auto;
    margin-top: 15px;
    border-radius: 3px;
    position: relative;
}
/* Track & Photo popup content */
.track-popup .leaflet-popup-content,
.photo-popup .leaflet-popup-content {
    max-width: 300px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    background: transparent;
    margin: 0px;
    min-width: calc(2 / 3 * 100vw); /* Minimum width: exactly 2/3 of viewport width */
}
/* Default behavior: Responsive popup with min-width set to 50% of the viewport */
.track-popup .leaflet-popup-content-wrapper,
.photo-popup .leaflet-popup-content-wrapper {
    padding: 0;
    background: transparent;
    border: none;
    width: 100%;
    min-width: calc(2 / 3 * 100vw); /* Minimum width: exactly 2/3 of viewport width */
    max-width: none; /* No maximum width initially */
    height: auto;
}
.track-popup .leaflet-popup-tip,
.photo-popup .leaflet-popup-tip {
    background: gray;
}
.photo-popup .leaflet-popup-content img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
    border: 2px solid gray;
}
/* When viewport width is above a certain threshold, update the min-width */
@media (min-width: 600px) {
    .track-popup .leaflet-popup-content-wrapper,
    .photo-popup .leaflet-popup-content-wrapper {
        min-width: 400px !important;
    }
    .track-popup .leaflet-popup-content,
    .photo-popup .leaflet-popup-content {
        min-width: 400px !important; /* Minimum width: 66% of the viewport width */
    }
}
@media (min-width: 1000px) {
    #map {
        height: 600px;
        margin: 0 auto;
        margin-top: 15px;
        border-radius: 3px;
        position: relative;
    }
}
@media (min-width: 700px) {
    #map {
        height: 500px;
        margin: 0 auto;
        margin-top: 15px;
        border-radius: 3px;
        position: relative;
    }
}


/* Image popup style */
.popup-container {
    text-align: center;
}

.popup-image {
    width: 100%;
    max-width: 400px;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.popup-image:hover {
    transform: scale(1.01);
}

.popup-caption {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 14px;
    text-align: center;
    padding: 10px 5px 5px 5px;
    border-radius: 0 0 8px 8px;
    margin-top: -10px;
}