body {
    margin: 0;
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    background-color: #f0f0f0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

header {
    background: linear-gradient(to right, #b8e4ff37, #b8e4ff93, #051262, #051262, #000000);
    color: #fff;
    text-align: center;
    padding: 0.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid #000000;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    height: 2.5rem;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.5rem;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.header-container h1 {
    margin: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.button-container {
    margin-left: auto;
}

#logoutButton {
    background: linear-gradient(135deg, #bf5a5a, #bf8d58);
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-size: 1.1rem;
}
#LoginButton {
    background: linear-gradient(135deg, #5abf6d, #58bf8d);
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-size: 1.1rem;
}

footer {
    background: linear-gradient(to right, #b8e4ff37, #b8e4ff93, #051262, #051262, #000000);
    color: #fff;
    position: fixed;
    width: 100%;
    bottom: 0;
    box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    padding: 0rem; /* Reduce padding to make footer height smaller */
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 0 auto; /* Center the container */
}

.footer-logo, .footer-center, .footer-contact {
    flex: 1; /* Ensure each section takes equal space */
    display: flex;
    align-items: center;
}

.footer-logo {
    justify-content: flex-start;
    text-align: left; /* Ensure text alignment is to the left */
}

.footer-center {
    justify-content: center;
    text-align: center;
}

.footer-contact {
    justify-content: flex-end;
    text-align: right; /* Ensure text alignment is to the right */
}

footer p {
    margin: 0.2rem; /* Reduce margin to minimize height */
}

footer a {
    color: #fff;
    text-decoration: none;
}

footer img {
    width: 50px;
    margin: 0; /* Ensure no extra margin around the image */
}
.custom-container {
    display: flex;
    flex: 1;
    width: 100vw; /* Ensure full viewport width */
    height: calc(100vh - 4.5rem); /* Full height minus header and footer */
    margin: 0; /* Remove default margin */
    padding: 0; /* Remove default padding */
    margin-top: 0rem; /* Adjust for header height */
    margin-bottom: 2rem; /* Adjust for footer height */
}

.map {
    flex: 1;
    background-color: #e0e0e0;
}

.stat-sidebar {
    width: 35vw;
    overflow-y: auto;
    background: linear-gradient(to right, #b8e4ff37, #b8e4ff93, #051262, #051262, #000000);
    border-left: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    padding: 10px;
}

/* The Histogram Modal */
#histogram-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    height: 80vh;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.5);
}

/* Modal Content */
#histogram-modal .modal-content {
    background-color: #fff;
    margin: auto;
    border-radius: 10px;
    border: 1px solid #888;
    width: 100%;
    height: 100%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 5px;
    box-sizing: border-box;
}

/* Close Button */
.close-btn {
    color: #aaa;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 5px;
    right: 5px;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #333;
}

/* Histogram Canvas */
#histogram-canvas {
    flex: 1;
    max-height: 85%;
    width: 100%;
}

/* Slider Container */
#histogram-modal .mb-2 {
    margin-top: 5px;
    padding: 0;
    width: 100%;
    height: 15%; /* Make sure slider takes up the remaining height */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#bins-slider {
    width: 100%;
    margin-top: 3px;
    height: 6px;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    #histogram-modal {
        width: 90vw;
        height: 90vh;
    }

    #histogram-modal .modal-content {
        padding: 5px;
    }

    .close-btn {
        font-size: 20px;
    }
}

#attribute-table-container {
    width: 100%;
    background-color: #ffffffcc;
    border: 1px solid #cccccc;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex: 2; /* Allow it to grow and take more space */
    overflow-y: auto;
    margin-top: 5px; /* Add margin at the top */
}

.attribute-table {
    width: 100%;
    border-collapse: collapse;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

.attribute-table th,
.attribute-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #dddddd;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px; /* Adjust as needed */
}

.attribute-table th {
    background-color: #f2f2f2;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 1;
}

.attribute-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.attribute-table tr:hover {
    background-color: #e6f7ff;
}

.attribute-table td {
    white-space: nowrap; /* Prevents content from wrapping */
    overflow: hidden;
    text-overflow: ellipsis; /* Adds ellipsis for overflowing text */
}

.attribute-table th,
.attribute-table td {
    position: relative;
}

.attribute-table td:hover::after {
    content: attr(title);
    position: absolute;
    left: 0;
    bottom: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 5px;
    border-radius: 3px;
    white-space: normal;
    overflow: visible;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}


#count-wrapper {
    width: 100%;
    background-color: #ffffffcc;
    border: 1px solid #ccc;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    font-size: 14px;
    color: #333;
    display: flex;
    justify-content: space-between;
}

#feature-count, #selection-count {
    margin: 5px 10px;
}

/* Sidebar Styling */
.sidebar {
    position: fixed;
    top: 50%;
    left: -55vw;
    width: 55vw;
    height: 85%; /* Adjust height as needed */
    background: linear-gradient(to right, #b8e4ff40, #05116140);
    border-radius: 15px;
    color: #fff;
    padding: 1rem;
    transition: left 0.3s, visibility 0s 0.3s, opacity 0.3s, top 0.3s;
    box-shadow: 4px 0 8px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    overflow: auto;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-50%);
}

.sidebar.open {
    left: 55px;
    visibility: visible;
    opacity: 1;
    border-radius: 15px;
    overflow: auto;
}

.sidebar h2 {
    margin: 1rem 0;
    font-size: 1.5rem;
    border-bottom: 1px solid #666;
    padding-bottom: 0.5rem;
}

.sidebar label {
    display: block;
    margin-bottom: 0.5rem;
}

.sidebar select {
    margin-bottom: 1rem;
    padding: 0.5rem;
    width: 100%;
    border: 1px solid #666;
    border-radius: 0.25rem;
    background-color: #555;
    color: #fff;
}

.sidebar select option {
    background-color: #444;
    color: #fff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Database Section Styling */

.database-item {
    padding: 10px;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 5px;
    margin: 5px 0;
    transition: background-color 0.3s, border-color 0.3s;
}

.database-item:hover {
    background-color: #f0f0f0;
}

.selected-database {
    background-color: #d0e0f0;
    border-color: #ff0000;
    font-weight: bold;
    color: #007bff;
}

/* Licensee Section Styling */
#licensee-tab {
    padding: 15px;
}

#licensee-tab h2 {
    font-size: 1.5rem;
    color: #000;
    margin-bottom: 15px;
}

#unselect-all {
    border-radius: 25px;
}

#licensee-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px; /* Space between licensee items */
    justify-content: center;
    margin-top: 10px;
}

/* Basemaps Section Styling */
.basemap-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px; /* Space between the cards */
    margin-top: 10px;
}

.basemap-card {
    width: 120px; /* Slightly larger to improve visibility */
    text-align: center;
    cursor: pointer;
}

.basemap-card img {
    width: 100%;
    height: 80px; /* Reduced height for compactness */
    object-fit: cover;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.basemap-card p {
    margin-top: 5px;
    font-weight: bold;
    font-size: 12px; /* Slightly larger font size */
}

/* Card and Filter Section Styling */
.card {
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: #007bff;
    color: #fff;
    border-radius: 10px 10px 0 0;
    padding: 10px 0;
}

.filter-section {
    padding: 15px;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.input-group-text {
    width: auto;
}

.custom-switch {
    margin-bottom: 1rem;
}

.custom-select:disabled {
    background-color: #666;
    color: #ccc;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 0;
    color: #000000;
}

.input-group-prepend .input-group-text {
    background-color: #ddd;
    border: 1px solid #ccc;
    color: #333;
}

.input-group .custom-select {
    border: 1px solid #ccc;
    color: #333;
    background-color: #fff;
}

.input-group .custom-select:focus {
    border-color: #666;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

/* Custom Control Label Styling */
.custom-control-label {
    margin-left: 0.5rem;
    color: #000;
    cursor: pointer;
}

.custom-control-input:checked ~ .custom-control-label::before {
    background-color: #007bff;
    border-color: #007bff;
}

/* Button Styling */
#or-logic-toggle, #and-logic-toggle {
    border-radius: 20px;
    width: 80px;
    text-align: center;
}

/* Toggle Bar Styling */
.toggle-bar {
    position: fixed;
    top: 50%;
    left: 5px; /* Adjust this value as needed to control the horizontal position */
    transform: translateY(-50%);
    width: 50px;  /* Adjust as needed */
    background-color: rgba(51, 51, 51, 0.2); /* Semi-transparent background */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Center items vertically */
    padding: 1rem 0; /* Adjust top/bottom padding as needed */
    box-shadow: 4px 4px 8px rgba(255, 255, 255, 0.3);
    z-index: 1000;
    border-radius: 15px; /* Rounded corners */
    transition: background-color 0.3s, box-shadow 0.3s;
}

.toggle-bar:hover {
    background-color: rgba(51, 51, 51, 0.4); /* Darken background on hover */
    box-shadow: 6px 6px 12px rgba(0, 0, 0, 0.4); /* Increase shadow on hover */
}

.tab-button {
    background-color: #ddd;
    border: none;
    padding: 10px;
    cursor: pointer;
    text-align: center;
    margin: 10px 0; /* Adjust vertical margin as needed */
    width: 40px;  /* Adjust as needed */
    height: 40px;  /* Adjust as needed */
    border-radius: 50%;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); /* Add some shadow for a floating effect */
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.tab-button:hover {
    background-color: #ccc;
    transform: scale(1.1); /* Slightly increase the size on hover */
    box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.4); /* Increase shadow on hover */
}

.tab-button.active {
    background-color: #bbb;
}

/* Popup Styling */
#popup {
    position: absolute;
    background-color: #fff;
    padding: 1rem;
    border: 1px solid #333;
    z-index: 10;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border-radius: 0.25rem;
    width: 18.75rem; /* 300px / 16 */
    height: 12.5rem; /* 200px / 16 */
    overflow: auto;
}

#popup h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #333;
}

#popup .content {
    font-size: 0.875rem;
    color: #666;
}

#popup .content p {
    margin: 0.25rem 0;
}

#popup .content p strong {
    color: #333;
}
.popup-closer {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

/* Spinner styles */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8); /* White background with transparency */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1001; /* Ensures it stays on top */
}

.spinner {
    border: 16px solid rgba(0, 0, 0, 0.1); /* Light grey with transparency */
    border-top: 16px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 150px; /* Increased size */
    height: 150px; /* Increased size */
    animation: spin 1s linear infinite; /* Faster spin */
    box-shadow: 0 0 30px #0000008c; /* Subtle shadow for depth */
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner-emoji {
    font-size: 48px;
    animation: spin 10s linear infinite;
}

.spinner-message {
    margin-top: 20px;
    font-size: 18px;
    color: #000;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Blur background when spinner is active */
body.loading #map,
body.loading header,
body.loading #sidebar,
body.loading footer,
body.loading #toggle-sidebar {
    filter: blur(5px);
}
