/* src/diagrams/adaptive-context-switch/styles.css */
/* Scoped styles for Diagram 3: Adaptive Context Switching Architecture */

.context-fsm-card {
  background: #0d1117;
  border: 1px solid #21262d;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.25s ease-in-out;
}

.context-fsm-card:hover {
  border-color: #388bfd;
}

/* Hardware Node Styling in Adaptive Diagram */
.context-draggable-node {
  background: #11151e;
  border: 1px solid #252e3e;
  border-radius: 0.625rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  user-select: none;
}

.context-draggable-node:hover {
  border-color: #4b5e7d;
  transform: translateY(-1px);
}

/* Glowing Node Highlight States when signals hit */
.node-active {
  border-color: #a855f7 !important;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.6) !important;
}

.node-active-emerald {
  border-color: #10b981 !important;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.6) !important;
}

.node-active-purple {
  border-color: #c084fc !important;
  box-shadow: 0 0 20px rgba(192, 132, 252, 0.6) !important;
}

.node-active-blue {
  border-color: #60a5fa !important;
  box-shadow: 0 0 20px rgba(96, 165, 250, 0.6) !important;
}

.node-active-cyan {
  border-color: #22d3ee !important;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.6) !important;
}

.node-active-amber {
  border-color: #fbbf24 !important;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.6) !important;
}

.node-active-rose {
  border-color: #fb7185 !important;
  box-shadow: 0 0 20px rgba(251, 113, 133, 0.6) !important;
}

/* FSM State Badge */
.fsm-state-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.25s ease;
}

.fsm-state-badge.state-continue {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.fsm-state-badge.state-context-switch {
  background: rgba(168, 85, 247, 0.25);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.55);
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.4);
  animation: pulse-switch 1.4s infinite;
}

.fsm-state-badge.state-hold-weak {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.fsm-state-badge.state-weak-rescue {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.55);
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.4);
  animation: pulse-rescue 1.2s infinite;
}

.fsm-state-badge.state-redirect {
  background: rgba(244, 63, 94, 0.2);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.45);
}

@keyframes pulse-rescue {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.04); }
}

@keyframes pulse-switch {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.04); }
}

.prompt-directive-box {
  background: #090d13;
  border: 1px solid #30363d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #58a6ff;
  border-radius: 0.375rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.75rem;
  line-height: 1.4;
  min-height: 52px;
}

.subcontext-pill {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 0.375rem;
  border: 1px solid #30363d;
  background: #161b22;
  color: #8b949e;
  font-family: ui-monospace, monospace;
  transition: all 0.2s ease;
}

.subcontext-pill.active {
  background: #1f6feb;
  color: #ffffff;
  border-color: #58a6ff;
  box-shadow: 0 0 10px rgba(88, 166, 255, 0.45);
  font-weight: 600;
}

.subcontext-pill.covered {
  background: rgba(35, 134, 54, 0.2);
  color: #3fb950;
  border-color: rgba(46, 160, 67, 0.4);
  text-decoration: line-through;
}
