/* Carte live - OpenStreetMap / Leaflet, style D! Club */

.live-map-section {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.live-map-section .section__head h2,
.live-map-section .section__head p {
  color: var(--white);
}

.live-map-section .live-map__sidebar-title {
  color: rgba(255, 255, 255, 0.75);
}

.live-map-section .live-map-feed__item {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.2);
}

.live-map-section .live-map-feed__item:hover,
.live-map-section .live-map-feed__item.is-active {
  border-color: var(--white);
  background: rgba(0, 0, 0, 0.35);
}

.live-map-section .live-map__stat-pill {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.9);
}

.live-map-section .live-map__stat-pill strong {
  color: var(--white);
}

.live-map-layout {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .live-map-layout {
    grid-template-columns: 300px 1fr;
    grid-template-rows: auto 1fr;
    align-items: stretch;
  }

  .live-map-section__head {
    grid-column: 1 / -1;
  }

  .live-map__sidebar {
    grid-row: 2;
  }

  .live-map__wrap {
    grid-row: 2;
    min-height: 420px;
  }
}

.live-map__wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  min-height: 320px;
  background: #0d0d0d;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.live-map__wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    rgba(227, 45, 45, 0.12) 0%,
    transparent 40%,
    transparent 60%,
    rgba(26, 26, 26, 0.5) 100%
  );
  z-index: 400;
}

.live-map {
  width: 100%;
  height: 100%;
  min-height: 320px;
  z-index: 1;
}

@media (min-width: 900px) {
  .live-map {
    min-height: 420px;
  }
}

/* Tuiles OSM - rendu type Google, teinte rouge/noir */
.live-map .leaflet-tile-pane {
  filter: saturate(0.85) brightness(0.72) contrast(1.08) sepia(0.12) hue-rotate(330deg);
}

.live-map .leaflet-container {
  font-family: var(--font);
  background: #1a1a1a;
}

.live-map .leaflet-control-attribution {
  background: rgba(26, 26, 26, 0.85) !important;
  color: var(--gray-dim) !important;
  font-size: 0.65rem !important;
  padding: 2px 6px !important;
  border-radius: 4px 0 0 0;
}

.live-map .leaflet-control-attribution a {
  color: var(--gray) !important;
}

.live-map .leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

.live-map .leaflet-control-zoom a {
  background: var(--black-card) !important;
  color: var(--white) !important;
  border: 1px solid var(--border) !important;
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  font-size: 1.1rem !important;
}

.live-map .leaflet-control-zoom a:hover {
  background: var(--red-dim) !important;
  color: var(--red-hover) !important;
}

/* Marqueurs */
.map-marker {
  background: transparent !important;
  border: none !important;
}

.map-marker--venue {
  width: 48px !important;
  height: 48px !important;
  margin-left: -24px !important;
  margin-top: -48px !important;
}

.map-marker--venue .map-marker__pin {
  width: 48px;
  height: 48px;
  background: var(--red);
  border: 3px solid var(--white);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(227, 45, 45, 0.6);
  animation: map-pulse-venue 2s ease-in-out infinite;
}

.map-marker--venue .map-marker__pin span {
  transform: rotate(45deg);
  font-weight: 800;
  font-size: 0.75rem;
  color: var(--white);
}

@keyframes map-pulse-venue {
  0%,
  100% {
    box-shadow: 0 4px 20px rgba(227, 45, 45, 0.5);
  }
  50% {
    box-shadow: 0 4px 32px rgba(227, 45, 45, 0.9);
  }
}

.map-marker--viewer {
  width: 36px !important;
  height: 36px !important;
  margin-left: -18px !important;
  margin-top: -18px !important;
}

.map-marker--viewer .map-marker__dot {
  width: 14px;
  height: 14px;
  background: #2ecc71;
  border: 2px solid var(--white);
  border-radius: 50%;
  margin: 11px auto 0;
  box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.5);
  animation: map-pulse-viewer 2s infinite;
}

.map-marker.map-marker--viewer.is-active .map-marker__dot {
  background: var(--red);
  animation: none;
  box-shadow: 0 0 0 6px var(--red-dim);
}

.map-marker--viewer.is-you .map-marker__dot {
  background: var(--red-hover);
  width: 16px;
  height: 16px;
  margin-top: 10px;
}

/* Marqueurs membres en ligne */
.map-marker--member {
  width: 44px !important;
  height: 52px !important;
  margin-left: -22px !important;
  margin-top: -44px !important;
}

.map-marker__member {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  pointer-events: none;
}

.map-marker__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--member-color, var(--red));
  border: 3px solid var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--white);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}

.map-marker__name {
  font-size: 0.55rem;
  font-weight: 700;
  background: rgba(26, 26, 26, 0.92);
  color: var(--white);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  max-width: 4.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-marker--member.is-you .map-marker__avatar {
  border-color: var(--red-hover);
  box-shadow: 0 0 0 4px var(--red-dim), 0 4px 20px rgba(227, 45, 45, 0.55);
  animation: map-pulse-member 2s ease-in-out infinite;
}

.map-marker--member.is-active .map-marker__avatar {
  transform: scale(1.15);
  box-shadow: 0 0 0 6px var(--red-dim), 0 6px 24px rgba(227, 45, 45, 0.5);
}

.map-marker--member.tier--diamond .map-marker__avatar {
  border-color: #f1c40f;
}

.map-marker--member.tier--platinum .map-marker__avatar {
  border-color: #bdc3c7;
}

@keyframes map-pulse-member {
  0%,
  100% {
    box-shadow: 0 0 0 4px var(--red-dim), 0 4px 16px rgba(227, 45, 45, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(227, 45, 45, 0.15), 0 4px 24px rgba(227, 45, 45, 0.65);
  }
}

.map-popup--member .map-popup__tier {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  margin: 0.2rem 0 0.35rem;
}

@keyframes map-pulse-viewer {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.55);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(46, 204, 113, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
  }
}

.map-marker--viewer .map-marker__label {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  font-weight: 800;
  background: rgba(26, 26, 26, 0.9);
  color: var(--white);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  white-space: nowrap;
  border: 1px solid var(--border);
}

/* Popup Leaflet */
.live-map .leaflet-popup-content-wrapper {
  background: var(--black-soft);
  color: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.live-map .leaflet-popup-tip {
  background: var(--black-soft);
  border: 1px solid var(--border);
}

.map-popup strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.map-popup span {
  font-size: 0.85rem;
  color: var(--gray);
}

.map-popup a {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--red-hover);
  font-weight: 700;
  font-size: 0.9rem;
}

/* Sidebar liste */
.live-map__sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 420px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.live-map__sidebar-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.live-map-feed__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--black-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: left;
  width: 100%;
  color: inherit;
  font: inherit;
}

.live-map-feed__item:hover,
.live-map-feed__item.is-active {
  border-color: var(--red);
  background: var(--red-dim);
}

.live-map-feed__av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  flex-shrink: 0;
}

.live-map-feed__text strong {
  display: block;
  font-size: 0.95rem;
}

.live-map-feed__text span {
  font-size: 0.8rem;
  color: var(--gray);
}

.live-map__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.live-map__stat-pill {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  background: var(--black-card);
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--gray);
}

.live-map__stat-pill strong {
  color: var(--white);
}
