/* ================================== */
/* ARCHIVO: mapa-estilos.css          */
/* ================================== */

#world-map {
  width: 100%;
  max-width: 900px;
  height: auto;
  margin: 0 auto; /* Centrado horizontal, sin margen vertical */
  padding-top: 20px; /* Reducido para dar espacio al buscador */
  aspect-ratio: 2 / 1;
}

.country {
  fill: rgba(255, 255, 255, 0.25);
  stroke: #fff;
  stroke-width: 0.5px;
  transition: fill 0.3s ease;
}

.country:hover,
.country.country-selected {
  fill: rgba(255, 255, 255, 0.5);
}

.graticule {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 0.5px;
}

.sphere {
  fill: rgba(10, 58, 102, 0.2);
}

/* ======================================================== */
/* ==== Estilos para el marcador ==== */
/* ======================================================== */
.city-marker {
  pointer-events: none; /* Evita que el marcador interfiera con el zoom/pan del mapa */
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.city-marker .pin-circle {
    fill: rgb(255, 0, 0);
    stroke: #000000; /* Borde gris oscuro para definición */
    stroke-width: 1.5px;
}

.city-marker .pin-pointer {
    fill: rgb(255, 0, 0);
    stroke: #000000;
    stroke-width: 1.5px;
}

/* =========== ESTILOS DEL BUSCADOR =========== */
#map-search-container {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 0 auto 20px;
  z-index: 1000;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none; /* Para que no interfiera con el clic en el input */
}

#search-input {
  width: 100%;
  padding: 12px 45px 12px 20px;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background-color: rgba(10, 58, 102, 0.3);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  outline: none;
  transition: all 0.3s ease;
}

#search-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

#search-input:focus {
  border-color: #0BA3B8;
  background-color: rgba(10, 58, 102, 0.5);
}

#search-input:focus + .search-icon {
  color: #0BA3B8;
}

/* === MODIFICACIÓN CLAVE AQUÍ PARA EL SCROLL === */
#search-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  border-radius: 12px;
  max-height: 300px;
  
  /* Propiedades para contener el scroll */
  overflow-y: auto;
  overscroll-behavior: contain; /* Evita que el scroll pase al padre */
  touch-action: pan-y;          /* Permite el deslizamiento vertical explícito */
  
  color: #fff;
  background-color: rgba(10, 58, 102, 0.8);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(11, 163, 184, 0.5);
  
  /* Aseguramos z-index alto */
  z-index: 99999;
}

#search-dropdown ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#search-dropdown .continent-item > span {
  display: block;
  padding: 12px 20px;
  font-weight: bold;
  background-color: rgba(0, 0, 0, 0.2);
  cursor: default;
}

#search-dropdown .city-list {
  padding-left: 0;
  display: block;
}

#search-dropdown .city-item {
  padding: 10px 20px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: 14px;
}

#search-dropdown .world-item {
  padding: 10px 20px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#search-dropdown .world-item .fa-globe {
  margin-right: 10px;
  opacity: 0.8;
}

#search-dropdown .world-item:hover,
#search-dropdown .city-item:hover {
  background-color: #0BA3B8;
}

#search-dropdown .city-name {
  font-weight: 600;
}

#search-dropdown .country-name {
  font-size: 0.85em;
  opacity: 0.7;
  margin-left: 8px;
}

.home-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.map-and-chart-container {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 50px;
}

.map-container, .chart-container {
    flex: 1;
    min-width: 350px;
}

.map-container {
    max-width: 900px;
}

.chart-container {
    max-width: 400px;
}