/* ============================================
   FIELD MAP SECTION
   ============================================ */

.field-map-section {
  background: var(--bg-primary);
  position: relative;
}

/* ---- Wrapper ---- */
.field-map-wrapper {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

/* ---- Map Container ---- */
.field-map-container {
  flex: 1;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--border-color);
  min-height: 400px;
  background: var(--bg-secondary);
  transition: border-color 0.3s ease;
}

.field-map-container:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* ---- Map Image ---- */
.field-map-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---- Overlay ---- */
.field-map-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 14, 23, 0.1) 0%, rgba(10, 14, 23, 0.3) 100%);
  pointer-events: none;
}

/* ---- Grid Overlay ---- */
.field-grid-overlay {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 49px, rgba(255, 255, 255, 0.04) 49px, rgba(255, 255, 255, 0.04) 50px),
    repeating-linear-gradient(90deg, transparent, transparent 49px, rgba(255, 255, 255, 0.04) 49px, rgba(255, 255, 255, 0.04) 50px);
  opacity: 0.6;
  pointer-events: none;
}

/* ---- Zone Markers ---- */
.zone-marker {
  position: absolute;
  cursor: pointer;
  z-index: 10;
  pointer-events: auto;
}

/* ---- Zone Dot ---- */
.zone-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  position: relative;
  transition: transform 0.25s ease;
  box-shadow: 0 0 10px currentColor;
}

.zone-marker:hover .zone-dot {
  transform: scale(1.3);
}

/* Pulsing ring animation */
.zone-dot::before,
.zone-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0;
  animation: zone-pulse 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.zone-dot::after {
  animation-delay: 0.6s;
}

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

/* Zone dot color variants */
.zone-dot.red {
  background: #ef4444;
  color: #ef4444;
}

.zone-dot.blue {
  background: #3b82f6;
  color: #3b82f6;
}

.zone-dot.gold {
  background: #f59e0b;
  color: #f59e0b;
}

.zone-dot.green {
  background: #22c55e;
  color: #22c55e;
}

.zone-dot.orange {
  background: #ff6b35;
  color: #ff6b35;
}

.zone-dot.white {
  background: #f1f5f9;
  color: #f1f5f9;
}

/* ---- Zone Tooltip ---- */
.zone-tooltip {
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  min-width: 220px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 20;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Tooltip arrow — points down (default: tooltip above dot) */
.zone-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--border-color);
}

.zone-marker:hover .zone-tooltip {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Tooltip below the dot — for markers near the top of the map */
.zone-marker.tooltip-below .zone-tooltip {
  bottom: auto;
  top: 130%;
  transform: translateX(-50%) translateY(-8px);
}

.zone-marker.tooltip-below:hover .zone-tooltip {
  transform: translateX(-50%) translateY(0);
}

.zone-marker.tooltip-below .zone-tooltip::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--border-color);
}

.zone-tooltip h4 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.zone-tooltip p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ---- Legend Panel ---- */
.field-map-legend {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-width: 200px;
  align-self: flex-start;
}

.field-map-legend h3 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.legend-item {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.2s ease;
}

.legend-item:last-child {
  border-bottom: none;
}

.legend-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.legend-item span {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Legend dot colors */
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

.legend-dot.red {
  background: #ef4444;
  color: #ef4444;
}

.legend-dot.blue {
  background: #3b82f6;
  color: #3b82f6;
}

.legend-dot.gold {
  background: #f59e0b;
  color: #f59e0b;
}

.legend-dot.green {
  background: #22c55e;
  color: #22c55e;
}

.legend-dot.orange {
  background: #ff6b35;
  color: #ff6b35;
}

.legend-dot.white {
  background: #f1f5f9;
  color: #f1f5f9;
}

/* ---- 360 hint in tooltip ---- */
.zone-tooltip-360 {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* ---- 360 Modal ---- */
.map360-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.map360-overlay.hidden {
  display: none;
}

.map360-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 820px;
  overflow: hidden;
}

.map360-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
}

.map360-header span {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.map360-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.map360-close-btn:hover {
  color: var(--text-primary);
}

#map360-viewer {
  width: 100%;
  height: 420px;
  background: #000;
}

.map360-soon {
  width: 100%;
  height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-muted);
}

.map360-soon p {
  font-size: 0.9rem;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .field-map-wrapper {
    flex-direction: column;
  }

  .field-map-legend {
    min-width: unset;
    display: flex;
    flex-wrap: wrap;
    gap: 0 24px;
  }

  .field-map-legend h3 {
    width: 100%;
  }

  .legend-item {
    border-bottom: none;
    padding: 6px 0;
  }
}

@media (max-width: 640px) {
  .field-map-container {
    min-height: 280px;
  }

  .zone-tooltip {
    min-width: 180px;
    padding: 12px;
  }

  #map360-viewer {
    height: 260px;
  }
}
