/* ==========================================================================
   VintageTrail - Map & Marker Custom Styling
   ========================================================================== */

/* Custom Pin Markers */
.vintage-marker {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 2px solid var(--text-main);
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  font-family: var(--font-sans);
  z-index: 10;
}

.vintage-marker:hover {
  transform: translate(-50%, -60%) scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  z-index: 900 !important;
  background: #fff;
}

.vintage-marker.selected {
  border-color: var(--tier3-color);
  background: #181716;
  color: #fff;
  transform: translate(-50%, -62%) scale(1.18);
  box-shadow: 0 8px 24px rgba(226, 114, 91, 0.4);
  z-index: 1000 !important;
}

.marker-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.marker-name {
  font-size: 0.76rem;
  font-weight: 800;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.marker-price {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--tier3-color);
  background: var(--tier3-bg);
  padding: 1px 5px;
  border-radius: 4px;
}

.vintage-marker.selected .marker-price {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* Dense Pin Mode (When zoomed out, collapse unselected markers to avoid overlapping) */
#map.dense-pins .vintage-marker:not(.selected):not(:hover) {
  padding: 3px 6px;
  gap: 3px;
}

#map.dense-pins .vintage-marker:not(.selected):not(:hover) .marker-name {
  display: none;
}

/* Tier Specific Dot Colors */
.marker-tier-tier3 {
  border-color: var(--tier3-color);
}
.marker-tier-tier2 {
  border-color: var(--tier2-color);
}
.marker-tier-tier1 {
  border-color: var(--tier1-color);
}

/* MapLibre Popup Customization */
.maplibregl-popup {
  max-width: 280px !important;
  font-family: var(--font-sans);
}

.maplibregl-popup-content {
  padding: 0 !important;
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg) !important;
  overflow: hidden;
  background: var(--bg-card);
}

.maplibregl-popup-close-button {
  top: 8px;
  right: 8px;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  z-index: 20;
}

.popup-card {
  display: flex;
  flex-direction: column;
}

.popup-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.popup-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.popup-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.popup-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.popup-btn-details {
  margin-top: 4px;
  width: 100%;
  padding: 6px 0;
  background: var(--bg-dark);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

.popup-btn-details:hover {
  background: #333;
}

/* Floating Map Overlay Controls */
.map-floating-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 30;
}

.map-control-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  color: var(--text-main);
  font-size: 1.1rem;
}

.map-control-btn:hover {
  border-color: var(--text-main);
  transform: scale(1.05);
}

/* Map Style Switcher (Vintage Film vs Clean Dark vs Light) */
.map-style-toggle {
  position: absolute;
  bottom: 24px;
  right: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: var(--radius-pill);
  display: flex;
  gap: 4px;
  box-shadow: var(--shadow-md);
  z-index: 30;
}

.style-option-btn {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.style-option-btn.active {
  background: var(--bg-dark);
  color: #fff;
}
