/* AI Maestro — Coworker Mode Styles  ·  Void Terminal */

/* ── Coworker Progress Bar ──────────────────────────────────── */
.coworker-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  background: rgba(74,158,255,0.03);
  border-bottom: 1px solid var(--color-border);
  font-size: 0.75rem;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
  position: relative;
  transition: max-height 0.22s ease, opacity 0.22s ease;
  overflow: hidden;
}
.coworker-bar:not(.visible) {
  max-height: 0 !important; opacity: 0;
  padding-top: 0; padding-bottom: 0; margin: 0;
}
.coworker-bar.visible { max-height: 60px; opacity: 1; }
.coworker-bar::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    rgba(122,219,122,0.025) 0%,
    rgba(232,168,124,0.025) 100%);
  pointer-events: none;
}
.coworker-bar::-webkit-scrollbar { display: none; }

.coworker-bar-title {
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.10em; color: var(--color-text-muted);
  white-space: nowrap; margin-right: 6px;
}

.cw-step {
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap; padding: 4px 10px;
  border-radius: 18px; border: 1px solid transparent;
  transition: all 0.3s ease;
}
.cw-step.active {
  background: rgba(255,255,255,0.04);
  border-color: var(--color-border);
}
.cw-step.complete {
  background: rgba(52,199,100,0.06);
  border-color: rgba(52,199,100,0.2);
}

/* Claude — visually distinct as Lead */
#cwstep-claude {
  padding: 5px 14px; border-radius: 22px; font-size: 0.78rem;
}
#cwstep-claude.synthesizing {
  background: linear-gradient(135deg,
    rgba(232,168,124,0.10) 0%,
    rgba(232,168,124,0.04) 100%);
  border-color: rgba(232,168,124,0.35);
  box-shadow: 0 0 18px rgba(232,168,124,0.12), inset 0 0 12px rgba(232,168,124,0.04);
  animation: cwStepGlow 2s ease-in-out infinite;
}
#cwstep-claude.complete {
  background: rgba(232,168,124,0.06);
  border-color: rgba(232,168,124,0.25);
}
@keyframes cwStepGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(232,168,124,0.12), inset 0 0 8px rgba(232,168,124,0.03); }
  50%       { box-shadow: 0 0 28px rgba(232,168,124,0.28), inset 0 0 16px rgba(232,168,124,0.07); }
}

/* ── Status Dots ─────────────────────────────────────────────── */
.cw-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--color-border); flex-shrink: 0;
  transition: background 0.4s ease, transform 0.3s ease;
}
.cw-dot.idle    { background: var(--color-border-strong); }
.cw-dot.waiting { background: var(--color-text-muted); }
.cw-dot.working {
  background: var(--color-warning);
  animation: cwPulse 1.1s ease-in-out infinite;
  box-shadow: 0 0 7px rgba(240,165,0,0.6);
}
.cw-dot.done {
  background: var(--color-success);
  box-shadow: 0 0 6px rgba(52,199,100,0.5);
}
.cw-dot.lead-working {
  background: var(--color-accent-claude);
  animation: cwBreathe 2s ease-in-out infinite;
  box-shadow: 0 0 12px rgba(232,168,124,0.8);
  width: 9px; height: 9px;
}
@keyframes cwPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}
@keyframes cwBreathe {
  0%, 100% { opacity: 1; transform: scale(1);    box-shadow: 0 0 8px  rgba(232,168,124,0.6); }
  50%       { opacity: 0.7; transform: scale(1.5); box-shadow: 0 0 22px rgba(232,168,124,1.0); }
}

/* ── Flow Arrows ─────────────────────────────────────────────── */
.cw-arrow {
  color: var(--color-border);
  font-size: 0.9rem; flex-shrink: 0;
  transition: color 0.5s ease;
  letter-spacing: -0.05em;
}
.cw-arrow.active  { color: var(--color-text-muted); }
.cw-arrow.flowing { animation: cwFlow 1.4s ease-in-out infinite; }
@keyframes cwFlow {
  0%   { color: var(--color-border); text-shadow: none; }
  50%  { color: var(--color-accent-claude); text-shadow: 0 0 8px rgba(232,168,124,0.8); }
  100% { color: var(--color-text-muted); text-shadow: none; }
}

/* ── Labels / Stats ──────────────────────────────────────────── */
.cw-label { font-weight: 700; font-size: 0.75rem; letter-spacing: 0.03em; }
.cw-role  { font-size: 0.62rem; color: var(--color-text-muted); font-style: italic; }
.cw-stat  {
  font-size: 0.63rem; color: var(--color-text-muted);
  background: rgba(255,255,255,0.04);
  padding: 1px 6px; border-radius: 9px; min-width: 44px;
  text-align: center; transition: all 0.3s ease; letter-spacing: 0.02em;
}
.cw-stat.done-stat  { color: var(--color-success); background: rgba(52,199,100,0.08); }
.cw-stat.synth-stat {
  color: var(--color-accent-claude); background: rgba(232,168,124,0.08);
  animation: cwPulse 1.5s ease-in-out infinite;
}

/* ── Synthesis header in Claude pane ────────────────────────── */
.synthesis-section-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0 8px; margin: 16px 0 4px;
  border-top: 1px solid rgba(232,168,124,0.2);
  color: var(--color-accent-claude); font-size: 0.75rem;
  font-weight: 700; letter-spacing: 0.10em; text-transform: uppercase;
  animation: fadeIn 0.4s ease both;
}
.synthesis-section-header::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(232,168,124,0.35), transparent);
}
.synth-icon {
  font-size: 0.85rem; animation: cwBreathe 2s ease-in-out infinite; display: inline-block;
}

/* ── Pane states during synthesis ───────────────────────────── */
.response-pane.synthesizing {
  border-left: 2px solid rgba(232,168,124,0.5) !important;
  box-shadow: -4px 0 20px rgba(232,168,124,0.10) !important;
  transition: border-left 0.4s ease, box-shadow 0.4s ease;
}

/* ── Tab role badges ─────────────────────────────────────────── */
.tab-role-badge {
  display: inline-block; font-size: 0.55rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 1px 5px; border-radius: 7px; margin-left: 4px;
  vertical-align: middle; opacity: 0; transition: opacity 0.3s ease;
}
.tab-role-badge.visible  { opacity: 1; }
.tab-role-badge.analyst  { background: rgba(122,219,122,0.12); color: var(--color-accent-gemini); }
.tab-role-badge.reviewer { background: rgba(125,180,255,0.12); color: var(--color-accent-openai); }
.tab-role-badge.lead     { background: rgba(232,168,124,0.12); color: var(--color-accent-claude); }

/* ── Execution Plan TODO Panel (Codex-style progress) ──────── */
.execution-plan-panel {
  background: var(--color-bg-secondary, #161b22);
  border: 1px solid var(--color-border, #30363d);
  border-radius: 10px;
  padding: 14px 16px 10px;
  margin: 8px 12px;
  animation: fadeIn 0.3s ease both;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}
.execution-plan-panel.hidden { display: none; }

.exec-plan-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.exec-plan-title {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--color-text-muted, #8b949e);
}
.exec-plan-counter {
  font-size: 0.65rem; color: var(--color-text-muted, #8b949e);
  background: rgba(255,255,255,0.04);
  padding: 1px 8px; border-radius: 9px;
  margin-left: auto;
}
.exec-plan-phase {
  font-size: 0.58rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.10em; padding: 2px 8px; border-radius: 9px;
}
.exec-plan-phase.phase-planned {
  color: var(--color-text-muted, #8b949e);
  background: rgba(255,255,255,0.04);
}
.exec-plan-phase.phase-executing {
  color: var(--color-accent-claude, #d4a574);
  background: rgba(232,168,124,0.10);
  animation: cwPulse 2s ease-in-out infinite;
}
.exec-plan-phase.phase-complete {
  color: var(--color-success, #34c764);
  background: rgba(52,199,100,0.10);
}

/* ── Progress Bar ───────────────────────────────────────────── */
.exec-progress-bar-wrap {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  margin: 6px 0 10px;
  overflow: hidden;
  position: relative;
}
.exec-progress-bar {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--color-accent-claude, #d4a574), var(--color-warning, #d29922));
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}
.exec-progress-bar.active {
  background: linear-gradient(90deg, var(--color-accent-claude, #d4a574), var(--color-warning, #d29922));
  box-shadow: 0 0 8px rgba(232,168,124,0.4);
}
.exec-progress-bar.active::after {
  content: '';
  position: absolute; right: 0; top: 0; bottom: 0; width: 24px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25));
  animation: progressShimmer 1.5s ease-in-out infinite;
}
@keyframes progressShimmer {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 1; }
}
.exec-progress-bar.complete {
  background: linear-gradient(90deg, var(--color-success, #34c764), #58d68d);
  box-shadow: 0 0 10px rgba(52,199,100,0.35);
}

/* ── TODO List ──────────────────────────────────────────────── */
.todo-list {
  list-style: none; padding: 0; margin: 0;
  max-height: 280px; overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.todo-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.76rem; color: var(--color-text, #e0e0e6);
  transition: all 0.3s ease;
  border-radius: 4px;
}
.todo-item:last-child { border-bottom: none; }

.todo-step-num {
  font-size: 0.58rem; font-weight: 700; color: var(--color-text-muted, #8b949e);
  min-width: 16px; text-align: center; flex-shrink: 0;
  opacity: 0.5;
}

.todo-status-icon {
  font-family: monospace; font-size: 1rem;
  flex-shrink: 0; width: 18px; text-align: center;
}
.todo-priority {
  font-size: 0.60rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 1px 6px; border-radius: 4px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.05);
}
.todo-priority.priority-high {
  color: var(--color-error, #f85149);
  background: rgba(248,81,73,0.10);
}
.todo-priority.priority-medium {
  color: var(--color-warning, #d29922);
  background: rgba(210,153,34,0.10);
}
.todo-priority.priority-low {
  color: var(--color-text-muted, #8b949e);
  background: rgba(255,255,255,0.04);
}
.todo-title { flex: 1; line-height: 1.3; }
.todo-src {
  font-size: 0.55rem; opacity: 0.4; flex-shrink: 0;
  font-weight: 600;
}

/* ── TODO States ────────────────────────────────────────────── */
.todo-item.todo-pending .todo-status-icon { color: var(--color-text-muted, #8b949e); }
.todo-item.todo-pending .todo-step-num { opacity: 0.35; }

.todo-item.todo-in-progress {
  background: rgba(232,168,124,0.06);
  border-radius: 6px;
  padding-left: 8px;
  border-left: 2px solid var(--color-accent-claude, #d4a574);
}
.todo-item.todo-in-progress .todo-status-icon {
  color: var(--color-accent-claude, #d4a574);
  animation: cwPulse 1.2s ease-in-out infinite;
}
.todo-item.todo-in-progress .todo-step-num {
  color: var(--color-accent-claude, #d4a574);
  opacity: 1;
}
.todo-item.todo-in-progress .todo-title {
  color: #fff;
  font-weight: 500;
}

.todo-item.todo-done {
  opacity: 0.45;
}
.todo-item.todo-done .todo-title {
  text-decoration: line-through;
}
.todo-item.todo-done .todo-status-icon {
  color: var(--color-success, #34c764);
}
.todo-item.todo-done .todo-step-num {
  color: var(--color-success, #34c764);
  opacity: 0.7;
}

/* ── AI Activity Panel ──────────────────────────────────────── */
.ai-activity-panel {
  margin: 6px 12px 4px;
  padding: 8px 14px;
  background: var(--color-bg-secondary, #12121a);
  border: 1px solid var(--color-border, rgba(255,255,255,0.08));
  border-radius: 8px;
  font-size: 0.78rem;
}
.ai-activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ai-activity-title {
  font-weight: 600;
  font-size: 0.72rem;
  color: var(--color-text-muted, #8b949e);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ai-activity-summary {
  font-size: 0.68rem;
  color: var(--color-text-muted, #8b949e);
  padding: 1px 8px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
}
.ai-activity-agents {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ai-activity-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.2s ease;
}
.ai-activity-row:hover {
  background: rgba(255,255,255,0.03);
}
.ai-activity-row[data-state="working"] {
  background: rgba(255,255,255,0.04);
}

/* Activity dot */
.ai-act-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.25s ease;
}
.ai-act-dot.idle {
  background: var(--color-text-muted, #8b949e);
  opacity: 0.4;
}
.ai-act-dot.working {
  animation: activityPulse 1.2s ease-in-out infinite;
}
.ai-act-dot.done {
  background: var(--color-success, #3fb950);
  box-shadow: 0 0 6px rgba(63,185,80,0.4);
}
.ai-act-dot.error {
  background: var(--color-error, #f85149);
  box-shadow: 0 0 6px rgba(248,81,73,0.4);
}
/* Agent-specific working dot colors */
.ai-activity-row[data-agent="claude"] .ai-act-dot.working {
  background: var(--color-accent-claude, #d4a574);
  box-shadow: 0 0 8px rgba(212,165,116,0.5);
}
.ai-activity-row[data-agent="gemini"] .ai-act-dot.working {
  background: var(--color-accent-gemini, #a3e635);
  box-shadow: 0 0 8px rgba(163,230,53,0.5);
}
.ai-activity-row[data-agent="openai"] .ai-act-dot.working {
  background: var(--color-accent-openai, #74b9ff);
  box-shadow: 0 0 8px rgba(116,185,255,0.5);
}

@keyframes activityPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.75); }
}

/* Agent name */
.ai-act-name {
  font-weight: 600;
  font-size: 0.76rem;
  min-width: 52px;
  flex-shrink: 0;
}

/* Activity description */
.ai-act-activity {
  flex: 1;
  color: var(--color-text-muted, #8b949e);
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}
.ai-activity-row[data-state="working"] .ai-act-activity {
  color: var(--color-text, #e0e0e6);
}

/* State badge */
.ai-act-state {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 7px;
  border-radius: 10px;
  flex-shrink: 0;
  min-width: 44px;
  text-align: center;
}
.ai-act-state.idle {
  color: var(--color-text-muted, #8b949e);
  background: rgba(255,255,255,0.04);
}
.ai-act-state.working {
  color: #fff;
  background: rgba(88,166,255,0.18);
  animation: stateBadgePulse 2s ease-in-out infinite;
}
.ai-act-state.done {
  color: var(--color-success, #3fb950);
  background: rgba(63,185,80,0.12);
}
.ai-act-state.error {
  color: var(--color-error, #f85149);
  background: rgba(248,81,73,0.12);
}

@keyframes stateBadgePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

/* Elapsed time */
.ai-act-elapsed {
  font-size: 0.6rem;
  color: var(--color-text-muted, #8b949e);
  opacity: 0.6;
  min-width: 30px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .coworker-bar { padding: 5px 10px; font-size: 0.7rem; gap: 5px; }
  .coworker-bar-title { display: none; }
  .cw-step { padding: 3px 7px; gap: 4px; }
  .cw-role  { display: none; }
  .cw-stat  { font-size: 0.6rem; min-width: 34px; padding: 1px 4px; }
  .cw-dot   { width: 6px; height: 6px; }
  .execution-plan-panel { margin: 4px 8px; padding: 8px 12px; }
  .todo-item { font-size: 0.72rem; gap: 6px; }
  .ai-activity-panel { margin: 4px 8px; padding: 6px 10px; }
  .ai-act-name { min-width: 40px; font-size: 0.7rem; }
  .ai-act-elapsed { display: none; }
}
