.graphsSection {
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  animation: fadeIn 0.8s ease;
  position: relative;
  overflow: hidden;
}

.graphsSection::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(30, 215, 96, 0.05) 0%, transparent 70%);
  pointer-events: none;
  animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.1); opacity: 0.5; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.graphsHeader {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-text);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: white !important;
  position: relative;
  z-index: 1;
}

.graphsHeader ion-icon {
  color: var(--accent-color);
}

.graphCard {
  background-color: var(--card-bg);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--border-light);
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.graphCard:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  border-color: rgba(30, 215, 96, 0.3);
}

.graphHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.graphTitle {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-text);
}

.graphControls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.periodButton {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 6px 12px;
  color: var(--secondary-text);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition-normal);
}

.periodButton:hover {
  background-color: rgba(0, 106, 255, 0.1);
  color: #006aff;
  transform: translateY(-2px);
}

.periodButtonActive {
  background-color: #006aff;
  color: white;
  border-color: #006aff;
}

.chartContainer {
  height: 400px;
  width: 100%;
  position: relative;
}

.noDataContainer {
  height: 300px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--secondary-text);
}

.noDataIcon {
  font-size: 48px;
  margin-bottom: 16px;
  color: var(--border-light);
}

/* Estilos específicos para Leaflet */
.mapWrapper {
  width: 100%;
  height: 400px;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  touch-action: manipulation;
}

.leafletContainer {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.mapTiles {
  filter: brightness(0.9) contrast(1.1) saturate(0.9);
}

.customPopup .leaflet-popup-content-wrapper {
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 12px;
  max-width: 250px;
  font-family: system-ui, sans-serif;
}

.customPopup .leaflet-popup-tip {
  background-color: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Estilo para tooltip de países */
.countryTooltip {
  background-color: white !important;
  border: none !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
  padding: 8px !important;
  border-radius: 8px !important;
  font-family: system-ui, sans-serif !important;
  font-size: 14px !important;
  min-width: 120px !important;
}

/* Estilo para las etiquetas de conteo */
.countLabel {
  background: transparent !important;
  border: none !important;
}

/* WRAPPER PARA SELECTORES GLOBALES (evita errores en build) */
.globalFix {
  all: unset;
}
.globalFix :global(.leaflet-interactive:hover) {
  cursor: pointer !important;
}

.globalFix :global(.leaflet-control-container .leaflet-control) {
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.globalFix :global(.leaflet-control-zoom-in),
.globalFix :global(.leaflet-control-zoom-out) {
  color: #333 !important;
  font-size: 18px !important;
  line-height: 26px !important;
  width: 26px !important;
  height: 26px !important;
  text-align: center;
}

.globalFix :global(.leaflet-control-zoom-in:hover),
.globalFix :global(.leaflet-control-zoom-out:hover) {
  background-color: #006aff !important;
  color: white !important;
}

/* Estilos para los tooltips y textos en gráficos */
.recharts-tooltip-wrapper {
  overflow: hidden !important;
  pointer-events: none !important;
}

.recharts-default-tooltip {
  background-color: rgba(42, 42, 54, 0.95) !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.recharts-tooltip-item {
  display: flex !important;
  align-items: center !important;
  padding: 4px 0 !important;
  color: var(--primary-text) !important;
}

.recharts-tooltip-label {
  color: var(--accent-color) !important;
  margin-bottom: 8px !important;
}

.recharts-tooltip-item-name {
  margin-right: 8px !important;
  font-weight: 500 !important;
  color: var(--secondary-text) !important;
}

.recharts-tooltip-item-value {
  font-weight: 600 !important;
  color: var(--primary-text) !important;
}

/* Estilos para los ejes */
.recharts-cartesian-axis-line {
  stroke: var(--border-light) !important;
}

.recharts-cartesian-grid-horizontal line,
.recharts-cartesian-grid-vertical line {
  stroke: var(--border-light) !important;
  stroke-opacity: 0.1 !important;
}

/* Estilos para líneas y áreas */
.recharts-curve.recharts-line-curve {
  stroke-width: 3px !important;
}

.recharts-active-dot {
  r: 8 !important;
}

/* Animación de entrada de los gráficos */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Media queries para dispositivos móviles */
@media (max-width: 992px) {
  .chartContainer {
    height: 350px;
  }
}

@media (max-width: 768px) {
  .graphsSection {
    padding: 16px;
  }

  .chartContainer {
    height: 300px;
  }

  .graphHeader {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .graphControls {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .periodButton {
    font-size: 11px;
    padding: 4px 8px;
  }

  .mapWrapper {
    height: 350px;
  }
}

@media (max-width: 480px) {
  .chartContainer {
    height: 250px;
  }

  .mapWrapper {
    height: 300px;
  }
}

/* Soporte para preferencia de reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
  .graphsSection {
    animation: none;
  }

  .graphCard:hover,
  .periodButton:hover {
    transform: none;
  }
}

/* Estilos para mejorar la interacción con los popups */
.globalFix :global(.circle-count-popup .leaflet-popup-content-wrapper) {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

.globalFix :global(.circle-count-popup .leaflet-popup-tip-container) {
  display: none !important;
}
