/* General body styling to prevent scrolling when mobile menu is open */
body.overflow-hidden {
    overflow: hidden;
}

.hidden {
    display: none !important;
}

#map-toast {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

#map-toast.show-toast {
    opacity: 1;
    visibility: visible;
}

/* Off-canvas menu styling */
#off-canvas-menu {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 80%; /* Adjust width as needed */
    max-width: 320px;
    background-color: #1f2937; /* bg-gray-800 */
    z-index: 9999; /* High z-index to be on top of other content */
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}


#off-canvas-menu.translate-x-0 {
    transform: translateX(0);
}

/* Overlay for the background */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background-color: #000;
    opacity: 0;
    z-index: 9998; /* Just below the menu */
    transition: opacity 0.3s ease-in-out;
}

#overlay:not(.hidden) {
    display: block;
}

/* Ensure map container does not interfere with menu */
#map {
    z-index: 1; /* Lower z-index than the menu and overlay */
}

.index-page-body footer {
    display: none;
}

@media (min-width: 768px) {
    #navbar-menu {
        display: flex !important;
    }
}

#filter-toggle-btn {
    z-index: 8500;
}

#summary-display {
    z-index: 8000;
}

#filterInfo {
    z-index: 9000;
}

#filter-overlay {
    z-index: 9000;
}

.leaflet-popup-close-button {
    color: #4b5563; /* text-gray-600 */
    font-size: 1.5rem; /* text-2xl (24px) */
    font-weight: 700; /* font-bold */
    padding: 0.75rem; /* p-3 (12px) */
    display: flex; /* Use flexbox for perfect centering */
    align-items: center;
    justify-content: center;
}

.leaflet-popup-close-button:hover {
    color: #111827; /* hover:text-gray-900 */
}

#more-modal #modal-content {
    transition: transform 0.3s ease-in-out;
    transform: translateY(100%);
}

#more-modal:not(.hidden) #modal-content {
    transform: translateY(0);
}

#more-modal #modal-overlay {
    transition: opacity 0.3s ease-in-out;
}
/* More modal styling */
#more-modal {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none; /* Allow clicks to pass through when hidden */
}

#more-modal.hidden {
    display: none;
}

#more-modal #modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: auto; /* Enable clicks on overlay when visible */
}

#more-modal:not(.hidden) #modal-overlay {
    opacity: 1;
}

#more-modal #modal-content {
    position: relative;
    background-color: #1f2937; /* bg-gray-800 */
    border-top-left-radius: 0.5rem; /* rounded-t-lg */
    border-top-right-radius: 0.5rem; /* rounded-t-lg */
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1), 0 -2px 4px -1px rgba(0, 0, 0, 0.06); /* shadow-lg */
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 50; /* Ensure it's above the overlay */
    pointer-events: auto; /* Enable clicks on content */
    max-height: 80vh; /* Limit height */
    overflow-y: auto; /* Enable scrolling if content overflows */
}

#more-modal:not(.hidden) #modal-content {
    transform: translateY(0);
}

.cat-modal-scrollable .overflow-y-auto {
    padding-top: 0;
    padding-bottom: 20px;
}

/* Professional Cat Modal Styling */
#catModal .bg-white {
    background-color: #ffffff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 5px 10px rgba(0, 0, 0, 0.05);
    border-radius: 12px;
}

#closeModal {
    color: #6c757d;
    transition: color 0.2s ease-in-out;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#closeModal:hover {
    color: #212529;
    background-color: rgba(255, 255, 255, 0.8);
}

/* Custom CSS Spinner */
.spinner-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(248, 249, 250, 0.5);
}

.lds-dual-ring {
    display: inline-block;
    width: 80px;
    height: 80px;
}

.lds-dual-ring:after {
    content: " ";
    display: block;
    width: 64px;
    height: 64px;
    margin: 8px;
    border-radius: 50%;
    border: 6px solid #ef4444;
    border-color: #ef4444 transparent #ef4444 transparent;
    animation: lds-dual-ring 1.2s linear infinite;
}

@keyframes lds-dual-ring {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.image-container {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

#modalImage {
    max-height: 60vh;
}

.thumbnail-wrapper {
    position: relative;
    width: 4rem; /* w-16 */
    height: 4rem; /* h-16 */
    border-radius: 8px;
    overflow: hidden;
}

.thumbnail-spinner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(248, 249, 250, 0.5);
}

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1f2937; /* bg-gray-800 */
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#preloader .spinner {
    border: 8px solid #f3f3f3; /* Light grey */
    border-top: 8px solid #ef4444; /* Red */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite;
}

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

.rounded-thumbnail-container {
    width: 48px; /* w-12 */
    height: 48px; /* h-12 */
    border-radius: 50%;
    overflow: hidden;
    flex-shrink-0;
}

.rounded-thumbnail-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}