@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600&display=swap');

:root {
  --bg: #0b0f14;
  --panel: rgba(20, 25, 36, 0.85);
  --border: rgba(255,255,255,0.08);
  --text: #e6e9f0;
  --muted: #9aa3b2;

  --blue: #4aa3ff;
  --green: #67e480;
  --mars: #d96b3b;
  --mars-dark: #3a1f14;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont;
  background: radial-gradient(1200px 800px at 30% 20%, #000000, var(--bg));
  color: var(--text);
}

/* ===== HEADER ===== */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(12,15,20,0.85);
  backdrop-filter: blur(12px);
}
.topbar .h1 {
  font-family: 'Orbitron', ui-sans-serif, system-ui, sans-serif;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.title .h1 {
  font-size: 17px;
  font-weight: 700;
}

.title .sub {
  font-size: 12px;
  color: var(--muted);
}

.controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

button {
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

button.primary {
  background: rgba(74,163,255,0.15);
}

button.danger {
  background: rgba(255,90,107,0.15);
}

/* ===== MISSION PANEL ===== */

.mission-panel {
  margin: 20px;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  border-radius: 24px;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.04),
    rgba(255,255,255,0.01)
  );
  border: 1px solid var(--border);
}

/* MAP */

.map-section {
  padding: 16px;
  border-radius: 20px;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border);
}

canvas {
  width: 100%;
  display: block;
  border-radius: 16px;
}

/* TELEMETRY COLUMN */

.telemetry-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.panel-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}

.readout {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco;
  font-size: 12px;
  color: var(--muted);
  white-space: pre-wrap;
}

/* LEGEND */

.legend {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
  margin-right: 8px;
}

.swatch.rover    { background: var(--blue); }
.swatch.target   { background: var(--green); }
.swatch.obstacle { background: var(--mars-dark); }
.swatch.path     { background: var(--mars); }
.swatch.explored { background: rgba(217,107,59,0.35); }

/* CAMERA */

/* =========================================================
   STAR WARS–INSPIRED COCKPIT GLOW
   (visual polish only — no structure changes)
   ========================================================= */

/* --- Global panel glow (very subtle) --- */
.panel {
  background:
    radial-gradient(
      ellipse at top,
      rgba(120, 180, 255, 0.06),
      rgba(6, 10, 18, 0.95) 65%
    );
  border: 1px solid rgba(120, 180, 255, 0.22);
  box-shadow:
    inset 0 0 18px rgba(120, 180, 255, 0.08),
    0 0 24px rgba(120, 180, 255, 0.07);
}

/* --- Camera panel slightly stronger glow --- */
.camera-panel {
  box-shadow:
    inset 0 0 22px rgba(120, 180, 255, 0.12),
    0 0 32px rgba(120, 180, 255, 0.10);
}

/* --- Image frames (Mastcam & Perseverance) --- */
.mastcam-frame {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(120, 180, 255, 0.28);
  box-shadow:
    inset 0 0 20px rgba(120, 180, 255, 0.12),
    0 0 28px rgba(120, 180, 255, 0.10);
}

/* --- Gentle sci-fi image treatment --- */
.mastcam-frame img {
  display: block;
  width: 100%;
  filter:
    contrast(1.05)
    saturate(1.08)
    brightness(0.96);
}

/* --- Panel titles feel like flight UI --- */
.panel-title {
  letter-spacing: 0.14em;
  color: #9fd3ff;
  text-shadow:
    0 0 6px rgba(120, 180, 255, 0.35);
}

/* --- Slow cockpit pulse (barely perceptible) --- */
@keyframes cockpitGlow {
  0% {
    box-shadow:
      inset 0 0 18px rgba(120, 180, 255, 0.08),
      0 0 22px rgba(120, 180, 255, 0.07);
  }
  50% {
    box-shadow:
      inset 0 0 24px rgba(120, 180, 255, 0.12),
      0 0 34px rgba(120, 180, 255, 0.11);
  }
  100% {
    box-shadow:
      inset 0 0 18px rgba(120, 180, 255, 0.08),
      0 0 22px rgba(120, 180, 255, 0.07);
  }
}

/* Apply pulse only to camera panel */
.camera-panel {
  animation: cockpitGlow 7s ease-in-out infinite;
}


/* =========================================================
   STARFIELD BACKDROP FOR MISSION PANEL
   ========================================================= */

.mission-panel {
  position: relative;
  background:
    linear-gradient(
      to bottom,
      rgba(8, 12, 20, 0.85),
      rgba(8, 12, 20, 0.95) 60%,
      rgba(8, 12, 20, 1)
    ),
    url("starfield.jpg");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}
