/* ═══════════════════════════════════════════════
   Premium Map Modes — Mode Switcher, Tracker Controls,
   Loading States, Containers for Track/Map/3D
   ═══════════════════════════════════════════════ */

/* ── Mode Switcher (Segmented Control) ── */
.map-mode-switcher {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  padding: 2px;
  margin-right: 1rem;
}

.mode-tab {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.4);
  font-family: 'Inter', sans-serif;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: .35rem .8rem;
  cursor: pointer;
  transition: all .25s;
  white-space: nowrap;
  border-radius: 4px;
}

.mode-tab:hover {
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.05);
}

.mode-tab.active {
  color: #000;
  background: var(--neon, #c8ff00);
  box-shadow: 0 0 12px rgba(200,255,0,0.3);
}

.mode-tab.disabled {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Tracker Canvas Container ── */
.tracker-canvas-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: none;
}

.tracker-canvas-container.active {
  display: block;
}

.tracker-canvas-container canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 4px;
}

/* ── Tracker Controls Bar ── */
.tracker-controls {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: .6rem 1rem;
  background: rgba(255,255,255,0.03);
  border-top: 1px solid rgba(255,255,255,0.05);
}

.tracker-controls.active {
  display: flex;
}

.tracker-btn {
  background: rgba(255,255,255,0.08);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all .2s;
}

.tracker-btn:hover {
  background: rgba(255,255,255,0.15);
}

.tracker-btn.play-btn {
  width: 44px;
  height: 44px;
  background: var(--neon, #c8ff00);
  color: #000;
  font-size: 16px;
}

.tracker-btn.play-btn:hover {
  box-shadow: 0 0 16px rgba(200,255,0,0.4);
}

.tracker-btn.play-btn.playing {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* Speed selector */
.speed-selector {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  padding: 2px;
}

.speed-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.4);
  font-family: 'Inter', sans-serif;
  font-size: .65rem;
  font-weight: 700;
  padding: .25rem .5rem;
  cursor: pointer;
  border-radius: 3px;
  transition: all .2s;
}

.speed-btn:hover {
  color: rgba(255,255,255,0.7);
}

.speed-btn.active {
  background: rgba(200,255,0,0.15);
  color: var(--neon, #c8ff00);
}

/* Ghost toggle */
.ghost-toggle {
  display: flex;
  align-items: center;
  gap: .4rem;
  cursor: pointer;
  font-size: .7rem;
  color: rgba(255,255,255,0.4);
  transition: color .2s;
}

.ghost-toggle:hover {
  color: rgba(255,255,255,0.7);
}

.ghost-toggle.active {
  color: #6495ed;
}

.ghost-toggle .ghost-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6495ed;
  opacity: 0.4;
  transition: opacity .2s;
}

.ghost-toggle.active .ghost-dot {
  opacity: 1;
  box-shadow: 0 0 6px rgba(100,149,237,0.5);
}

/* ── Mapbox Container ── */
.mapbox-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: none;
  border-radius: 4px;
  overflow: hidden;
}

.mapbox-container.active {
  display: block;
}

/* ── Three.js 3D Container ── */
.three-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: none;
  border-radius: 4px;
  overflow: hidden;
}

.three-container.active {
  display: block;
}

/* ── Loading Spinner ── */
.map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10,10,10,0.9);
  z-index: 5;
}

.map-loading-ring {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(200,255,0,0.15);
  border-top-color: var(--neon, #c8ff00);
  border-radius: 50%;
  animation: map-spin 0.8s linear infinite;
}

.map-loading-text {
  margin-top: .75rem;
  font-size: .7rem;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}

@keyframes map-spin {
  to { transform: rotate(360deg); }
}

/* ── Updated Overlay Layout ── */
.map-overlay-content {
  display: flex;
  flex-direction: column;
  max-width: 95vw;
  max-height: 85vh;
  width: 100%;
}

.map-overlay-viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .map-mode-switcher {
    margin-right: 0;
  }

  .mode-tab {
    font-size: .55rem;
    padding: .3rem .5rem;
    letter-spacing: .5px;
  }

  .tracker-controls {
    gap: .6rem;
    padding: .4rem .6rem;
  }

  .tracker-btn {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .tracker-btn.play-btn {
    width: 38px;
    height: 38px;
  }

  .speed-selector {
    gap: 1px;
  }

  .speed-btn {
    font-size: .55rem;
    padding: .2rem .35rem;
  }
}

@media (max-width: 480px) {
  .tracker-controls {
    flex-wrap: wrap;
    gap: .4rem;
  }

  .ghost-toggle span {
    display: none;
  }
}
