/* Conteneur de la carte */
.usa-map-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 20px;
}

.usa-map-wrapper {
  position: relative;
  background: #f5f5f5;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Styles du SVG */
#usa-map svg {
  width: 100%;
  height: auto;
  display: block;
}

/* États par défaut */
#usa-map path.state {
  fill: #e0e0e0;
  stroke: #ffffff;
  stroke-width: 1;
}

/* États interactifs */
#usa-map path.state-interactive {
  transition: all 0.3s ease;
  cursor: pointer;
}

#usa-map path.state-interactive:hover {
  opacity: 0.8;
  stroke: #333;
  stroke-width: 2;
}

/* États LUS - En BLEU */
#usa-map path.lu {
  fill: #6b8e6f; /* Royal Blue */
}

/* États NON LUS - En gris clair */
#usa-map path.non-lu {
  fill: #e0e0e0;
}

/* Tooltip */
.map-tooltip {
  position: fixed;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  pointer-events: none;
  z-index: 1000;
  display: none;
  max-width: 300px;
}

.map-tooltip img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 10px;
}

.tooltip-info h4 {
  margin: 0 0 10px 0;
  font-size: 18px;
  color: #333;
}

.book-title {
  display: block;
  font-weight: bold;
  color: #6b8e6f;
  margin-bottom: 5px;
}

.book-author {
  display: block;
  font-style: italic;
  color: #666;
  font-size: 14px;
  margin-bottom: 5px;
}

.book-rating {
  display: block;
  color: #ffd700;
  font-size: 16px;
}

/* Légende de la carte */
.map-legend {
  margin-top: 30px;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.map-legend h3 {
  margin: 0 0 15px 0;
  font-size: 20px;
  color: #333;
}

.legend-items {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.legend-color.lu {
  background: #6b8e6f;
}

.legend-color.non-lu {
  background: #e0e0e0;
}

.legend-label {
  font-size: 16px;
  color: #333;
}

/* Statistiques */
.map-stats {
  margin-top: 20px;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.map-stats h3 {
  margin: 0 0 15px 0;
  font-size: 20px;
  color: #333;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.stat-item {
  text-align: center;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 8px;
}

.stat-number {
  display: block;
  font-size: 36px;
  font-weight: bold;
  color: #6b8e6f;
  margin-bottom: 5px;
}

.stat-label {
  display: block;
  font-size: 14px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Responsive */
@media (max-width: 768px) {
  .usa-map-container {
    padding: 10px;
  }

  .usa-map-wrapper {
    padding: 10px;
  }

  .legend-items {
    flex-direction: column;
    gap: 15px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Tooltip avec image couverture à gauche */
.map-tooltip {
  position: fixed;
  background: white;
  border: none;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  z-index: 1000;
  display: none;
  max-width: 280px;
}

.tooltip-content {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.map-tooltip img {
  width: 80px;
  height: 120px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

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

.tooltip-info h4 {
  margin: 0 0 8px 0;
  font-size: 15px;
  color: #2d5a3d;
  font-weight: 600;
}

.book-title {
  display: block;
  font-weight: 600;
  color: #6b8e6f;
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.3;
}

.book-author {
  display: block;
  font-style: italic;
  color: #666;
  font-size: 11px;
  margin-bottom: 6px;
}

.book-rating {
  display: block;
  color: #ffd700;
  font-size: 14px;
  letter-spacing: 1px;
}

/* Style pour états non lus */
.tooltip-info p {
  margin: 0;
  color: #999;
  font-size: 12px;
  font-style: italic;
}

/* Animation d'apparition */
@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.map-tooltip[style*="display: block"] {
  animation: tooltipFadeIn 0.2s ease;
}

.book-count {
  display: block;
  font-size: 12px;
  color: #2d5a3d;
  font-weight: 600;
  margin-bottom: 8px;
  padding: 4px 8px;
  background: #e8f5e9;
  border-radius: 4px;
  display: inline-block;
}

.book-label {
  display: block;
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  margin-top: 8px;
}
