/* State Map Component Styles */

.state-map-section {
  background: #ffffff;
  padding: 4rem 0;
  position: relative;
}

.state-map-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.state-map-header {
  text-align: center;
  margin-bottom: 3rem;
}

.state-map-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 1rem 0;
  line-height: 1.2;
}

.state-map-header p {
  font-size: 1.1rem;
  color: #666;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

#usMapContainer {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  position: relative;
}

.us-map-svg {
  width: 100%;
  height: auto;
  display: block;
}

.us-map-svg .state {
  transition: all 0.2s ease;
  cursor: pointer;
}

.us-map-svg .state:hover {
  opacity: 0.7;
  stroke: #1a1a1a;
  stroke-width: 2;
}

/* Map Legend */
.map-legend {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #666;
}

.legend-color {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid #e5e5e5;
}

.legend-item:nth-child(1) .legend-color { background: #e5e7eb; }
.legend-item:nth-child(2) .legend-color { background: #d1d5db; }
.legend-item:nth-child(3) .legend-color { background: #9ca3af; }
.legend-item:nth-child(4) .legend-color { background: #6b7280; }
.legend-item:nth-child(5) .legend-color { background: #4b5563; }

/* State Popup */
.state-popup {
  position: fixed;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  padding: 0;
  z-index: 1000;
  min-width: 280px;
  max-width: 340px;
  animation: popupFadeIn 0.2s ease;
}

@keyframes popupFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.popup-header {
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid #f0f0f0;
}

.popup-header h3 {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #999;
}

.popup-average {
  padding: 1.25rem;
  text-align: center;
  background: #fafafa;
}

.average-amount {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.average-label {
  font-size: 0.8rem;
  color: #666;
  font-weight: 400;
}

.popup-section-title {
  padding: 0.85rem 1.25rem 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #999;
  text-transform: uppercase;
}

.popup-advocates {
  padding: 0 1.25rem 0.85rem;
}

.popup-advocate {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid #f5f5f5;
}

.popup-advocate:last-child {
  border-bottom: none;
}

.advocate-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #1a1a1a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}

.advocate-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.advocate-avatar span {
  display: flex;
  align-items: center;
  justify-content: center;
}

.advocate-info {
  flex: 1;
  min-width: 0;
}

.advocate-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.advocate-location {
  font-size: 0.75rem;
  color: #999;
}

.advocate-rate {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1a1a1a;
  flex-shrink: 0;
}

.popup-view-all {
  display: block;
  background: #1a1a1a;
  color: #ffffff;
  text-align: center;
  padding: 0.85rem;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 0 0 8px 8px;
  transition: background 0.2s ease;
}

.popup-view-all:hover {
  background: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
  .state-map-section {
    padding: 3rem 0;
  }

  .state-map-container {
    padding: 0 1rem;
  }

  .state-map-header h2 {
    font-size: 2rem;
  }

  .state-map-header p {
    font-size: 1rem;
  }

  .map-legend {
    gap: 1rem;
  }

  .legend-item {
    font-size: 0.75rem;
  }

  .legend-color {
    width: 20px;
    height: 20px;
  }

  .state-popup {
    min-width: 260px;
    max-width: calc(100vw - 2rem);
  }

  .average-amount {
    font-size: 2.25rem;
  }
}

@media (max-width: 480px) {
  .state-map-header h2 {
    font-size: 1.75rem;
  }

  .map-legend {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .state-popup {
    min-width: 240px;
  }

  .popup-header {
    padding: 0.85rem 1rem 0.65rem;
  }

  .popup-header h3 {
    font-size: 0.65rem;
  }

  .popup-average {
    padding: 1rem;
  }

  .average-amount {
    font-size: 2rem;
  }

  .average-label {
    font-size: 0.75rem;
  }

  .popup-section-title {
    padding: 0.75rem 1rem 0.25rem;
    font-size: 0.65rem;
  }

  .popup-advocates {
    padding: 0 1rem 0.75rem;
  }

  .popup-advocate {
    gap: 0.5rem;
    padding: 0.5rem 0;
  }

  .advocate-avatar {
    width: 34px;
    height: 34px;
    font-size: 0.75rem;
  }

  .advocate-name {
    font-size: 0.8rem;
  }

  .advocate-location {
    font-size: 0.7rem;
  }

  .advocate-rate {
    font-size: 0.8rem;
  }

  .popup-view-all {
    padding: 0.75rem;
    font-size: 0.75rem;
  }
}
