#map {
    width: 100%;
    height: 80vh;
    min-height: 300px;
    /* Adjust map height for the overlay */
    position: relative;
    margin: 0 auto;
    /* Center the map to account for any margins */
    box-sizing: border-box;
}

#map .mapbox-improve-map {
    display: none;
}

/* Container for popups and overlays */
.popup-form,
#details-overlay {
    font-size: 14px;
    color: #333;
    padding: 15px;
}

#details-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    background: #ffffffcc;
    padding: 15px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    z-index: 1;
    box-sizing: border-box;
    overflow-y: auto;
    scrollbar-width: thin;
    z-index: 3;
    max-height: 100%;
    max-width: 100%;
}

@media (orientation: portrait) {
    #details-overlay {
        left: 0;
        top: auto;
        padding-bottom: 20px;
        max-height: 50%;
        border-left: none;
    }
}

@media (orientation: landscape) {
    #details-overlay {
        width: 50vw;
    }
}

@media (min-width: 900px) and (orientation: landscape) {
    #details-overlay {
        width: 40vw;
    }
}

@media (min-width: 1900px) and (orientation: landscape) {
    #details-overlay {
        width: 30vw;
    }
}

@media (min-width: 3000px) and (orientation: landscape) {
    #details-overlay {
        width: 30vw;
    }
}

#forumOverlay {
    padding: 15px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffffee;
    align-items: center;
    justify-content: center;
    z-index: 3;
    overflow-y: auto;
    scrollbar-width: thin;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
    border-left: none;
}

.overlay-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.overlay-header {
    /* Ensures header is fixed and doesn’t scroll */
    flex-shrink: 0;
}

.overlay-body {
    /* Enables the form to scroll within available space */
    overflow-y: auto;
    flex-grow: 1;
    padding: 10px;
    margin-bottom: 10px;
}

.overlay-footer {
    /* Keeps buttons fixed at the bottom */
    flex-shrink: 0;
    background-color: #ffffffcc;
    padding: 10px;
    margin-bottom: 35px;
}


/* Headings for overlay and forms */
.popup-form h3,
#details-overlay h3 {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

/* Labels for input fields */
.popup-form label,
#details-overlay label {
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
    display: block;
}

/* Text inputs */
.popup-form input[type="text"],
.popup-form textarea,
#details-overlay input[type="text"],
#details-overlay textarea {
    width: calc(100% - 10px);
    padding: 8px;
    margin: 6px 0 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

/* Text area */
.popup-form textarea,
#details-overlay textarea {
    resize: vertical;
    min-height: 80px;
}

/* Container for form elements */
.popup-form .form-group,
#details-overlay .form-group {
    margin-bottom: 15px;
}


.mapboxgl-canvas-container.mapboxgl-interactive,
.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass {
    cursor: pointer;
}

.material-icons {
    color: #333333;
}















#forumContent {
    background-color: white;
    color: black;
    padding: 20px;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    box-sizing: border-box;
}

#discussionHistory {
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
}

#newMessage {
    width: 100%;
    height: 100px;
    margin-bottom: 10px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

#forumContent h2,
#diveContent h2,
#forumContent h3,
#diveContent h3 {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

#forumContent label,
#diveContent label {
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
    display: block;
}

#diveOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    /* Ensure it overlays the map */
}

#diveContent {
    background-color: white;
    color: black;
    padding: 20px;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    box-sizing: border-box;
}

#scheduledDives {
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
}

#diveDescription {
    width: 100%;
    height: 100px;
    margin-bottom: 10px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}





#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.loading-spinner {
    border: 16px solid #f3f3f3;
    border-top: 16px solid #3498db;
    border-radius: 50%;
    width: 120px;
    height: 120px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal {
    background: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.error-message {
    color: red;
    font-size: 0.9em;
    margin-bottom: 10px;
}


#details-overlay button.close-button,
#forumOverlay button.close-button {
    background-color: transparent;
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #333;
}

#details-overlay button.close-button:hover,
#forumOverlay button.close-button:hover {
    color: red;
}