@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
  background: #1f2025;
}

/* === 雙地圖容器 === */
#map,
#map2 {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
}

#map {
  left: 0;
}

#map2 {
  right: 0;
}

/* === 中間分隔線 === */
.divider {
  position: fixed;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.05) 100%);
  z-index: 100;
  pointer-events: none;
}

/* === 地圖標題 === */
.map-label {
  position: absolute;
  top: 12px;
  z-index: 50;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  pointer-events: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.map-label-left {
  left: 16px;
  background: rgba(30, 32, 45, 0.85);
  color: #79e5fd;
}

.map-label-right {
  right: 16px;
  background: rgba(30, 32, 45, 0.85);
  color: #ffc800;
}

/* === PGA 色階條 === */
.pga-legend {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(20, 22, 30, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.pga-legend-title {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.pga-legend-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  width: 220px;
}

/* === 震度圖例 === */
.intensity-legend {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(20, 22, 30, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.intensity-legend-title {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.intensity-legend-items {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.intensity-legend-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid;
  flex-shrink: 0;
}

/* === 測站標記（PGA 小圓點） === */
.station-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: background-color 0.3s ease;
  cursor: default;
}

/* === 測站震度球 === */
.station-intensity {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
  cursor: default;
}

/* === 連線狀態 === */
.ws-status {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(20, 22, 30, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
}

.ws-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.ws-status-dot.connected {
  background: #44fa34;
  box-shadow: 0 0 6px rgba(68, 250, 52, 0.5);
}

.ws-status-dot.disconnected {
  background: #fc5235;
  box-shadow: 0 0 6px rgba(252, 82, 53, 0.5);
}

.ws-status-dot.connecting {
  background: #fff000;
  box-shadow: 0 0 6px rgba(255, 240, 0, 0.5);
  animation: pulse 1.2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

/* === 測站計數 === */
.station-count {
  position: fixed;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 500;
  background: rgba(20, 22, 30, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.45);
}

/* === Hover Popup === */
.station-popup .maplibregl-popup-content {
  background: rgba(15, 17, 25, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: #fff;
  min-width: 120px;
}

.station-popup .maplibregl-popup-tip {
  border-top-color: rgba(15, 17, 25, 0.95);
}

.popup-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.popup-id {
  font-weight: 700;
  color: #79e5fd;
  font-size: 13px;
}

.popup-net {
  font-weight: 400;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  margin-left: 4px;
}

.popup-row {
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
}

.popup-row b {
  color: #fff;
}

.popup-offline {
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
}