/* Layer Map Container */
.layer-map-container {
  width: 100%;
  height: 600px;
  border: 3px solid black;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  border-radius: 4px;
}

/* Fallback for specific ID */
#goa-map {
  width: 100%;
  height: 600px;
  border: 1px solid black;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  border-radius: 4px;
  margin-top: 15px;
}

/* Map instance - dynamically generated */
[id$="-instance"] {
  flex-grow: 1;
  height: 100%;
  width: 100%;
  margin: 0;
  border-radius: 0;
  z-index: 1;
}

/* Leaflet popup styling */
.leaflet-popup-content p {
  margin: 0 !important;
  font-size: 16px;
}

.leaflet-popup ul {
  margin: 0;
  font-size: 14px;
}

.leaflet-popup li {
  margin: 0;
}

p>strong {
  margin-top: 8px;
  display: inline-block;
}

/* Marker cluster styling */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-color: rgba(0, 112, 202, 0.6) !important;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background-color: rgba(0, 112, 202, 1) !important;
  color: #fff;
}

/* Legend control styling */
.legend-control {
  background: rgba(255, 255, 255, 0.95);
  padding: 10px 12px;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  font-size: 14px;
  line-height: 1.4;
  max-width: 250px;
}

.legend-control .legend-title {
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 15px;
  color: #1f2937;
}

.legend-control .legend-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend-control .legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #374151;
}

.legend-control .legend-item svg {
  flex-shrink: 0;
}

.legend-control .legend-item span {
  line-height: 1.2;
}

/* Reset control button styling */
.leaflet-control-reset {
  margin-top: 10px !important;
}

.leaflet-control-reset-button {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 30px;
  text-align: center;
  text-decoration: none;
  color: #000;
  background: #fff;
  cursor: pointer;
  transition: background-color 0.15s;
}

.leaflet-control-reset-button:hover {
  background-color: #f4f4f4;
  color: #000;
}

/* Layer control styling improvements */
.leaflet-control-layers {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  padding: 10px;
}

.leaflet-control-layers-expanded {
  padding: 12px;
}

.leaflet-control-layers-toggle {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23374151' stroke-width='2'%3E%3Cpath d='M3 3h18v18H3z'/%3E%3Cpath d='M3 9h18M9 21V9'/%3E%3C/svg%3E");
  width: 36px;
  height: 36px;
}

.leaflet-control-layers label {
  display: flex;
  align-items: center;
  margin: 4px 0;
  padding: 4px;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
  transition: background-color 0.15s;
  border-radius: 4px;
}

.leaflet-control-layers label:hover {
  background-color: #f3f4f6;
}

.leaflet-control-layers input[type="checkbox"] {
  margin-right: 8px;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.leaflet-control-layers-separator {
  height: 1px;
  background-color: #e5e7eb;
  margin: 8px 0;
}

/* SVG Pattern Support for Map Layers */
/* Ensure patterns render smoothly */
.leaflet-overlay-pane svg path[fill^="url(#"] {
  shape-rendering: auto;
  vector-effect: non-scaling-stroke;
}

/* Enhance pattern visibility on hover */
.leaflet-interactive:hover {
  filter: brightness(1.1);
  transition: filter 0.2s ease;
}