html, body {
    height: 100%;
    margin: 0;
    font-size: 16px; /* Adjust base font size here if necessary */
    overflow: hidden; /* Prevents scrolling which Bootstrap can sometimes enforce */
}
#Map {
    width: 97%;
    height: 90vh; /* Adjust the map height to leave space for controls */
    min-height: 400px;
    margin: 0 auto; /* Center the map by automatically adjusting left and right margins */
    box-sizing: border-box;
    /* margin-right: 1.5%;
    margin-left: 2.5%; */
}
.legend {
    line-height: 1.125em;
    color: #333333;
    font-family: 'Open Sans', Helvetica, sans-serif;
    padding: 0.375em 0.5em;
    background: white;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0.9375em rgba(0, 0, 0, 0.2);
    border-radius: 0.3125em;
}
.legend i {
    width: 1.125em;
    height: 1.125em;
    float: left;
    margin-right: 0.5em;
    opacity: 0.7;
}
.legend img {
    width: 13.75em; /* Adjust image size to better fit the new layout */
    height: auto;
    float: left;
}
.legend p {
    font-size: 12px;
    line-height: 18px;
    margin: 0;
}
.loading-container {
    display: none; /* Initially hidden, shown during data load */
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3c4180;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 2s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
#loadingText {
    color: rgba(203, 174, 8, 0.845);
    text-align: center;
    margin-top: 20px;
    font-size: 20px;
}
.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    margin: 6px 0;
}
.controls .form-group, .controls .btn {
    margin: 5px;
    flex: 1 1 auto;
    min-width: 150px;
}
.controls .btn {
    pointer-events: none; /* Disabled by default, enabled conditionally */
}
.controls .btn-active {
    pointer-events: auto; /* Re-enable pointer events for active buttons */
}
.scrollable-select {
    max-height: 10%; /* Adjust this value as needed */
    overflow-y: auto;
}
#colorbar {
    background: white;
    padding: 10px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
}
.colorbar-container {
    background: rgba(255, 255, 255, 0.2); /* Semi-transparent background */
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); /* Soft shadow */
    width: 70%; /* Fixed width for vertical colorbar */
    /* position: absolute; */
    left: 20%; /* Close to the left edge */
    top: 50%; /* Start from 50% of the viewport height */
    transform: translateY(-50%); /* Adjust to center it vertically */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    max-height: 80vh; /* Prevent the colorbar from going out of viewport */
    gap: 30%
     
}

#colorbarCanvas {
    width: 100%; /* Canvas fills container width */
    height: 30vh; /* Canvas fills container height */
    display: block;
    opacity: 0.6;
}

.label {
    font-size: calc(0.4vw + 0.4em); /* Responsive font size */
    color: #c16727; /* Softer text color */
    text-align: center;
    margin-bottom: 20%;
}

.min-max-label {
    font-size: calc(0.8vw + 0.3em); /* Smaller font size for min/max values */
    color: #4d4d4d;
    text-align: center;
    margin: 45% 0; /* Adds space between the value and the gradient */
}

.deficit-legend {
    background: rgba(255, 255, 255, 0.9); /* Slight transparency */
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); /* Soft shadow */
    /* font-family: Arial, sans-serif; */
    /* font-size: 14px; */
    line-height: 1.5;
    transform: translateY(-50%); 
    display: flex;
    flex-direction: column;
    gap: 1vw; /* Spacing between color patches */
}

.deficit-legend div {
    display: flex;
    align-items: center;
    gap: 30%; /* Space between the color box and the label */
}

.deficit-legend div div {
    width: 2vw;  /* Width scales with viewport width */
    height: 2vw; /* Height scales with viewport width */
    border-radius: 3px;
    gap: 30%
}
.color-patch {
    width: 20px;
    height: 20px;
    border-radius: 4px; /* Rounded corners for the patch */
}