:root {
  --blue-deep: #0b3d91;
  --blue: #1e6fd9;
  --celeste: #3fb6e8;
  --aqua: #6fd9e0;
  --green: #2ea86b;
  --green-mint: #7fd8a8;
  --white: #ffffff;
  --text-soft: #eaf6ff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: linear-gradient(135deg, var(--blue-deep) 0%, var(--blue) 35%, var(--celeste) 65%, var(--green) 100%);
  background-size: 200% 200%;
  animation: gradientMove 18s ease infinite;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 20px;
}

@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.app-header {
  text-align: center;
  color: var(--white);
}

.app-header h1 {
  font-size: 2rem;
  font-weight: 700;
  text-shadow: 0 4px 18px rgba(0, 40, 90, 0.35);
  letter-spacing: 0.5px;
}

.app-header p {
  margin-top: 6px;
  font-size: 1rem;
  color: var(--text-soft);
  opacity: 0.9;
}

.layout {
  flex: 1;
  display: flex;
  gap: 24px;
  align-items: stretch;
  min-height: 0;
}

.map-panel {
  flex: 1 1 62%;
  min-width: 0;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 20px 50px rgba(0, 30, 70, 0.35);
  background: #eef3f7;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 480px;
}

.side-panel {
  flex: 1 1 38%;
  min-width: 0;
  display: flex;
}

.card {
  width: 100%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 24px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 50px rgba(0, 30, 70, 0.35);
  padding: 32px 28px;
  color: var(--white);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
}

.card__location {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-soft);
  margin-bottom: 12px;
}

.card__pin {
  font-size: 1.4rem;
}

.card__main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 18px 0;
}

.card__icon {
  font-size: 4.5rem;
  line-height: 1;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.2));
}

.card__temp {
  font-size: 5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--white);
  text-shadow: 0 4px 18px rgba(0, 40, 90, 0.35);
}

.card__desc {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--green-mint);
  text-transform: capitalize;
  margin-bottom: 22px;
}

.card__details {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 26px;
}

.detail {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail__label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--aqua);
  opacity: 0.9;
}

.detail__value {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--white);
}

.card__explore {
  margin-bottom: 22px;
}

.card__explore-title {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--aqua);
  margin-bottom: 12px;
}

.card__explore-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.explore-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.explore-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.45);
}

.explore-btn__icon {
  font-size: 1.3rem;
  line-height: 1;
}

.card__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-soft);
  opacity: 0.9;
}

.card__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-mint);
  animation: pulse 1.2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* Marcadores del mapa */
.comuna-marker {
  background: transparent;
  border: none;
}

.comuna-marker__dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--celeste);
  border: 2.5px solid var(--white);
  box-shadow: 0 2px 8px rgba(0, 40, 90, 0.45);
  transition: transform 0.15s ease, background 0.15s ease;
}

.comuna-marker__dot:hover {
  transform: scale(1.25);
}

.comuna-marker__dot.active {
  background: var(--green);
  transform: scale(1.3);
}

.comuna-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--blue-deep);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  margin-top: -2px;
}

/* Estilo de los bordes de comuna */
.comuna-boundary {
  fill: rgba(63, 182, 232, 0.08);
  stroke: var(--blue);
  stroke-width: 1.5;
  stroke-opacity: 0.6;
}

.comuna-boundary.highlighted {
  fill: rgba(46, 168, 107, 0.22);
  stroke: var(--green);
  stroke-width: 2.5;
  stroke-opacity: 0.95;
}

@media (max-width: 900px) {
  .layout {
    flex-direction: column;
  }
  #map {
    min-height: 380px;
  }
  .card__temp {
    font-size: 4rem;
  }
  .card__details {
    flex-direction: column;
  }
}
