/* =====================================================================
   GPS Speedometer – scoped to #gpssm-wrapper to prevent theme bleed.
   All selectors begin with #gpssm-* so they cannot be accidentally
   overridden by generic WordPress theme rules.
   ===================================================================== */

#gpssm-wrapper {
  box-sizing: border-box;
  background: #0a0a0a;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px 24px;
  gap: 20px;
  border-radius: 12px;
  max-width: 540px;
  margin: 0 auto;
  -webkit-font-smoothing: antialiased;
}

#gpssm-wrapper *,
#gpssm-wrapper *::before,
#gpssm-wrapper *::after {
  box-sizing: inherit;
}

/* ── Unit selector ──────────────────────────────────────────────── */

#gpssm-unit-selector {
  display: flex;
  gap: 6px;
  background: rgba(255,255,255,0.06);
  padding: 5px;
  border-radius: 999px;
}

.gpssm-unit-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  line-height: 1;
}

.gpssm-unit-btn:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.08);
}

.gpssm-unit-btn--active,
.gpssm-unit-btn--active:hover {
  background: #7ab800;
  color: #000000;
  font-weight: 700;
}

/* ── Display-mode toggle ────────────────────────────────────────── */

#gpssm-display-toggle {
  display: flex;
  gap: 6px;
  background: rgba(255,255,255,0.06);
  padding: 5px;
  border-radius: 999px;
}

.gpssm-mode-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  line-height: 1;
}

.gpssm-mode-btn:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.08);
}

.gpssm-mode-btn--active,
.gpssm-mode-btn--active:hover {
  background: #7ab800;
  color: #000000;
  font-weight: 700;
}

.gpssm-mode-btn svg {
  flex-shrink: 0;
}

/* ── Displays ───────────────────────────────────────────────────── */

.gpssm-display {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.gpssm-display--hidden {
  display: none !important;
}

/* Analog canvas */
#gpssm-canvas {
  display: block;
  width: 300px;
  height: 300px;
}

/* Digital readout */
#gpssm-digital-display {
  flex-direction: column;
  gap: 6px;
  min-height: 300px;
}

#gpssm-digital-value {
  font-size: clamp(72px, 18vw, 108px);
  font-weight: 800;
  letter-spacing: -4px;
  line-height: 1;
  color: #ffffff;
}

#gpssm-digital-sep {
  color: #7ab800;
}

#gpssm-digital-unit-label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}

/* ── Controls (start + max) ─────────────────────────────────────── */

#gpssm-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

#gpssm-start-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #7ab800;
  color: #000000;
  border: none;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 32px;
  cursor: pointer;
  transition: background 0.18s, transform 0.12s;
  min-width: 130px;
  justify-content: center;
}

#gpssm-start-btn:hover {
  background: #8fd400;
}

#gpssm-start-btn:active {
  transform: scale(0.97);
}

#gpssm-start-btn.gpssm-running {
  background: #3a3a3a;
  color: #ffffff;
}

#gpssm-start-btn.gpssm-running:hover {
  background: #4a4a4a;
}

/* Shared stat chip style (max speed + distance use the same pill) */
#gpssm-max-speed,
#gpssm-distance {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

#gpssm-max-label,
#gpssm-dist-label {
  color: rgba(255,255,255,0.45);
  letter-spacing: 1px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

#gpssm-max-value,
#gpssm-dist-value {
  color: #ffffff;
  font-weight: 700;
}

#gpssm-max-unit,
#gpssm-dist-unit {
  color: #7ab800;
  font-weight: 700;
  font-size: 13px;
}

/* ── Status / error ─────────────────────────────────────────────── */

#gpssm-status {
  margin: 0;
  font-size: 13px;
  color: #ff6b6b;
  text-align: center;
  min-height: 18px;
}

#gpssm-status:empty {
  display: none;
}

/* ── Footer note ────────────────────────────────────────────────── */

#gpssm-footer-note {
  margin: 0;
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  text-align: center;
  max-width: 400px;
  line-height: 1.6;
}

/* ── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 380px) {
  #gpssm-wrapper {
    padding: 24px 12px 20px;
    gap: 14px;
  }
  .gpssm-unit-btn {
    padding: 6px 12px;
  }
  .gpssm-mode-btn {
    padding: 6px 14px;
  }
}
