/* NavStation - Real-time GPS position page */

/* Pulsing position overlay */
@keyframes navstation-pulse-ring {
  0%   { transform: scale(0.2); opacity: 0.8; }
  100% { transform: scale(1);   opacity: 0; }
}

.navstation-pulse {
  position: absolute;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #1A73E8;
  display: none;
  animation: navstation-pulse-ring 2s ease-out infinite;
  pointer-events: none;
}

.navstation-page {
  width: 90%;
  margin: 0 auto;
  padding: 1rem;
}

.navstation-toolbar {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  background: #1e293b;
  border-radius: 8px 8px 0 0;
  color: #f8fafc;
}

.navstation-toolbar h1 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  padding-top: 0.15rem;
  color: #f8fafc;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  align-self: flex-start;
}

.navstation-readout {
  display: flex;
  gap: 1.25rem;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.875rem;
  font-family: 'Courier New', monospace;
}

.navstation-readout-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.navstation-readout-label {
  color: #94a3b8;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.navstation-readout-value {
  color: #4ade80;
  font-weight: 600;
  min-width: 5rem;
}

.navstation-status {
  font-size: 0.8rem;
  color: #94a3b8;
  font-style: italic;
}

.navstation-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.navstation-btn {
  padding: 0.4rem 0.9rem;
  border: 1px solid #475569;
  border-radius: 4px;
  background: #334155;
  color: #f8fafc;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.navstation-btn:hover {
  background: #475569;
  border-color: #64748b;
}

.navstation-btn--start {
  background: #1d4ed8;
  border-color: #3b82f6;
}

.navstation-btn--start:hover {
  background: #2563eb;
}

.navstation-btn--active {
  background: #dc2626;
  border-color: #ef4444;
}

.navstation-btn--active:hover {
  background: #ef4444;
}

.navstation-btn--locked {
  background: #15803d;
  border-color: #22c55e;
  color: #fff;
}

.navstation-map-wrapper {
  position: relative;
  width: 100%;
  height: 75vh;
  min-height: 400px;
}

#navstation-map {
  width: 100%;
  height: 100%;
}

.navstation-error {
  display: none;
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(220, 38, 38, 0.95);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 1000;
  max-width: 90%;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.navstation-btn--yacht {
  background: #1d4ed8;
  border-color: #3b82f6;
  color: #fff;
  text-decoration: none;
  justify-content: center;
}

.navstation-btn--yacht:hover {
  background: #2563eb;
  color: #fff;
  text-decoration: none;
}

/* Quick update panel */
.navstation-quick-panel {
  background: #f8fafc;
  border-top: 3px solid #1d4ed8;
  padding: 1.25rem 1.5rem;
}

.navstation-quick-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
}

.navstation-quick-prefill {
  font-size: 0.85rem;
  color: #475569;
  margin-bottom: 0.75rem;
  font-family: 'Courier New', monospace;
  background: #e2e8f0;
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
}

.navstation-quick-textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 0.75rem;
  box-sizing: border-box;
}

.navstation-quick-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.navstation-quick-result {
  font-size: 0.875rem;
  padding: 0.4rem 0;
  min-height: 1.5rem;
}

.navstation-quick-result--success {
  color: #15803d;
  font-weight: 600;
}

.navstation-quick-result--error {
  color: #dc2626;
}

/* Mobile & tablet — full width */
@media (max-width: 1024px) {
  .navstation-page {
    width: 100%;
    padding: 0;
  }
  .navstation-toolbar {
    border-radius: 0;
  }
  .navstation-quick-panel {
    padding: 1rem;
  }
}

/* Mobile only */
@media (max-width: 600px) {
  .navstation-toolbar {
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
  }
  .navstation-toolbar h1 {
    font-size: 0.95rem;
    flex: 0 0 100%;
  }
  .navstation-readout {
    gap: 0.75rem;
    font-size: 0.8rem;
  }
  .navstation-map-wrapper {
    height: calc(100vh - 160px);
    min-height: 300px;
  }
}

/* Floating measure info panel */
.measure-info-panel {
  position: absolute;
  bottom: 60px;
  left: 10px;
  background: rgba(30, 41, 59, 0.92);
  color: #f8fafc;
  padding: 0.55rem 0.85rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: 'Courier New', monospace;
  z-index: 500;
  pointer-events: none;
  min-width: 160px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  line-height: 1.7;
}

.measure-info-leg {
  color: #cbd5e1;
}

.measure-info-leg strong {
  color: #f8fafc;
}

.measure-info-total {
  color: #FACC15;
  border-top: 1px solid #475569;
  margin-top: 0.3rem;
  padding-top: 0.3rem;
}

.measure-info-total strong {
  color: #fff;
}

/* Measure tool */
.navstation-btn--measure-reset {
  color: #dc2626;
}
.navstation-btn--measure-reset:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}
.navstation-measure-leg,
.navstation-measure-total {
  position: absolute;
  white-space: pre;
  text-align: center;
  line-height: 1.4;
  font-weight: bold;
  pointer-events: none;
  text-shadow: 0 0 3px #000, 0 0 3px #000, 0 0 3px #000;
}
.navstation-measure-leg {
  color: #ffffff;
  font-size: 12px;
  transform: translate(-50%, -50%);
}
.navstation-measure-total {
  color: #FACC15;
  font-size: 13px;
  transform: translate(-50%, -100%);
}
.navstation-measure-speed {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #fff;
}
.navstation-measure-speed select {
  border-radius: 3px;
  border: 1px solid #555;
  background: #1e3a5f;
  color: #fff;
  padding: 2px 4px;
  font-size: 13px;
  cursor: pointer;
}
