/* ============================================
   PULSESUITE.IO — ELECTRIC DARK DESIGN SYSTEM
   Business Nerve Center
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&family=Inter+Tight:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --bg-void: #050508;
  --bg-deep: #0a0a0f;
  --bg-surface: #0f1018;
  --bg-elevated: #151620;
  --bg-card: #1a1b2e;
  --pulse-blue: #00d4ff;
  --pulse-blue-dim: #00d4ff33;
  --pulse-blue-glow: #00d4ff66;
  --pulse-cyan: #00ffd5;
  --pulse-white: #e8f0ff;
  --pulse-hot: #ff3366;
  --pulse-warn: #ffaa00;
  --pulse-green: #00ff88;
  --pulse-purple: #8844ff;
  --text-primary: #e8f0ff;
  --text-secondary: #7a8ba8;
  --text-dim: #3d4a5c;
  --text-accent: #00d4ff;
  --grid-line: #ffffff06;
  --border-subtle: #ffffff0a;
  --border-active: #00d4ff33;
  --border-glow: #00d4ff66;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --glow-sm: 0 0 10px #00d4ff22;
  --glow-md: 0 0 20px #00d4ff33;
  --glow-lg: 0 0 40px #00d4ff44;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%; width: 100%;
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: 'Inter Tight', 'Space Grotesk', -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Circuit board grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(0deg, var(--grid-line) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, #00d4ff08 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-active); border-radius: 3px; }

/* ============ APP LAYOUT — NAMED GRID AREAS ============ */
.app-shell {
  display: grid;
  grid-template-columns: 64px 240px 1fr 320px;
  grid-template-rows: 56px 1fr 48px;
  grid-template-areas:
    "rail sidebar topbar  panel"
    "rail sidebar content panel"
    "rail sidebar bottom  panel";
  height: 100vh;
  width: 100vw;
  position: relative;
  z-index: 1;
}

/* ============ NAV RAIL ============ */
.nav-rail {
  grid-area: rail;
  background: var(--bg-deep);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  gap: 4px;
}

.nav-rail .logo {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--pulse-blue), var(--pulse-purple));
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  position: relative;
  cursor: pointer;
}

.nav-rail .logo::after {
  content: '';
  position: absolute; inset: -3px;
  border-radius: var(--radius-md);
  border: 2px solid var(--pulse-blue-dim);
  animation: logo-pulse 2s ease-in-out infinite;
}

@keyframes logo-pulse {
  0%, 100% { border-color: var(--pulse-blue-dim); transform: scale(1); }
  50% { border-color: var(--pulse-blue-glow); transform: scale(1.05); }
}

.nav-rail .logo svg { width: 20px; height: 20px; fill: none; stroke: white; }

.nav-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  position: relative;
}

.nav-btn:hover { background: var(--bg-elevated); color: var(--text-primary); }
.nav-btn.active { background: var(--pulse-blue-dim); color: var(--pulse-blue); box-shadow: var(--glow-sm); }

.nav-btn .badge {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px;
  background: var(--pulse-hot);
  border-radius: 50%;
  animation: badge-pulse 1.5s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* Nav icon highlight — pulses when AI mentions a feature */
.nav-btn.nav-highlight {
  background: var(--pulse-blue-dim) !important;
  color: var(--pulse-blue) !important;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

@keyframes nav-highlight-pulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.2);
    background: var(--pulse-blue-dim);
  }
  50% {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5), inset 0 0 8px rgba(0, 212, 255, 0.15);
    background: rgba(0, 212, 255, 0.2);
  }
}

.nav-spacer { flex: 1; }

/* ============ CHANNEL SIDEBAR ============ */
.channel-sidebar {
  grid-area: sidebar;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.channel-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
}

.channel-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.channel-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.channel-group-title {
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-dim);
  padding: 16px 8px 4px;
}

.channel-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 13px;
  color: var(--text-secondary);
}

.channel-item:hover { background: var(--bg-elevated); color: var(--text-primary); }
.channel-item.active { background: var(--pulse-blue-dim); color: var(--pulse-blue); }

.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pulse-dot.live { background: var(--pulse-green); box-shadow: 0 0 8px var(--pulse-green); animation: dot-pulse 1.5s ease-in-out infinite; }
.pulse-dot.idle { background: var(--text-dim); }
.pulse-dot.alert { background: var(--pulse-hot); box-shadow: 0 0 8px var(--pulse-hot); animation: dot-pulse 0.8s ease-in-out infinite; }

@keyframes dot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============ TOP BAR ============ */
.top-bar {
  grid-area: topbar;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

.top-bar .view-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600; font-size: 16px;
  letter-spacing: 0.3px;
}

.top-bar .view-subtitle { font-size: 12px; color: var(--text-secondary); }
.top-bar .spacer { flex: 1; }

.status-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 12px; font-weight: 500;
}

.status-pill .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--pulse-green);
  animation: dot-pulse 2s ease-in-out infinite;
}

.command-bar-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.command-bar-trigger:hover { border-color: var(--border-active); color: var(--text-secondary); }

.command-bar-trigger kbd {
  padding: 1px 5px; border-radius: 3px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
}

/* ============ MAIN CONTENT ============ */
.main-content {
  grid-area: content;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg-void);
}

/* ============ CHAT ============ */
.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg {
  display: flex;
  gap: 12px;
  max-width: 85%;
  animation: msg-enter 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.msg.outgoing { align-self: flex-end; flex-direction: row-reverse; }
.msg.incoming { align-self: flex-start; }

@keyframes msg-enter {
  from { opacity: 0; transform: translateX(40px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

.msg.outgoing { animation-name: msg-enter-out; }

@keyframes msg-enter-out {
  from { opacity: 0; transform: translateX(-40px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

.msg.priority { animation: msg-lightning 0.3s cubic-bezier(0, 0.8, 0.2, 1); }

@keyframes msg-lightning {
  0% { opacity: 0; transform: translateX(200px) scale(0.8); filter: brightness(3); }
  50% { filter: brightness(2); }
  100% { opacity: 1; transform: translateX(0) scale(1); filter: brightness(1); }
}

.msg.critical { animation: msg-critical 0.25s cubic-bezier(0, 0.8, 0.2, 1); }

@keyframes msg-critical {
  0% { opacity: 0; transform: translateX(300px) scale(0.7); filter: brightness(4) hue-rotate(-20deg); }
  30% { filter: brightness(3); }
  100% { opacity: 1; transform: translateX(0) scale(1); filter: brightness(1) hue-rotate(0); }
}

.msg-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  font-family: 'Space Grotesk', sans-serif;
}

.msg-avatar.ai {
  background: linear-gradient(135deg, var(--pulse-blue), var(--pulse-purple));
  color: white;
  position: relative;
}

.msg-avatar.ai::after {
  content: '';
  position: absolute; inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--pulse-blue-dim);
  animation: avatar-ring 3s ease-in-out infinite;
}

@keyframes avatar-ring {
  0%, 100% { border-color: var(--pulse-blue-dim); }
  50% { border-color: var(--pulse-blue-glow); }
}

/* Speaking pulse — avatar lights up when agent is talking */
.msg-avatar.ai.speaking {
  animation: avatar-speaking 0.6s ease-out;
}

@keyframes avatar-speaking {
  0% { box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.6); transform: scale(1); }
  30% { box-shadow: 0 0 20px 8px rgba(0, 212, 255, 0.3); transform: scale(1.15); }
  100% { box-shadow: 0 0 0 0 transparent; transform: scale(1); }
}

/* Right panel agent cards — speaking state */
.agent-card.speaking {
  border-color: var(--pulse-blue);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
  animation: agent-card-speak 1.5s ease-in-out;
}

.agent-card.speaking .agent-indicator {
  background: var(--pulse-blue) !important;
  box-shadow: 0 0 12px var(--pulse-blue) !important;
  animation: indicator-speak 0.8s ease-in-out infinite;
}

@keyframes agent-card-speak {
  0% { border-color: var(--border-subtle); box-shadow: none; }
  20% { border-color: var(--pulse-blue); box-shadow: 0 0 15px rgba(0, 212, 255, 0.2); }
  100% { border-color: var(--border-subtle); box-shadow: none; }
}

@keyframes indicator-speak {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.5); box-shadow: 0 0 16px var(--pulse-blue); }
}

.msg-avatar.user {
  background: var(--bg-elevated);
  border: 2px solid var(--border-active);
  color: var(--pulse-blue);
}

.msg-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  line-height: 1.6;
  font-size: 13.5px;
}

.msg.incoming .msg-bubble {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-bottom-left-radius: 4px;
}

.msg.outgoing .msg-bubble {
  background: linear-gradient(135deg, #0a2a4a, #0a1a3a);
  border: 1px solid var(--pulse-blue-dim);
  border-bottom-right-radius: 4px;
}

.msg-bubble.pulsing { animation: bubble-pulse 2s ease-in-out infinite; }

@keyframes bubble-pulse {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50% { box-shadow: 0 0 20px var(--pulse-blue-dim); }
}

.msg.priority .msg-bubble { border-color: var(--pulse-warn); box-shadow: 0 0 15px rgba(255, 170, 0, 0.15); }

.msg.critical .msg-bubble {
  border-color: var(--pulse-hot);
  box-shadow: 0 0 20px rgba(255, 51, 102, 0.2);
  animation: critical-glow 1.5s ease-in-out infinite;
}

@keyframes critical-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 51, 102, 0.15); }
  50% { box-shadow: 0 0 35px rgba(255, 51, 102, 0.3); }
}

.msg-meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-dim);
}

.msg-meta .agent-name {
  font-weight: 600;
  color: var(--pulse-blue);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.typing-indicator {
  display: flex; gap: 4px;
  padding: 12px 16px;
  align-items: center;
}

.typing-indicator .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--pulse-blue);
  animation: typing-bounce 1.4s ease-in-out infinite;
}

.typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-8px); opacity: 1; }
}

/* ============ CHAT INPUT ============ */
.chat-input-area {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.chat-input-wrapper {
  display: flex; align-items: flex-end; gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 8px 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input-wrapper:focus-within {
  border-color: var(--border-active);
  box-shadow: var(--glow-sm);
}

.chat-input-wrapper textarea {
  flex: 1;
  background: none; border: none;
  color: var(--text-primary);
  font-family: 'Inter Tight', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  resize: none; outline: none;
  max-height: 120px;
  padding: 4px 0;
}

.chat-input-wrapper textarea::placeholder { color: var(--text-dim); }

.input-btn {
  width: 36px; height: 36px;
  border-radius: 50%; border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.input-btn.voice-btn { background: var(--bg-card); color: var(--text-secondary); }
.input-btn.voice-btn:hover { background: var(--pulse-blue-dim); color: var(--pulse-blue); }

/* Mic ON state (toggled on, waiting for voice) */
.input-btn.voice-btn.mic-on {
  background: var(--pulse-green);
  color: var(--bg-void);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

/* Mic OFF state */
.input-btn.voice-btn.mic-off {
  background: var(--bg-card);
  color: var(--text-dim);
  opacity: 0.6;
}

.input-btn.voice-btn.recording {
  background: var(--pulse-hot); color: white;
  animation: recording-pulse 1s ease-in-out infinite;
}

/* Always-on button */
.input-btn.always-on-btn {
  background: var(--bg-card);
  color: var(--text-secondary);
}

.input-btn.always-on-btn:hover {
  background: var(--pulse-blue-dim);
  color: var(--pulse-blue);
}

.input-btn.always-on-btn.active {
  background: var(--pulse-cyan);
  color: var(--bg-void);
  box-shadow: 0 0 12px rgba(0, 255, 213, 0.3);
  animation: always-on-pulse 2s ease-in-out infinite;
}

@keyframes always-on-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(0, 255, 213, 0.2); }
  50% { box-shadow: 0 0 16px rgba(0, 255, 213, 0.4); }
}

@keyframes recording-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 51, 102, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(255, 51, 102, 0); }
}

.input-btn.send-btn { background: var(--pulse-blue); color: var(--bg-void); }
.input-btn.send-btn:hover { background: #33ddff; box-shadow: var(--glow-md); }
.input-btn.send-btn:disabled { background: var(--bg-card); color: var(--text-dim); cursor: not-allowed; box-shadow: none; }

/* ============ RIGHT PANEL ============ */
.right-panel {
  grid-area: panel;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.panel-section {
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-section-title {
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}

/* Status rings */
.status-ring-container {
  display: flex; flex-wrap: wrap; gap: 16px;
  justify-content: center;
}

.status-ring {
  position: relative;
  width: 56px; height: 56px;
  display: flex; flex-direction: column; align-items: center;
}

.status-ring .ring {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 3px solid;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}

.status-ring .ring.healthy {
  border-color: var(--pulse-green);
  animation: ring-healthy 2s ease-in-out infinite;
}

@keyframes ring-healthy {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(0, 255, 136, 0); }
}

.status-ring .ring.elevated {
  border-color: var(--pulse-warn);
  animation: ring-elevated 1.2s ease-in-out infinite;
}

@keyframes ring-elevated {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 170, 0, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(255, 170, 0, 0); }
}

.status-ring .ring.critical {
  border-color: var(--pulse-hot);
  animation: ring-critical 0.8s ease-in-out infinite;
}

@keyframes ring-critical {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 51, 102, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(255, 51, 102, 0); }
}

.status-ring .ring-label {
  font-size: 9px; font-weight: 600;
  color: var(--text-secondary);
  margin-top: 4px;
  text-align: center;
  letter-spacing: 0.5px;
}

/* Agent cards */
.agent-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  margin-bottom: 8px;
  transition: all 0.2s;
}

.agent-card:hover { border-color: var(--border-active); }

.agent-indicator {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.agent-indicator.online {
  background: var(--pulse-green);
  box-shadow: 0 0 8px var(--pulse-green);
}

.agent-info { flex: 1; }

.agent-card .agent-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.5px;
}

.agent-card .agent-role { font-size: 11px; color: var(--text-secondary); }

/* Nerve map */
.nerve-map {
  width: 100%; height: 200px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.nerve-map canvas { width: 100%; height: 100%; }

/* ============ BOTTOM BAR ============ */
.bottom-bar {
  grid-area: bottom;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 20px;
  font-size: 11px;
  color: var(--text-dim);
}

.bottom-bar .metric { display: flex; align-items: center; gap: 4px; }

.bottom-bar .metric .val {
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
}

/* ============ COMMAND PALETTE ============ */
.command-overlay {
  position: fixed; inset: 0;
  background: rgba(5, 5, 8, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}

.command-overlay.open { display: flex; }

.command-palette {
  width: 560px;
  background: var(--bg-surface);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  box-shadow: var(--glow-lg), 0 20px 60px rgba(0,0,0,0.5);
  overflow: hidden;
}

.command-palette input {
  width: 100%; padding: 16px 20px;
  background: transparent; border: none;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: 'Inter Tight', sans-serif;
  font-size: 16px; outline: none;
}

.command-palette input::placeholder { color: var(--text-dim); }

.command-results { max-height: 300px; overflow-y: auto; padding: 8px; }

.command-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s;
}

.command-result-item:hover,
.command-result-item.selected { background: var(--pulse-blue-dim); }

.command-result-item .cmd-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  color: var(--pulse-blue); font-size: 14px;
}

.command-result-item .cmd-text { flex: 1; }
.command-result-item .cmd-name { font-size: 13px; font-weight: 500; }
.command-result-item .cmd-desc { font-size: 11px; color: var(--text-secondary); }

/* ============ EDGE FLASH ============ */
.edge-flash {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 999;
  opacity: 0;
}

.edge-flash.active { animation: edge-flash-anim 0.6s ease-out; }

@keyframes edge-flash-anim {
  0% { opacity: 1; box-shadow: inset 0 0 80px rgba(255, 51, 102, 0.4); }
  100% { opacity: 0; box-shadow: inset 0 0 80px rgba(255, 51, 102, 0); }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1200px) {
  .app-shell {
    grid-template-columns: 64px 1fr 280px;
    grid-template-areas:
      "rail topbar  panel"
      "rail content panel"
      "rail bottom  panel";
  }
  .channel-sidebar { display: none; }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 56px 1fr 48px;
    grid-template-areas:
      "topbar"
      "content"
      "bottom";
  }
  .nav-rail, .channel-sidebar, .right-panel { display: none; }
}

.mono { font-family: 'JetBrains Mono', monospace; }

/* ============================================
   PULSE SHOT — fires from chat bubbles
   ============================================ */

.pulse-shot {
  position: fixed;
  width: 120px;
  height: 2px;
  transform-origin: left center;
  transform: rotate(var(--shot-angle, 0deg));
  animation: pulse-fire 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  pointer-events: none;
  z-index: 9999;
}

.pulse-shot::before {
  content: '';
  position: absolute;
  left: 0;
  top: -1px;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--shot-color, #00d4ff) 0%, transparent 100%);
  border-radius: 4px;
  box-shadow: 0 0 12px var(--shot-color, #00d4ff), 0 0 30px var(--shot-color, #00d4ff);
  filter: blur(0.5px);
}

/* Bright leading dot */
.pulse-shot::after {
  content: '';
  position: absolute;
  right: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--shot-color, #00d4ff);
  box-shadow: 0 0 10px var(--shot-color, #00d4ff), 0 0 20px var(--shot-color, #00d4ff), 0 0 40px var(--shot-color, #00d4ff);
}

@keyframes pulse-fire {
  0% {
    width: 0;
    opacity: 1;
    left: var(--start-x, auto);
  }
  30% {
    width: 180px;
    opacity: 1;
  }
  100% {
    width: 400px;
    opacity: 0;
    transform: rotate(var(--shot-angle, 0deg)) translateX(calc(100vw));
  }
}

/* ============================================
   HOMEPAGE — Enhanced pulse animations
   ============================================ */

/* Rapid horizontal scan lines */
.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #00d4ff66, #00d4ff, #00d4ff66, transparent);
  animation: scan-line 4s linear infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes scan-line {
  0% { left: -50%; top: 20%; }
  25% { top: 40%; }
  50% { left: 100%; top: 60%; }
  50.01% { left: -50%; top: 80%; }
  75% { top: 50%; }
  100% { left: 100%; top: 30%; }
}

/* Multiple pulse traces with different speeds */
.hero-pulse-line svg:nth-child(2) .pulse-trace {
  animation-delay: 1s;
  animation-duration: 2.5s;
  stroke: #00ffd5;
  opacity: 0.8;
}

.hero-pulse-line svg:nth-child(3) .pulse-trace {
  animation-delay: 0.5s;
  animation-duration: 2s;
  stroke: #8844ff;
  opacity: 0.6;
}

/* Edge glow flash for rapid activity */
.edge-glow-fx {
  position: fixed;
  top: 0; bottom: 0;
  width: 3px;
  right: 0;
  background: var(--shot-color, #00d4ff);
  box-shadow: 0 0 15px var(--shot-color, #00d4ff), 0 0 30px var(--shot-color, #00d4ff);
  animation: edge-flash 0.3s ease-out forwards;
  pointer-events: none;
  z-index: 10000;
}

@keyframes edge-flash {
  0% { opacity: 1; width: 3px; }
  100% { opacity: 0; width: 1px; }
}
