:root {
  --bg: #161618;
  --card: #161618;
  --card-soft: #202023;
  --hover: #2a2a2e;
  --border: #36363c;
  --border-soft: #242428;
  --text: #f3f4f6;
  --muted: #9094a0;
  --muted-dark: #6b6f7a;
  --blue: #536dfe;
  --blue-soft: rgba(83, 109, 254, 0.25);
  --delay: #ff6b6b;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
}

html,
body,
.app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #0c0c0c;
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgb(59, 59, 59);
}

.maplibregl-canvas {
  filter: brightness(1.32) contrast(0.88) saturate(0.72);
}

#map::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 500;
  pointer-events: none;
  background:
    radial-gradient(circle at center, transparent 14%, rgba(59, 59, 59, 0.18) 62%, rgba(18, 18, 18, 0.34) 100%),
    linear-gradient(to bottom, rgba(110, 110, 110, 0.07), transparent 32%);
}

.maplibregl-ctrl-attrib,
.maplibregl-ctrl-logo {
  display: none !important;
}

.left-panel {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 20;
  width: 340px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-box {
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(20, 20, 23, 0.96);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
}

.search-box .icon {
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.search-box input {
  min-width: 0;
  flex: 1;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px; /* >= 16px : empêche le zoom auto iOS au focus */
}

.search-box input::placeholder {
  color: var(--muted);
}

.search-box kbd {
  height: 22px;
  min-width: 34px;
  padding: 0 6px;
  border-radius: 6px;
  background: #26262b;
  color: var(--muted);
  font-size: 12px;
  line-height: 21px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.station-menu {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(20, 20, 23, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  overflow: hidden;
  padding: 8px 0;
}

.menu-title {
  padding: 11px 18px 9px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}

.station-row {
  width: 100%;
  height: 39px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 18px;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease;
}

.station-row:hover {
  background: var(--hover);
}

.train-icon {
  width: 17px;
  height: 17px;
  color: var(--muted);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.station-name {
  min-width: 0;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flag {
  font-size: 13px;
}

.stats {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.station-marker {
  width: 26px;
  height: 26px;
  display: none;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.26s ease;
}

.station-marker.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.station-marker-core {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  background: #1455a8 url("assets/icons/sncb.webp") center / cover no-repeat;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Gare sélectionnée : halo doré + agrandissement, tant qu'elle est active. */
.station-marker.is-active .station-marker-core {
  border-color: #f5c451;
  transform: scale(1.25);
  box-shadow:
    0 0 0 4px rgba(245, 196, 81, 0.3),
    0 0 16px rgba(245, 196, 81, 0.85);
}



/* NB : ne PAS mettre position/transform sur .user-dot — MapLibre place le
   marqueur via un transform inline ; on l'écraserait. Les effets vont sur les
   pseudo-éléments (les ondes), qui ont leur propre transform. */
.user-dot {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid white;
  background: var(--blue);
  box-shadow:
    0 0 12px rgba(83, 109, 254, 0.9),
    0 4px 12px rgba(0, 0, 0, 0.55);
}

/* Deux ondes décalées qui se propagent en continu (localisation live). */
.user-dot::before,
.user-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 2px solid var(--blue);
  pointer-events: none;
  animation: userPulse 2.2s ease-out infinite;
}
.user-dot::before { animation-delay: 1.1s; }

@keyframes userPulse {
  0% { transform: scale(1); opacity: 0.65; }
  100% { transform: scale(3.6); opacity: 0; }
}

.rail-line {
  stroke: var(--blue);
  stroke-width: 3;
  stroke-opacity: 0.75;
  filter: drop-shadow(0 0 5px rgba(83, 109, 254, 0.8));
}

.station-panel {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 30;
  width: 448px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: rgba(20, 20, 23, 0.97);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  overflow: visible;
  animation: panelIn 0.18s ease-out;
}

.hidden {
  display: none;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateX(18px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.panel-close {
  position: absolute;
  top: 10px;
  left: -48px;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(20, 20, 23, 0.97);
  box-shadow: var(--shadow);
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  backdrop-filter: blur(18px);
}

.panel-close:hover {
  background: var(--hover);
}

.panel-head {
  padding: 20px 20px 14px;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head > p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.panel-title-row h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 800;
}

.panel-icons {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.panel-icons button {
  border: 0;
  background: transparent;
  cursor: pointer;
  opacity: 0.85;
  font-size: 20px;
}

.panel-icons button:hover {
  opacity: 1;
}

.tabs {
  margin: 0 18px 16px;
  height: 42px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 10px;
  background: var(--card-soft);
}

.tabs button {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.tabs .active {
  color: var(--text);
  background: #34343a;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.09),
    0 2px 8px rgba(0, 0, 0, 0.35);
}

.departures {
  display: flex;
  flex-direction: column;
}

.departure {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-top: 1px solid var(--border-soft);
  border-left: 3px solid transparent;
}

.departure--incoming {
  border-left-color: #22c55e;
}

.departure--departing {
  border-left-color: #536dfe;
}

.platform {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #26262b;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 900;
}

.departure-body {
  flex: 1;
  min-width: 0;
}

.departure-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.departure-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
}

.train-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.operator-logo {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  flex-shrink: 0;
}

.line-pill {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--card-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.train-number {
  font-size: 15px;
  font-weight: 600;
}

.destination {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.train-status {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
}

.status-incoming {
  color: #22c55e;
}

.status-departing {
  color: var(--blue);
}

.time-col {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.time {
  font-weight: 800;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.delay {
  color: var(--delay);
  font-size: 13px;
  font-weight: 700;
}

.panel-footer {
  padding: 16px 20px 18px;
  border-top: 1px solid var(--border-soft);
  text-align: center;
  color: var(--muted);
}

.panel-footer div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-bottom: 12px;
}

.panel-footer button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

.panel-footer button:hover {
  color: var(--text);
}

.panel-footer p {
  max-width: 340px;
  margin: 0 auto;
  font-size: 13px;
  line-height: 1.35;
}

.controls {
  position: absolute;
  right: 18px;
  bottom: 28px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.controls button {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(20, 20, 23, 0.97);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.32);
  font-size: 20px;
}

.controls button:hover {
  background: var(--hover);
}

.zoom {
  display: flex;
  flex-direction: column;
}

.zoom button {
  border-radius: 0;
}

.zoom button:first-child {
  border-radius: 10px 10px 0 0;
}

.zoom button:last-child {
  border-top: 0;
  border-radius: 0 0 10px 10px;
}

.credits {
  position: absolute;
  left: 13px;
  bottom: 8px;
  z-index: 20;
  max-width: 640px;
  color: rgba(245, 242, 239, 0.52);
  font-size: 10px;
  pointer-events: none;
}

@media (max-width: 860px) {
  .left-panel {
    width: calc(100svw - 32px);
  }

  .station-panel {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
  }

  .panel-close {
    left: auto;
    right: 0;
    top: -48px;
  }

  .zoom {
    display: none;
  }

  .controls {
    bottom: 190px;
  }

  .credits {
    max-width: 260px;
  }
}
.credits{
  display: none;
}