/* Interactive Map Styles */

.map-pin {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #fff;
  cursor: pointer;
  transform: translate(-50%, -50%) scale(var(--pin-scale, 1)); /* Scale counteracts canvas zoom */
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  z-index: 10;
}

/* Invisible Click Hitbox Overlay Extension (+12px padding on all sides) */
.map-pin::before {
  content: '';
  position: absolute;
  top: -12px;
  left: -12px;
  right: -12px;
  bottom: -12px;
  border-radius: 50%;
  background: transparent;
  z-index: 2; /* Float above other highlights to capture click */
}

/* Center white anchor dot */
.pin-dot {
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  pointer-events: none;
}

.map-pin:hover {
  transform: translate(-50%, -50%) scale(calc(var(--pin-scale, 1) * 1.3)); /* Amplify zoom scaling on hover */
  z-index: 20;
}

/* Pin Type Styling (Player Behavior Events) */
.pin-spawn {
  background: #10b981; /* Emerald Green */
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
}

.pin-move {
  background: #3b82f6; /* Dodger Blue */
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.pin-combat {
  background: #f97316; /* Energy Orange */
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.6);
}

.pin-treasure, .pin-loot {
  background: #eab308; /* Gold */
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.6);
}

.pin-death {
  background: #1e293b; /* Dark Slate */
  border-color: #ef4444 !important; /* Crimson outline */
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.7);
}

.pin-exit {
  background: #a855f7; /* Amethyst Purple */
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.6);
}

/* Pulsing Glow Rings for key event categories */
.map-pin::after {
  content: '';
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0;
  pointer-events: none;
}

.pin-spawn::after {
  color: #10b981;
  animation: pin-pulse 2.2s infinite cubic-bezier(0.165, 0.84, 0.44, 1);
}

.pin-combat::after {
  color: #f97316;
  animation: pin-pulse 1.8s infinite cubic-bezier(0.165, 0.84, 0.44, 1);
}

.pin-death::after {
  color: #ef4444;
  animation: pin-pulse 1.2s infinite cubic-bezier(0.165, 0.84, 0.44, 1);
}

.pin-exit::after {
  color: #a855f7;
  animation: pin-pulse 2.2s infinite cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes pin-pulse {
  0% {
    transform: scale(0.6);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* Hidden Pin state during filtering */
.map-pin.filtered-out {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.5);
}

/* SVG Connection Paths */
.map-path {
  stroke: rgba(148, 163, 184, 0.22);
  stroke-width: 2px;
  stroke-dasharray: 6 5;
  transition: stroke var(--transition-normal), opacity var(--transition-normal);
  animation: map-path-flow 25s infinite linear;
}

.map-path.hover-path {
  stroke-width: 3px;
  stroke-dasharray: 4 4;
  animation: map-path-flow 12s infinite linear; /* Flows faster for active trace look */
  transition: opacity 0.2s ease;
}

.map-path.hidden {
  opacity: 0;
  pointer-events: none;
}

@keyframes map-path-flow {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: -100;
  }
}

/* Hover Tooltip - Attached to body or desktop container */
.map-tooltip {
  position: absolute;
  padding: 6px 12px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-primary);
  pointer-events: none;
  z-index: 100000; /* Float above all other layers */
  transform: translate(12px, 12px); /* Offset from cursor */
  opacity: 0;
  transition: opacity 0.15s ease;
  line-height: 1.4;
}

.map-tooltip.visible {
  opacity: 1;
}

.map-tooltip-title {
  font-weight: 600;
  color: #fff;
}

.map-tooltip-type {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.type-spawn { color: #10b981; }
.type-move { color: #60a5fa; }
.type-combat { color: #fb923c; }
.type-treasure, .type-loot { color: #facc15; }
.type-death { color: #ef4444; }
.type-exit { color: #c084fc; }

/* Range Slider Custom Styling */
.timeline-slider-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.timeline-slider-label {
  font-size: 11px;
  color: var(--text-muted);
  width: 55px;
  font-weight: 500;
}

.timeline-slider-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
}

input[type=range].timeline-range-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  height: 6px;
  outline: none;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

input[type=range].timeline-range-input:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Chrome/Safari Thumbs */
input[type=range].timeline-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
  cursor: pointer;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

input[type=range].timeline-range-input::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  background: #818cf8;
}

/* Firefox Thumbs */
input[type=range].timeline-range-input::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
  cursor: pointer;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

input[type=range].timeline-range-input::-moz-range-thumb:hover {
  transform: scale(1.25);
  background: #818cf8;
}

/* Session List Styling */
.session-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: background-color var(--transition-fast);
}

.session-list-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* Cluster Pin Nodes Styling */
.map-pin.pin-cluster {
  background: rgba(99, 102, 241, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid var(--primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.7);
}

.map-pin.pin-cluster:hover {
  background: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 22px rgba(99, 102, 241, 0.9);
  border-color: #fff;
  transform: translate(-50%, -50%) scale(calc(var(--pin-scale, 1) * 1.35)); /* Override standard hover scale slightly larger */
}

/* Cluster Node Number Badge */
.pin-cluster-count {
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-title);
  pointer-events: none;
  line-height: 1;
}

/* Heatmap Canvas Layer Container */
#map-heatmap-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Let all events pass through to canvas controls */
  z-index: 4; /* Render behind pins and paths but on canvas */
  transition: opacity var(--transition-normal) ease;
  opacity: 0;
}

#map-heatmap-layer.visible {
  opacity: 1;
}

/* Glassmorphic Tabs Selector */
.overlay-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
  margin-bottom: 14px;
}

.overlay-tab {
  flex: 1;
  text-align: center;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.overlay-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
}

.overlay-tab.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

/* Options Container styling */
.overlay-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

