/* Cluster bubbles for MapLibre HTML markers (Supercluster) */
.marker-cluster {
  width: 40px;
  height: 40px;
  margin-left: -20px;
  margin-top: -20px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary-green, #2d8a4e) 42%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary-green, #2d8a4e) 55%, #fff 20%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  transition: transform .15s ease, box-shadow .15s ease;
}

.marker-cluster:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.marker-cluster div {
  width: 30px;
  height: 30px;
  margin: 0 !important;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary-green, #2d8a4e) 88%, #0a1a12);
  color: #fff;
  font: 700 12px/30px "Segoe UI", system-ui, sans-serif;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

.marker-cluster-small {
  background: color-mix(in srgb, var(--primary-green, #2d8a4e) 38%, transparent);
}

.marker-cluster-medium {
  background: color-mix(in srgb, var(--primary-blue, #3943e7) 42%, transparent);
  border-color: color-mix(in srgb, var(--primary-blue, #3943e7) 50%, #fff 15%);
}

.marker-cluster-medium div {
  background: color-mix(in srgb, var(--primary-blue, #3943e7) 90%, #0a0a1a);
  font-size: 11px;
}

.marker-cluster-large {
  width: 48px;
  height: 48px;
  margin-left: -24px;
  margin-top: -24px;
  background: color-mix(in srgb, var(--primary-blue, #3943e7) 48%, transparent);
}

.marker-cluster-large div {
  width: 36px;
  height: 36px;
  background: color-mix(in srgb, var(--primary-blue, #3943e7) 92%, #050510);
  font-size: 12px;
  font-weight: 800;
}

/* Night basemap / dark site — cooler cluster chrome */
[data-map-mode="night"] .marker-cluster,
[data-theme="dark"] .marker-cluster {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

[data-map-mode="night"] .marker-cluster-small,
[data-theme="dark"] .marker-cluster-small {
  background: color-mix(in srgb, #3dd68c 35%, transparent);
  border-color: color-mix(in srgb, #3dd68c 45%, #fff 10%);
}

[data-map-mode="night"] .marker-cluster-small div,
[data-theme="dark"] .marker-cluster-small div {
  background: color-mix(in srgb, #1f9a5c 85%, #04140c);
}

/*
 * 0×0 tip root — MapLibre transforms THIS point to the lat/lng.
 * Pin and label are absolute children and must never change root size.
 */
/* Clusters under pins; selected/route pins on top */
.maplibregl-marker.marker-cluster {
  z-index: 1 !important;
}

.maplibregl-marker.ttms-ml-marker-root,
.maplibregl-marker:has(.ttms-ml-marker-root) {
  z-index: 3;
}

.maplibregl-marker.ttms-ml-marker--raised,
.maplibregl-marker:has(.ttms-ml-marker--raised) {
  z-index: 20 !important;
}

.ttms-ml-marker-root {
  position: relative;
  width: 0 !important;
  height: 0 !important;
  overflow: visible !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 0;
  cursor: pointer;
  pointer-events: none;
  will-change: auto;
}

.ttms-ml-marker-pin {
  position: absolute;
  z-index: 1;
  pointer-events: auto;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box;
  line-height: 0;
}

.ttms-ml-label-host {
  position: absolute;
  z-index: 2;
  transform: translateX(-50%);
  width: max-content;
  max-width: 12em;
  pointer-events: none;
  line-height: normal;
  white-space: nowrap;
}

.ttms-ml-tooltip {
  display: inline-block;
  padding: 0.3em 0.55em;
  background: color-mix(in srgb, var(--bg-surface, #fff) 92%, transparent);
  color: var(--text-primary, #111);
  border: 1px solid color-mix(in srgb, var(--glass-border, #ccc) 70%, transparent);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  opacity: 0.96;
  pointer-events: none;
}

[data-map-mode="night"] .ttms-ml-tooltip,
[data-theme="dark"] .ttms-ml-tooltip {
  background: rgba(18, 24, 32, 0.92);
  color: #f2f4f7;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

/* Only force 0×0 on venue pin wrappers — not cluster bubbles */
.maplibregl-marker:has(.ttms-ml-marker-root) {
  width: 0 !important;
  height: 0 !important;
  overflow: visible !important;
}

.status-dot {
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  margin-left: 0.35em;
  vertical-align: middle;
}

.status-dot.green { background: #22c55e; }
.status-dot.red { background: #ef4444; }
.status-dot.yellow,
.status-dot.orange { background: #eab308; }
.status-dot.gray { background: #9ca3af; }
