/* ==========================================================================
   3D GLOBE & 2D OPEN-SOURCE TACTICAL MAP STYLES
   ========================================================================== */

/* 3D Pillars and Point labels */
.globe-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(7, 10, 17, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(6, 182, 212, 0.4);
  border-radius: 8px;
  padding: 8px 12px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  z-index: 1000;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, -120%);
  white-space: nowrap;
  transition: opacity 0.15s ease-out;
}

.globe-tooltip-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent-cyan);
  font-size: 12px;
  margin-bottom: 2px;
}

.globe-tooltip-val {
  font-weight: 600;
  color: #fff;
}

.globe-tooltip-party {
  font-size: 10px;
  color: var(--text-muted);
}

/* 2D Tactical Map Alternate View (Leaflet Open Source) */
#tactical-2d-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #060910;
  display: none;
  overflow: hidden;
  padding: 0;
  margin: 0;
  z-index: 5;
}

#tactical-2d-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Tactical 2D Floating HUD Overlay */
.tactical-2d-hud {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(8, 14, 24, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(6, 182, 212, 0.28);
  border-radius: 8px;
  padding: 7px 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.65);
  pointer-events: auto;
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-btn {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-family: var(--font-mono);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
  white-space: nowrap;
}

.hud-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-cyan);
  color: #fff;
}

.hud-btn.active {
  background: rgba(6, 182, 212, 0.22);
  border-color: var(--accent-cyan);
  color: #fff;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.35);
}

.hud-btn-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text-muted);
  padding: 4px 9px;
  border-radius: 12px;
  font-size: 10px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}

.hud-btn-pill:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent-cyan);
  color: #fff;
}

.hud-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 380px;
  min-width: 180px;
}

.hud-search-icon {
  position: absolute;
  left: 9px;
  font-size: 12px;
  pointer-events: none;
  opacity: 0.6;
}

#tactical-2d-search {
  width: 100%;
  background: rgba(4, 7, 13, 0.85);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 6px;
  padding: 5px 28px 5px 28px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 11px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#tactical-2d-search:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

.hud-clear-btn {
  position: absolute;
  right: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 5px;
}

.hud-clear-btn:hover {
  color: #fff;
}

.hud-telemetry {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--accent-cyan);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.telemetry-radar-dot {
  width: 7px;
  height: 7px;
  background: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent-cyan);
  animation: radarPulse 1.8s infinite;
}

@keyframes radarPulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* Subregions Matrix Floating Modal */
#tactical-2d-subregions-overlay {
  position: absolute;
  top: 60px;
  left: 20px;
  right: 20px;
  bottom: 20px;
  background: rgba(7, 11, 20, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: 12px;
  z-index: 150;
  padding: 20px;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85);
}

.subregions-overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.subregions-overlay-header h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent-cyan);
  margin: 0;
}

.subregion-grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.subregion-block {
  background: rgba(13, 20, 32, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.subregion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.subregion-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.muni-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.muni-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.muni-pill:hover {
  background: rgba(6, 182, 212, 0.2);
  border-color: var(--accent-cyan);
  color: #fff;
}

/* Custom Leaflet Popups with Military Cyber-Dark UI */
.tactical-popup-wrapper .leaflet-popup-content-wrapper {
  background: rgba(7, 12, 22, 0.96) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(6, 182, 212, 0.45) !important;
  border-radius: 8px !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8) !important;
  color: #fff !important;
  padding: 0 !important;
  overflow: hidden;
}

.tactical-popup-wrapper .leaflet-popup-tip {
  background: rgba(7, 12, 22, 0.96) !important;
  border: 1px solid rgba(6, 182, 212, 0.45) !important;
}

.tactical-popup-wrapper .leaflet-popup-content {
  margin: 12px 14px !important;
  line-height: 1.4 !important;
}

.tactical-leaflet-popup .popup-header {
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tactical-leaflet-popup .popup-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--accent-cyan);
  letter-spacing: 1px;
}

.tactical-leaflet-popup .popup-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-top: 1px;
}

.tactical-leaflet-popup .popup-subtitle {
  font-size: 10.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.tactical-leaflet-popup .popup-body {
  margin-bottom: 10px;
}

.tactical-leaflet-popup .popup-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  margin-bottom: 4px;
}

.tactical-leaflet-popup .popup-metric-row.focused-row {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 4px;
  padding: 3px 6px;
  margin-top: 6px;
}

.tactical-leaflet-popup .metric-label {
  color: var(--text-secondary);
}

.tactical-leaflet-popup .metric-value {
  color: #fff;
  font-weight: 600;
}

.tactical-leaflet-popup .highlight-cyan {
  color: var(--accent-cyan) !important;
  font-weight: 700;
}

.tactical-leaflet-popup .highlight-gold {
  color: #eab308 !important;
  font-weight: 700;
}

.tactical-leaflet-popup .popup-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
}

.tactical-leaflet-popup .popup-action-btn {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.tactical-leaflet-popup .popup-action-btn:hover {
  background: rgba(6, 182, 212, 0.35);
  border-color: #00f0ff;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

.tactical-leaflet-popup .popup-action-btn.alt {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.4);
}

.tactical-leaflet-popup .popup-action-btn.alt:hover {
  background: rgba(139, 92, 246, 0.35);
  border-color: #a78bfa;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

/* Responsive Collapsible Drawers */
@media (max-width: 1200px) {
  .main-viewport {
    grid-template-columns: 320px 1fr 360px;
  }
}

@media (max-width: 900px) {
  .main-viewport {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }
  .params-sidebar, .telemetry-sidebar {
    max-height: 40vh;
  }
  .tactical-2d-hud {
    flex-wrap: wrap;
  }
}