/* ══════════════════════════════════════════════════════
   TRAM — Trams T1 de Liège (js/tram-controller.js)
   Le marqueur dit d'où vient la position :
     .is-live       suit le GPS            → point vert
     .is-predicted  d'après l'horaire      → icône estompée, contour pointillé, horloge
══════════════════════════════════════════════════════ */

/* NE PAS mettre de « position » sur .lf-tram : le marqueur MapLibre est déjà en position:absolute
   (repère des pastilles) ; la redéfinir casse son ancrage sur la carte. */

/* Pastille en haut à droite de l'icône */
.lf-tram-mark {
  position: absolute;
  top: -3px;
  right: -3px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  pointer-events: none;
  box-sizing: border-box;
}

.lf-tram-mark.is-live {
  width: 11px;
  height: 11px;
  background: #22c55e;
  border: 2px solid #fff;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, .55);
  animation: lfTramLive 2s ease-out infinite;
}

.lf-tram-mark.is-pred {
  top: -5px;
  right: -5px;
  width: 16px;
  height: 16px;
  background: #0e1118;
  color: #ffcc00;
  border: 1.5px solid #fff;
}

/* Position prédite : le tram « fantôme » */
.lf-tram.is-predicted img {
  opacity: .5;
  filter: grayscale(.45);
}

.lf-tram.is-predicted::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px dashed #0e1118;
  opacity: .75;
  pointer-events: none;
}

:root[data-theme="dark"] .lf-tram.is-predicted::before {
  border-color: #f3f4f6;
}

@keyframes lfTramLive {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); }
  70%  { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Dézoom : on garde l'essentiel (estompé + pointillé), sans pastille */
#map.bus-zoom-md .lf-tram-mark.is-pred {
  top: -5px;
  right: -6px;
  width: 14px;
  height: 14px;
}

#map.bus-zoom-sm .lf-tram-mark {
  display: none;
}

#map.bus-zoom-sm .lf-tram.is-predicted::before {
  inset: -2px;
  border-width: 1.5px;
}

/* ── Fiche tram : bloc « d'où vient la position » ── */
.tram-src {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--dk-border);
  background: var(--dk-card);
}

.tram-src-ico {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.tram-src-t {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--dk-text);
}

.tram-src-s {
  margin-top: 2px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--dk-muted);
}

.tram-src.is-live .tram-src-ico {
  background: rgba(34, 197, 94, .14);
  color: var(--dk-green);
}

.tram-src.is-pred {
  border-style: dashed;
  border-color: var(--dk-border-2);
}

.tram-src.is-pred .tram-src-ico {
  background: var(--primary-soft, rgba(255, 204, 0, .14));
  color: var(--primary-ink, #8a6a00);
}

.tram-panel .bus-action:disabled {
  opacity: .45;
  cursor: default;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .lf-tram-mark.is-live { animation: none; }
}
