/* Loop Simulator Styles — Agents on Loop */
.loop-simulator-wrap {
  width: 100%;
  max-width: 1000px;
  margin: 2.5rem auto 1rem;
  background: rgba(7, 23, 32, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 240, 170, 0.08);
  overflow: hidden;
  font-family: inherit;
  color: #e6f0f2;
}

/* Header bar */
.sim-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.sim-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sim-status-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #29e09d;
  background: rgba(41, 224, 157, 0.12);
  border: 1px solid rgba(41, 224, 157, 0.25);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
}

.sim-status-live::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #29e09d;
  box-shadow: 0 0 8px #29e09d;
  animation: sim-pulse 2s infinite;
}

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

.sim-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.25rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  gap: 0.25rem;
}

.sim-tab-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.sim-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.sim-tab-btn.is-active {
  background: rgba(41, 224, 157, 0.18);
  color: #29e09d;
  box-shadow: inset 0 0 0 1px rgba(41, 224, 157, 0.3);
}

/* Stepper Bar */
.sim-stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sim-step-node {
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.sim-step-node:last-child {
  border-right: none;
}

.sim-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sim-step-node.is-current {
  color: #ffffff;
  background: rgba(41, 224, 157, 0.05);
}

.sim-step-node.is-current .sim-step-num {
  background: #29e09d;
  color: #04151c;
}

.sim-step-node.is-done {
  color: rgba(255, 255, 255, 0.8);
}

.sim-step-node.is-done .sim-step-num {
  background: rgba(41, 224, 157, 0.3);
  color: #29e09d;
}

/* Simulation Stage / Split Screen */
.sim-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 380px;
  background: radial-gradient(circle at 80% 20%, rgba(41, 224, 157, 0.04) 0%, transparent 60%);
}

@media (max-width: 768px) {
  .sim-body {
    grid-template-columns: 1fr;
  }
  .sim-stepper {
    grid-template-columns: repeat(2, 1fr);
  }
  .sim-step-node:nth-child(2) {
    border-right: none;
  }
}

/* Left Pane: Inbound Event & AI Reasoning */
.sim-pane {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
}

.sim-pane-left {
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sim-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #29e09d;
  margin-bottom: 0.5rem;
}

.sim-event-card {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.15rem;
  margin-bottom: 1.25rem;
  position: relative;
}

.sim-event-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  font-size: 0.8rem;
}

.sim-badge-source {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-weight: 600;
  color: #b0d0d8;
}

.sim-time-tag {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.75rem;
}

.sim-event-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.4rem;
}

.sim-event-body {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.45;
}

/* AI Triage Tags */
.sim-extraction-box {
  margin-top: auto;
}

.sim-extraction-title {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}

.sim-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.sim-chip {
  background: rgba(41, 224, 157, 0.08);
  border: 1px solid rgba(41, 224, 157, 0.2);
  color: #bcefe0;
  font-size: 0.78rem;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-family: monospace;
}

/* Right Pane: Mission Control Approval */
.sim-pane-right {
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}

.sim-mc-card {
  background: rgba(14, 34, 46, 0.8);
  border: 1px solid rgba(41, 224, 157, 0.25);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
  position: relative;
}

.sim-mc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.sim-mc-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffaa00;
  background: rgba(255, 170, 0, 0.12);
  border: 1px solid rgba(255, 170, 0, 0.25);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.sim-mc-status.is-approved {
  color: #29e09d;
  background: rgba(41, 224, 157, 0.15);
  border-color: rgba(41, 224, 157, 0.3);
}

.sim-risk-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  color: #b0d0d8;
}

.sim-mc-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.4rem;
}

.sim-mc-draft {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.85rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.45;
  margin-bottom: 1rem;
  white-space: pre-line;
}

.sim-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.sim-btn-approve {
  background: #29e09d;
  color: #04151c;
  border: none;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(41, 224, 157, 0.25);
  position: relative;
}

.sim-btn-approve:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(41, 224, 157, 0.4);
}

.sim-btn-approve.clicked {
  background: #1cb57b;
  transform: scale(0.97);
}

.sim-sla-note {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Animated simulated cursor */
.sim-cursor {
  position: absolute;
  width: 20px;
  height: 20px;
  pointer-events: none;
  z-index: 20;
  transition: all 0.7s cubic-bezier(0.25, 1, 0.5, 1);
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5));
}

.sim-cursor svg {
  width: 100%;
  height: 100%;
  fill: #ffffff;
}

/* Confirmation Footer Toast */
.sim-footer-toast {
  padding: 0.85rem 1.5rem;
  background: rgba(0, 0, 0, 0.45);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.7);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sim-audit-code {
  font-family: monospace;
  color: #29e09d;
  background: rgba(41, 224, 157, 0.1);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.sim-playback-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sim-playback-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s;
}

.sim-playback-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}
