@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700;900&display=swap');

body.loop-theme {
  /* Dark neutral gradient to make colored arrows pop out clearly */
  background: linear-gradient(-45deg, #111827, #1f2937, #374151, #0f172a);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  color: #f3f4f6;
  font-family: 'Outfit', sans-serif;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

body.loop-theme.light-mode {
  background: linear-gradient(-45deg, #f3f4f6, #e5e7eb, #d1d5db, #f9fafb);
  color: #111827;
}

body.loop-theme.light-mode .node-inspector {
  background: rgba(255, 255, 255, 0.85);
  border-left: 1px solid rgba(0, 0, 0, 0.1);
  color: #111827;
}

body.loop-theme.light-mode #hudStatus {
  color: #374151;
  text-shadow: 0 2px 4px rgba(255,255,255,0.5);
}

#app-loop {
  width: 100%;
  height: 100%;
  position: relative;
  /* Kamos Header offset */
  padding-top: 64px; 
}

#gameCanvas {
  position: absolute;
  top: 64px;
  left: 0;
  width: 100%;
  height: calc(100% - 64px);
  z-index: 1;
}

/* --- GAME HUD COMMAND BAR --- */
.game-hud-bar {
  position: absolute;
  bottom: 4rem;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 100;
  pointer-events: none;
}

#hudStatus {
  margin-bottom: 20px;
  font-size: 1.2rem;
  color: #fff;
  font-weight: 900;
  letter-spacing: 4px;
  text-transform: uppercase;
  text-shadow: 0 4px 10px rgba(0,0,0,0.2);
  pointer-events: none;
}

.hud-inner {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  padding: 1.5rem 2.5rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1), inset 0 0 20px rgba(255, 255, 255, 0.5);
  pointer-events: auto;
}

.hud-inner input {
  background: rgba(255, 255, 255, 0.7);
  border: 2px solid transparent;
  color: #333;
  padding: 16px 28px;
  border-radius: 999px;
  width: 500px;
  font-size: 1.2rem;
  outline: none;
  font-family: 'Outfit', sans-serif;
  transition: all 0.3s;
  box-shadow: inset 0 4px 10px rgba(0,0,0,0.05);
}

.hud-inner input::placeholder {
  color: #888;
}

.hud-inner input:focus {
  border-color: #10b981;
  background: #fff;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4), inset 0 4px 10px rgba(0,0,0,0.05);
}

.btn-primary, .btn-secondary {
  padding: 16px 32px;
  border-radius: 999px;
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  letter-spacing: 2px;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981, #34d399);
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.4);
  text-transform: uppercase;
}

.btn-primary:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 15px 30px rgba(16, 185, 129, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.6);
  color: #666;
  border: 2px solid transparent;
  text-transform: uppercase;
  font-weight: 700;
}

.btn-secondary:hover {
  background: #fff;
  color: #333;
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

/* --- NODE INSPECTOR HUD --- */
.node-inspector {
  position: absolute;
  top: 84px; /* offset for header */
  right: -400px;
  width: 350px;
  height: calc(100vh - 140px);
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255, 255, 255, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px 0 0 20px;
  box-shadow: -10px 10px 30px rgba(0, 0, 0, 0.1);
  transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  padding: 24px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  color: #333;
  z-index: 100;
}

.node-inspector.active {
  right: 0;
}

.inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid rgba(16, 185, 129, 0.5);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.inspector-title {
  font-size: 20px;
  font-weight: 900;
  color: #2c3e50;
  letter-spacing: 1px;
}

.btn-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #666;
  transition: transform 0.2s;
  padding: 0;
}

.btn-close:hover {
  transform: scale(1.2) rotate(90deg);
  color: #10b981;
}

.inspector-content {
  flex: 1;
  overflow-y: auto;
}

.inspector-section {
  background: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.inspector-section h3 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #10b981;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.inspector-section p, .inspector-section ul {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.inspector-section ul {
  padding-left: 20px;
  list-style-type: none;
  margin: 0;
}

.inspector-section li {
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.8);
  padding: 8px 12px;
  border-radius: 8px;
  border-left: 4px solid #a1c4fd;
  font-size: 13px;
}

.inspector-section li.out {
  border-left-color: #10b981;
}

/* --- MARKDOWN STYLES --- */
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  margin-top: 24px;
  margin-bottom: 16px;
  font-weight: 600;
  line-height: 1.25;
  color: #111827;
}

.markdown-body h1 { font-size: 1.5em; }
.markdown-body h2 { font-size: 1.25em; border-bottom: 1px solid #eaecef; padding-bottom: 0.3em; }
.markdown-body h3 { font-size: 1.1em; }

.markdown-body p, .markdown-body ul, .markdown-body ol {
  margin-top: 0;
  margin-bottom: 16px;
}

.markdown-body ul, .markdown-body ol {
  padding-left: 2em;
  list-style-type: disc;
}

.markdown-body li {
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 0.25em;
  font-size: 0.95rem;
}

