/* Import Inter Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;500;700;900&display=swap');

:root {
  /* Palette (Shared with Battle View) */
  --bg-deep: #0f172a;
  --bg-dark: #020617;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.15);
  
  /* Accents */
  --cyan-primary: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.6);
  --amber-primary: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.6);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;

  /* Sizing */
  --radius-lg: 24px;
  --radius-md: 12px;
}

* { box-sizing: border-box; }

/* --- Main Layout --- */
.catapult-view {
  width: 100%;
  height: 100%;
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(6, 182, 212, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 50% 100%, rgba(245, 158, 11, 0.08) 0%, transparent 60%);
  font-family: 'Inter', sans-serif;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

/* Ambient Floating Blobs */
.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  z-index: 0;
  animation: float 10s infinite ease-in-out;
}

.glow-1 {
  width: 300px; height: 300px;
  background: var(--cyan-primary);
  top: -50px; left: 20%;
}

.glow-2 {
  width: 400px; height: 400px;
  background: #4f46e5; /* Indigo */
  bottom: -100px; right: 20%;
  animation-delay: -5s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, 30px); }
}

/* --- Header --- */
.catapult-header {
  text-align: center;
  z-index: 2;
  margin-bottom: 1.5rem;
}

.header-badge {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 3px;
  font-weight: 700;
  color: var(--cyan-primary);
  background: rgba(6, 182, 212, 0.1);
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid rgba(6, 182, 212, 0.2);
  margin-bottom: 0.5rem;
}

.catapult-header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  text-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* --- Main Glass Console --- */
.control-console {
  flex: 1;
  display: flex;
  gap: 1.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px var(--glass-highlight);
  z-index: 2;
  overflow: hidden;
  min-height: 400px;
}

/* Side Panels */
.panel-side {
  width: 280px; /* increased from 200px to give origin/destination more space */
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1rem 0;
}

.data-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.label-row {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.value-row {
  font-size: 1.25rem;
  font-weight: 700;
}
.value-row.large { font-size: 1.4rem; color: #fff; }
.value-row.accent-amber { color: var(--amber-primary); }

/* Ensure marker cards scale nicely in wider panels */
.marker-card {
  min-width: 240px; /* ensure a comfortable width for label and icon */
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
}

/* Marker Cards (Launch/Target) */
.marker-card {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
}

.marker-icon { font-size: 1.8rem; }
.marker-info { display: flex; flex-direction: column; }
.marker-info span { font-size: 0.6rem; color: var(--text-muted); font-weight: 700; }
.marker-info strong { font-size: 0.9rem; color: #fff; }

.marker-card.target { border-color: rgba(6, 182, 212, 0.3); }
.marker-card.reached { 
  background: rgba(6, 182, 212, 0.1); 
  border-color: var(--cyan-primary);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
}

/* Responsive: collapse side panels on small screens */
@media (max-width: 900px) {
  .panel-side { width: 100%; }
  .marker-card { min-width: auto; width: 100%; }
}

/* --- Center Hologram --- */
.panel-center {
  flex: 1;
  background: rgba(0,0,0,0.3);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.05);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.hologram-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.trajectory-svg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0; left: 0;
  z-index: 5;
}

/* Mechanical Arm Styling */
.mech-container {
  position: absolute;
  bottom: 0;
  left: 80px; /* Aligns with SVG start */
  transform: translateX(-50%);
  z-index: 10;
  padding-bottom: 20px;
}

.machine {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.catapult-base {
  width: 60px;
  height: 10px;
  background: #334155;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.catapult-arm {
  width: 80px;
  height: 6px;
  background: var(--amber-primary);
  border-radius: 4px;
  transform-origin: bottom left;
  transform: rotate(0deg);
  transition: transform 0.2s cubic-bezier(0.4, 2.5, 0.5, 0.5);
  position: relative;
  box-shadow: 0 0 15px var(--amber-glow);
}

.catapult-bucket {
  position: absolute;
  right: -15px;
  top: -20px;
  font-size: 2rem;
  transform: rotate(0deg);
}

/* Arm Animation States */
.machine.shaking .catapult-arm {
  animation: tension-shake 0.1s infinite;
}

.catapult-arm.launched {
  transform: rotate(-80deg);
  transition: transform 0.4s cubic-bezier(0.1, 0.8, 0.1, 1);
}

@keyframes tension-shake {
  0% { transform: rotate(0deg) translateY(0); }
  50% { transform: rotate(1deg) translateY(1px); }
  100% { transform: rotate(0deg) translateY(0); }
}

/* --- Footer HUD --- */
.hud-footer {
  margin-top: 1.5rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.status-bar-container {
  width: 100%;
}

.bar-label {
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.progress-track {
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan-primary), #3b82f6);
  box-shadow: 0 0 15px var(--cyan-glow);
  transition: width 0.1s linear;
}

.message-display {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--glass-border);
  padding: 1rem;
  border-radius: var(--radius-md);
  font-family: 'Inter', monospace; /* Monospace vibe for terminal */
  font-weight: 500;
  text-align: center;
  color: #fff;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.blink { animation: blinker 1s linear infinite; }
@keyframes blinker { 50% { opacity: 0; } }

/* Message States */
.message-display.warning { border-color: var(--amber-primary); color: var(--amber-primary); }
.message-display.launch { border-color: var(--cyan-primary); color: var(--cyan-primary); background: rgba(6, 182, 212, 0.1); font-weight: 700; }
.message-display.success { border-color: #10b981; color: #10b981; }

/* Screen Shake Effect for Impact */
.catapult-view.impact {
  animation: impact-shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes impact-shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}