/**
 * AmCharts US Map module styles.
 */

.amcharts-us-map-container {
  position: relative;
  width: 100%;
  margin-bottom: 20px;
}

.amcharts-us-map {
  width: 100%;
  min-height: 400px;
}

/* Map filters */
.amcharts-map-filters {
  margin: 20px 0;
  padding: 15px;
  background-color: #f5f5f5;
  border-radius: 4px;
}

.amcharts-map-filters label {
  font-weight: bold;
  margin-right: 10px;
}

.amcharts-site-type-filter {
  padding: 5px 10px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background-color: white;
}

/* Map legend */
.map-legend {
  background-color: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 15px;
  margin-top: 20px;
}

.map-legend h4 {
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: bold;
}

.map-legend ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.map-legend li {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
}

/*.legend-marker {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  border: 1px solid #333;
}*/
.legend-marker {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  flex-shrink: 0;
  vertical-align: middle;
}

.legend-marker--svg {
  /* sizing handled by width/height above */
}

.legend-marker--icon {
  object-fit: contain;
  border: none;
}

/* Location popup */
.amcharts-popup .ui-dialog-content {
  padding: 15px;
}

/* Simple popup fallback */
.amcharts-popup.simple-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border: 2px solid #ccc;
  border-radius: 5px;
  padding: 20px;
  max-width: 90%;
  width: 400px;
  z-index: 10000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.amcharts-popup .close-popup {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 10px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 3px;
  cursor: pointer;
}

.amcharts-popup .close-popup:hover {
  background: #e5e5e5;
}

.amcharts-popup-content h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #333;
}

.amcharts-popup-content img {
  max-width: 100%;
  height: auto;
  margin-bottom: 15px;
  border-radius: 4px;
}

.amcharts-popup-content .location-body {
  margin-bottom: 15px;
  line-height: 1.6;
}

.amcharts-popup-content .location-type {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
}

.amcharts-popup-content .location-link {
  display: inline-block;
  padding: 8px 16px;
  background-color: #007cba;
  color: white;
  text-decoration: none;
  border-radius: 3px;
  transition: background-color 0.3s;
}

.amcharts-popup-content .location-link:hover {
  background-color: #005a8b;
}

/* Settings form enhancements */
.form-item .color-field {
  max-width: 150px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .amcharts-us-map {
    min-height: 300px;
  }
  
  .map-legend {
    margin-top: 10px;
    padding: 10px;
  }
  
  .amcharts-popup .ui-dialog {
    max-width: 95% !important;
  }
}

/* Loading state */
.amcharts-us-map.loading {
  position: relative;
  opacity: 0.6;
}

.amcharts-us-map.loading::after {
  content: "Loading map...";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  color: #333;
}

/* Print styles */
@media print {
  .amcharts-map-filters,
  .map-legend {
    display: none;
  }
  
  .amcharts-us-map {
    height: 600px !important;
  }
}
