/* ============================================================
   map-viewer.css
   Styles for the standalone Oahu offline map viewer page.
   ============================================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #1a2744;
  color: #ffffff;
}

/* ---- HEADER ---- */
#viewer-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: #1a2744;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

#viewer-title {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
}

#viewer-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #94a3b8;
}

#status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
}

#status-dot.status-online {
  background: #22c55e;
}

#status-dot.status-offline {
  background: #3b82f6;
}

#status-dot.status-error {
  background: #ef4444;
}

/* ---- MAP ---- */
#map {
  position: fixed;
  top: 48px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

/* ---- COORDINATE DISPLAY ---- */
#coord-display {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  color: #e0f0ff;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-family: monospace;
  z-index: 200;
  pointer-events: none;
  white-space: nowrap;
}

/* ---- GPS PANEL ---- */
#gps-panel {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#gps-btn {
  padding: 12px 28px;
  background: #1a2744;
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 24px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  letter-spacing: 0.01em;
}

#gps-btn:active {
  background: #0f3460;
}

#gps-status {
  font-size: 0.72rem;
  color: #94a3b8;
  text-align: center;
  max-width: 280px;
}

/* ---- GPS DOT (live position marker) ---- */
#gps-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #2563eb;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 4px rgba(37,99,235,0.3);
}

/* ---- INFO PANEL (pin drop details) ---- */
#info-panel {
  position: fixed;
  bottom: 110px;
  left: 16px;
  right: 16px;
  background: #1a2744;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 14px 16px;
  z-index: 300;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

#info-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#info-coords {
  font-family: monospace;
  font-size: 0.85rem;
  color: #cce4f7;
  word-break: break-all;
}

#info-close {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: #ffffff;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---- MapLibre spinner override ---- */
.maplibregl-ctrl-attrib {
  font-size: 0.65rem !important;
}

/* ---- Map loading spinner (used in map-picker.js) ---- */
.map-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: #cce4f7;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

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