/* Structure sobre et minimale pour le tracking du Petit Train */
.petit-train-container {
  position: relative;
  width: 100%;
  font-family: inherit;
}

.petit-train-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-bottom: 12px;
  font-family: inherit;
}

.petit-train-status-wrapper {
  display: flex;
  align-items: center;
}

/* Statut : texte simple + indicateur rond */
.petit-train-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: inherit;
  line-height: 1.2;
  font-family: inherit;
  flex-shrink: 0;
}

.petit-train-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-active .petit-train-pulse {
  background-color: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: petit-train-pulse-anim 1.8s infinite;
}

.status-pause .petit-train-pulse {
  background-color: #f59e0b;
}

.status-offline .petit-train-pulse {
  background-color: #94a3b8;
}

.status-depot .petit-train-pulse {
  background-color: #475569;
}

@keyframes petit-train-pulse-anim {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Métadonnées (Vitesse + Actualisé) */
.petit-train-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: inherit;
  font-family: inherit;
}

.petit-train-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.petit-train-meta-item strong {
  color: inherit;
  font-weight: 600;
}

/* Bouton rafraîchir discret (Option A) */
.petit-train-btn-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  padding: 0;
  margin-left: 4px;
  color: inherit;
  opacity: 0.75;
  cursor: pointer;
  transition: all 0.2s ease;
  vertical-align: middle;
  outline: none;
  flex-shrink: 0;
}

.petit-train-btn-refresh:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.3);
  opacity: 1;
  transform: scale(1.08);
}

.petit-train-btn-refresh:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.petit-train-btn-refresh.is-spinning .petit-train-refresh-icon {
  animation: petit-train-spin 0.7s linear infinite;
}

@keyframes petit-train-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Écran coopératif de zoom (Cmd / Ctrl + scroll - style Bô-Noël discret en bas à gauche) */
.maplibregl-cooperative-gesture-screen {
  display: flex !important;
  align-items: flex-end !important;
  justify-content: flex-start !important;
  padding: 16px !important;
  box-sizing: border-box !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: none !important;
}

.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message,
.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {
  font-family: 'Radikal', var(--font-sans, inherit), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #000000;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 0 !important;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid #000000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  text-align: left;
  line-height: 1.3;
  margin: 0;
  max-width: calc(100% - 32px);
  pointer-events: none;
}

/* Carte MapLibre GL */
.petit-train-map {
  width: 100%;
  height: 520px;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

@media (max-width: 768px) {
  .petit-train-map {
    height: 420px;
  }

  .petit-train-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 12px;
  }

  .petit-train-badge {
    font-size: 14px;
    width: 100%;
    justify-content: flex-start;
  }

  .petit-train-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 6px;
    font-size: 12px;
    gap: 10px;
    box-sizing: border-box;
  }

  .petit-train-meta-item {
    font-size: 12px;
  }

  .petit-train-btn-refresh {
    width: 22px;
    height: 22px;
  }

  .petit-train-btn-refresh svg {
    width: 12px;
    height: 12px;
  }

  .petit-train-btn-recenter {
    font-size: 14px;
    padding: 0.65rem 1.2rem 0.55rem 1.2rem;
  }

  .maplibregl-cooperative-gesture-screen .maplibregl-desktop-message,
  .maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {
    font-size: 11px;
    padding: 5px 10px;
    margin: 0;
  }
}

@media (max-width: 440px) {
  .petit-train-meta {
    padding: 7px 10px;
    font-size: 11.5px;
    gap: 8px;
  }

  .petit-train-meta-item {
    font-size: 11.5px;
  }

  .petit-train-controls {
    bottom: 12px;
    right: 12px;
  }

  .petit-train-btn-recenter {
    font-size: 13px;
    padding: 0.55rem 1rem 0.45rem 1rem;
  }

  .maplibregl-cooperative-gesture-screen {
    padding: 12px !important;
  }

  .maplibregl-cooperative-gesture-screen .maplibregl-desktop-message,
  .maplibregl-cooperative-gesture-screen .maplibregl-mobile-message {
    font-size: 10px;
    padding: 4px 8px;
    margin: 0;
  }
}

@media (max-width: 360px) {
  .petit-train-meta {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .petit-train-meta-item {
    width: 100%;
    justify-content: space-between;
  }
}

/* Contrôles de zoom MapLibre épurés */
.petit-train-map .maplibregl-ctrl-group {
  border-radius: 0;
  box-shadow: none;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.petit-train-map .maplibregl-ctrl-group button {
  width: 34px;
  height: 34px;
}

/* Bouton recentrer */
.petit-train-controls {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 1000;
}

/* Button */
.petit-train-btn-recenter {
  background: var(--color-primary);
  border: 2px solid var(--color-primary);
  text-transform: uppercase;
  padding: 1rem 2rem 0.7rem 2rem;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: white;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease-out;
}

.petit-train-btn-recenter:hover {
  background: var(--color-secondary);
  border: 2px solid var(--color-secondary);
}

/* Marqueur personnalisé du train */
.petit-train-marker-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.petit-train-pin {
  width: 42px;
  height: 42px;
  background: var(--color-primary, #17456b);
  border: 2px solid #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.petit-train-svg-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  transform-origin: center center;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.petit-train-pin svg {
  width: 24px;
  height: 24px;
  fill: #ffffff;
}

.petit-train-heading-arrow {
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 8px solid var(--color-primary, #17456b);
  z-index: 1;
}

/* Masquage complet du marqueur hors service & au dépôt */
.petit-train-marker-icon.is-offline,
.petit-train-pin.is-offline,
.petit-train-marker-icon.is-depot,
.petit-train-pin.is-depot {
  display: none !important;
}
