#diving-map-container {
    width: 100%;
    /* Make the map container take the full width of its parent */
    height: 70vh;
    /* Set the height to fill the viewport */
    transform: translateZ(0);
    /* Hardware acceleration for smooth rendering */
    max-height: 100%;
    /* Prevent overflow */
    box-sizing: border-box;
    /* Prevent padding/margin issues */
}

.leaflet-control-custom-home {
    background-color: white;
    border: none;
    padding: 5px;
    cursor: pointer;
    border-radius: 8px; /* Makes the button circular */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Optional: Add a subtle shadow */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; /* Set a fixed width for the button */
    height: 40px; /* Set a fixed height for the button */
}

.leaflet-control-custom-home:hover {
    background-color: #f0f0f0; /* Optional: Add a hover effect */
}

.leaflet-control-custom-home-icon {
    width: 24px;
    height: 24px;
}


/* Container for the popup */

.leaflet-popup-content {
    width: 600px !important;
}

.popup-container {
    max-height: 300px; /* Set a maximum height for the popup */
    font-size: 14px;
    line-height: 1.4;
}

/* Flexbox layout for image and text */
.popup-content {
    display: flex;
    align-items: flex-start; 
    flex-direction: row; /* Align items in a row */
    gap: 15px; /* Space between the image and text */

}

/* Image inside the popup */
.popup-image {
    width: 50%;
    height: auto;
    margin: 5px 0;
    border-radius: 5px;
    object-fit: cover; /* Maintain aspect ratio */
}

/* Text container */
.popup-text {
    flex-grow: 1; /* Allow the text to take up the remaining space */
    display: flex;
    flex-direction: column; /* Stack the text vertically */
    gap: 10px; /* Space between text elements */
    align-items: center; /* Center align text */
}

/* Title styling */
.popup-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}
/* List inside the popup */
.popup-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column; /* Stack list items vertically */
    gap: 5px; /* Add spacing between list items */
}

/* List items inside the popup */
.popup-list-item {
    margin: 5px 0;
}

/* Link inside the popup */
.popup-link {
    color: #007BFF;
    text-decoration: none;
}

.popup-link:hover {
    text-decoration: underline;
}

/* Override WordPress theme conflicts */
#diving-map-container * {
    box-sizing: border-box !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .custom-popup .leaflet-popup-content {
        max-width: 250px; /* Narrower popups on mobile */
        overflow: hidden; /* Prevent content from overflowing */
        word-wrap: break-word; /* Ensure long text wraps properly */
        text-align: left; /* Align text to the left for readability */
        padding: 10px; /* Add padding for better spacing */
    }

    .popup-content {
        flex-direction: column; /* Stack image and text vertically */
        align-items: flex-start; /* Center align text */
    }

    .popup-image {
        width: 100%; /* Full width on mobile */
        height: auto; /* Maintain aspect ratio */
    }
    .popup-text {
        width: 100%; /* Full width on mobile */
        align-items: flex-start; /* Align text to the left */
    }

    .popup-title {
        font-size: 16px; /* Adjust font size for smaller screens */
    }

    .popup-list-item {
        font-size: 12px; /* Adjust font size for readability */
        word-wrap: break-word; /* Ensure long text wraps properly */
        line-height: .5;
        padding: 0;
        margin-bottom: 1px;
    }
    .leaflet-popup-content {
        margin: 10px 10px 10px 10px; /* Add margin to the popup */
    }
}

/* --- Popup details layout: carousel left, text right (desktop) --- */
.popup-details {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
}
.popup-details .popup-carousel {
    flex: 0 0 420px;
    width: 420px;
    height: 280px;
    max-width: 45vw;
    max-height: 60vh;
    margin: 0;
}
.popup-details .popup-container {
    flex: 1 1 0;
    max-width: 420px;
}

@media (max-width: 900px) {
    .popup-details {
        flex-direction: column;
        gap: 12px;
    }
    .popup-details .popup-carousel,
    .popup-details .popup-container {
        max-width: 100%;
        width: 100%;
    }
    .popup-details .popup-carousel {
        height: 180px;
    }
}

/* --- Cluster hover tooltip styles --- */
#cluster-hover-tooltip {
    font-size: 15px;
    line-height: 1.5;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    padding: 14px 16px 14px 16px;
    min-width: 220px;
    max-width: 320px;
    color: #222;
}
#cluster-hover-tooltip div[style*="font-weight:bold"] {
    color: #007BFF;
    font-size: 16px;
    margin-bottom: 10px;
}
#cluster-hover-tooltip h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
}
#cluster-hover-tooltip img {
    border-radius: 6px;
    margin-bottom: 8px;
    max-width: 100%;
    height: auto;
}
#cluster-hover-tooltip p {
    margin: 0;
    font-size: 14px;
    color: #444;
}

/* Marker hover tooltip (Leaflet custom class) */
.marker-hover-tooltip-leaflet {
  background: #fff;
  color: #1a1a1a;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  padding: 12px 16px;
  min-width: 200px;
  max-width: 320px;
  font-size: 15px;
  line-height: 1.5;
  pointer-events: none;
}
.marker-hover-tooltip {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.marker-hover-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 2px;
}
.marker-hover-title {
  font-weight: bold;
  font-size: 16px;
  color: #007BFF;
}
.marker-hover-region, .marker-hover-subarea {
  font-size: 13px;
  color: #666;
}
.marker-hover-summary {
  font-size: 14px;
  color: #222;
  margin: 2px 0 2px 0;
}
.marker-hover-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12px;
  color: #888;
}
.marker-hover-meta li {
  margin: 0;
  padding: 0;
  color: #888;
}
.marker-hover-snorkeling {
  color: #009688;
}
@media (max-width: 600px) {
  .marker-hover-tooltip-leaflet {
    min-width: 120px;
    max-width: 98vw;
    font-size: 13px;
    padding: 8px 8px;
  }
  .marker-hover-title {
    font-size: 14px;
  }
}