/**
 * GARGANTUA — Astrophysics Telemetry HUD Stylesheet
 * Reticles, telemetry chips, oscilloscope line canvas, and warning alerts
 */

.hud-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.hud-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

/* Allow interaction with hud buttons if any */
.hud-overlay * {
  pointer-events: auto;
}

.hud-panel {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 260px;
  max-width: 320px;
}

.hud-top-left {
  position: absolute;
  top: 16px;
  left: 16px;
}

.hud-top-right {
  position: absolute;
  top: 16px;
  right: 380px; /* Positioned left of the control panel drawer */
}

@media (max-width: 1200px) {
  .hud-top-right {
    top: 70px;
    right: 16px;
  }
}

.hud-bottom-left {
  position: absolute;
  bottom: 16px;
  left: 16px;
  max-width: 440px;
}

/* HUD Headers & Badges */

.hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.hud-logo-icon {
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-cyan);
}

.hud-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--accent-cyan);
}

.hud-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #00ff88;
  background: rgba(0, 255, 136, 0.12);
  border: 1px solid rgba(0, 255, 136, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
}

.hud-badge.pulse-dot::before {
  content: '● ';
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hud-val-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.25);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Telemetry Grid */

.hud-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.hud-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.hud-val {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
}

.hud-val.highlight {
  color: var(--accent-cyan);
  text-shadow: 0 0 10px var(--accent-cyan-glow);
}

.hud-val.alert-glow {
  color: var(--accent-gold);
  text-shadow: 0 0 10px var(--accent-gold-glow);
}

.chip-tag {
  display: inline-block;
  font-size: 9.5px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-gold);
  width: fit-content;
}

.chip-tag.debug-tag {
  color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.12);
}

/* Oscilloscope Waveform */

.hud-waveform-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 6px;
}

.hud-waveform-label {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--text-muted);
}

#hud-oscilloscope {
  width: 100%;
  height: 32px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 4px;
  border: 1px solid rgba(0, 229, 255, 0.1);
}

/* Center Reticle */

.hud-center-reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  pointer-events: none;
}

.reticle-circle {
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  border: 1px dashed rgba(0, 229, 255, 0.25);
}

.reticle-line {
  position: absolute;
  background: rgba(0, 229, 255, 0.35);
}

.reticle-h {
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  transform: translateY(-50%);
}

.reticle-v {
  top: 0;
  left: 50%;
  width: 1px;
  height: 100%;
  transform: translateX(-50%);
}

.reticle-warning {
  position: absolute;
  top: 110px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--accent-red);
  background: rgba(255, 51, 102, 0.18);
  border: 1px solid var(--accent-red);
  padding: 4px 12px;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(255, 51, 102, 0.4);
  animation: warningBlink 0.8s ease-in-out infinite alternate;
}

.reticle-warning.hidden {
  display: none;
}

@keyframes warningBlink {
  from { opacity: 0.5; transform: translateX(-50%) scale(0.98); }
  to { opacity: 1; transform: translateX(-50%) scale(1.02); }
}

/* Bottom Target Info & Shortcuts */

.hud-target-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-target-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent-gold);
}

.hud-target-sub {
  font-size: 11px;
  color: var(--text-dim);
}

.hud-shortcuts-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 6px;
}

.shortcut-pill {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}
