/* v2 — campana y panel de avisos, estado del servicio y mapa en vivo. */

/* Campana de avisos */
.campana { overflow: visible; }

.campana-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #fff;
  color: var(--azul);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 18px;
  text-shadow: none;
}

.campana-badge.grave { background: var(--acento); color: #fff; }

.panel-avisos {
  position: fixed;
  inset: 0;
  z-index: 1800;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 60px 16px 16px;
  background: rgba(10, 20, 40, 0.45);
}

.panel-avisos-caja {
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  padding: 16px;
  background: var(--card);
  border-radius: var(--radio);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  animation: aparecer 0.2s ease;
}

.panel-avisos-cabecera { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.panel-avisos-cabecera h2 { margin: 0; font-size: 1.1rem; }
#panelAvisosLista { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }

/* Avisos */
.avisos-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.aviso-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  border-left: 4px solid var(--tinta-suave);
  background: var(--suave);
  font-size: 0.88rem;
  line-height: 1.4;
}

.aviso-item.info { border-left-color: var(--azul); }
.aviso-item.medio { border-left-color: var(--demora); background: rgba(180, 83, 9, 0.09); }
.aviso-item.grave { border-left-color: var(--grave); background: rgba(185, 28, 28, 0.09); }

.aviso-linea {
  align-self: flex-start;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--color-linea);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.avisos-viaje { margin-bottom: 12px; }
.avisos-viaje .aviso-item { background: var(--card); box-shadow: 0 2px 8px rgba(16, 40, 80, 0.1); }

/* Mapa individual del tren */
.mapa { width: 100%; height: 280px; margin-top: 12px; border-radius: 10px; overflow: hidden; }

.tren-marca { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 44px; }

.tren-circulo {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 7px;
  border-radius: 50%;
  background: var(--c);
  color: var(--c);
  border: 3px solid #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 30%, transparent), 0 3px 10px rgba(0, 0, 0, 0.35);
  animation: tren-pulso 2s ease-out infinite;
}

.tren-circulo svg { width: 100%; height: 100%; }

@keyframes tren-pulso {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 55%, transparent), 0 3px 10px rgba(0, 0, 0, 0.35); }
  100% { box-shadow: 0 0 0 14px transparent, 0 3px 10px rgba(0, 0, 0, 0.35); }
}

.tren-cuenta {
  padding: 1px 6px;
  border-radius: 6px;
  background: #fff;
  color: #1b2230;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

.tren-cuenta:empty { display: none; }

.leaflet-tooltip.mapa-etiqueta {
  padding: 2px 7px;
  border: none;
  border-radius: 6px;
  background: var(--card);
  color: var(--tinta);
  font-family: var(--texto);
  font-size: 0.74rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.leaflet-tooltip.mapa-etiqueta.fuerte { font-weight: 700; }
.leaflet-tooltip.mapa-etiqueta::before { display: none; }
.leaflet-container { font-family: var(--texto); background: var(--suave); }

/* Boton "mi ubicacion" del mapa */
.leaflet-bar.control-yo {
  width: 34px; height: 34px; padding: 6px; display: grid; place-items: center;
  background: var(--card); color: var(--tinta); cursor: pointer;
}
.leaflet-bar.control-yo svg { width: 20px; height: 20px; }
.leaflet-bar.control-yo:hover { color: #2b7bff; }

/* Cartel flotante al elegir una estación (5 s; tocarlo abre los avisos) */
.aviso-estacion {
  position: fixed; top: 12px; left: 50%; z-index: 1200;
  width: min(440px, calc(100% - 32px));
  display: flex; align-items: flex-start; gap: 4px;
  background: var(--card); border-radius: 14px;
  box-shadow: 0 10px 28px rgba(16, 40, 80, 0.25);
  cursor: pointer;
  transform: translate(-50%, calc(-100% - 20px)); opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}
.aviso-estacion.visible { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.aviso-estacion .aviso-estacion-item { flex: 1; margin: 0; list-style: none; }
.aviso-estacion .aviso-mas { display: block; margin-top: 4px; font-size: 0.78rem; font-weight: 600; color: var(--azul); }
.aviso-estacion .aviso-cerrar { flex: none; margin: 4px; }
.aviso-estacion .aviso-item > span:not(.aviso-linea):not(.aviso-mas) {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
