/* Ensure the map page doesn't scroll but other pages can */
body.propertylistings {
  overflow: hidden;
}

#map {
  height: 100%;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  transition: margin-left 0.3s ease-in-out, width 0.3s ease-in-out;
}

/* Adjust map container when sidebar is visible */
body.sidebar-visible #map {
  margin-left: 260px; /* Match sidebar width */
  width: calc(100% - 260px); /* Adjust width to account for sidebar */
}

/* Info Window Styling */
.info-window {
  font-family: 'Arial', sans-serif;
  max-width: 320px;
  color: #191c1d;
  background-color: #fff;
  border-radius: 12px;
  padding: 0px 4px 4px;
  overflow: hidden;
}

.info-window h2 {
  font-size: 20px;
  font-weight: 400;
  margin: 0px 0px 8px 0px;
  color: #191c1d;
}

.thumbnail-container {
  width: 100%;
  height: 160px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background-color: #f1f3f4;
}

.info-window .thumbnail {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
}

.image-source {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 8px;
  background-color: rgba(255, 255, 255, 0.7);
  font-size: 10px;
  color: #757575;
  text-align: right;
}

.image-source a {
  color: #757575;
  text-decoration: none;
}

.image-source a:hover {
  text-decoration: underline;
}

.placeholder-img {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #444;
  font-size: 14px;
  text-align: center;
  background-color: #f1f3f4;
  border-radius: 8px;
}

.no-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.info-window .description {
  font-size: 14px;
  font-weight: 400;
  color: #3f484a;
  margin: 12px 8px 12px 8px;
  line-height: 1.4;
}

.info-window .realtor-info {
  margin: 12px 8px 12px 8px;
}

.info-window .details {
  font-size: 14px;
  font-weight: 400;
  color: #191c1d;
  margin: 0 8px 12px 8px;
  line-height: 1.6;
}

.info-window .more-info {
  display: block; /* Change display to block */
  width: fit-content; /* Adjust width to content size */
  margin-left: auto; /* Push the button to the right */
  margin-right: 8px; /* Maintain right margin */
  margin-top: 4px; /* Keep original top margin */
  margin-bottom: 12px; /* Keep original bottom margin */
  background-color: var(--bs-primary);
  color: #ffffff;
  text-decoration: none;
  padding: 6px 10px; /* Reduced padding */
  font-size: 12px; /* Reduced font size */
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em; /* Reduced letter spacing */
  transition: background-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.15);
}

.info-window .more-info:hover {
  background-color: var(--bs-primary-hover);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Marker Cluster Styling */
.cluster-marker {
  color: #001d35;
  background: #d6e4ff;
  border-radius: 9999px;
  padding: 12px;
  width: 12px;
  height: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 500;
  border: 2px solid var(--bs-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Spiderfied Marker Styling */
.spiderfied-marker {
  z-index: 1000 !important;
}

.spider-leg {
  background-color: var(--bs-primary);
  opacity: 0.7;
}

/* Loading indicator */
#loading-indicator {
  background: rgba(255, 255, 255, 0.8);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 2000;
}

/* Custom list button in map control */
.custom-list-button {
  background-color: var(--bs-primary) !important;
  color:#FFF!important;
  transition: background-color 0.3s;
}

.custom-list-button:hover {
  background-color: var(--bs-primary-hover) !important;
  color: white !important;
}

/* List button text styling */
.custom-list-button div,
.list-button-text {
  transition: color 0.3s;
  color: white !important; /* Force white text color */
}

.custom-list-button:hover div,
.custom-list-button:hover .list-button-text {
  color: white !important;
}

/* Map control button */
.map-control-button {
  background-color: var(--bs-primary);
  color: var(--bs-btn-color);
  border: none;
  padding: 8px 12px;
  font-size: 18px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.3s;
  font-family: 'Roboto', Arial, sans-serif;
  text-align: center;
  vertical-align: middle;
  box-shadow: rgba(0, 0, 0, 0.3) 0px 1px 4px -1px;
  font-weight: normal;
  margin-left: 10px;
  border-radius: 0.25rem;
}

/* Styling for the source link placed on the thumbnail */
.thumbnail-link {
  position: relative; /* Needed for absolute positioning of the source text */
  display: block; /* Ensure the link takes up block space */
}

.thumbnail-source {
  position: absolute;
  bottom: 0; /* Align to the very bottom */
  left: 0; /* Align to the left edge */
  width: 100%; /* Stretch across the full width */
  background-color: rgba(255, 255, 255, 0.7); /* Transparent white background */
  color: #333; /* Darker text for contrast */
  padding: 4px 8px; /* Adjust padding */
  font-size: 0.7rem; /* Smaller font size */
  line-height: 1.2; /* Adjust line height for padding */
  text-align: right; /* Keep text aligned to the right */
  z-index: 1; /* Ensure it's above the image */
  box-sizing: border-box; /* Include padding in the width */
}

/* Location source fine print at the bottom of the info window */
.location-source {
  font-size: 10px;
  color: #757575;
  text-align: center;
  margin: 4px 8px -2px 8px;
  font-style: italic;
}
