/* ═══════════════════════════════════════════════════
   TMR Component Styles — Message Types, HITL, etc.
   ═══════════════════════════════════════════════════ */

/* ═══ Animations ═══ */

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

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

/* ═══ Message Container ═══ */

.msg {
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  opacity: 0;
  transform: translateY(8px);
  animation: fadeUp 0.3s ease forwards;
}

/* ═══ 1. User Message ═══ */

.msg.user { justify-content: flex-end; }

.msg.user .bubble {
  background: var(--accent);
  color: white;
  padding: 10px 14px;
  border-radius: 14px 14px 4px 14px;
  font-size: 14px;
  line-height: 1.5;
  max-width: 75%;
}

/* ═══ 2. Agent Text ═══ */

.avatar {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: white; flex-shrink: 0;
  margin-top: 2px;
}

.agent-content { flex: 1; min-width: 0; }

.bubble.agent {
  background: transparent;
  padding: 6px 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

/* ═══ 3. Status (pulsing dot) ═══ */

.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text2);
}

.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s ease infinite;
  flex-shrink: 0;
}

/* ═══ 4. Status Update (green dot, no animation) ═══ */

.status-line.done .status-dot {
  background: var(--green);
  animation: none;
}

/* ═══ 5. Thinking (italic gray) ═══ */

.thinking {
  font-size: 13px;
  color: var(--text3);
  font-style: italic;
  padding: 4px 0;
}

/* ═══ 6. HITL Inline — Quick checkpoint ═══ */

.hitl-inline {
  background: var(--accent-light);
  border: 1px solid rgba(124, 92, 252, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 6px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hitl-inline-text {
  font-size: 13px;
  color: var(--text2);
  flex: 1;
  min-width: 200px;
}

.hitl-inline-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.hitl-inline-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}

.hitl-inline-btn.go {
  background: rgba(124, 92, 252, 0.15);
  color: var(--accent);
}
.hitl-inline-btn.go:hover {
  background: rgba(124, 92, 252, 0.25);
}

.hitl-inline-btn.alt {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text3);
}
.hitl-inline-btn.alt:hover {
  background: var(--bg3);
  color: var(--text2);
}

/* ═══ 7. HITL Smart — Data review checkpoint ═══ */

.hitl-smart {
  background: var(--bg2);
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 8px 0;
}

.hitl-smart .hitl-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.hitl-smart .hitl-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--blue);
}

/* ═══ 8. HITL Required — Critical approval ═══ */

.hitl-required {
  background: var(--bg2);
  border: 1px solid rgba(217, 119, 6, 0.4);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 8px 0;
}

.hitl-required .hitl-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.hitl-required .hitl-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 6px rgba(217, 119, 6, 0.5);
}

/* ═══ HITL Shared Styles ═══ */

.hitl-body {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 10px;
}

.hitl-preview {
  background: var(--bg3);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text2);
  margin-bottom: 10px;
  border-left: 3px solid var(--accent);
}

.hitl-preview em { color: var(--text); font-style: normal; font-weight: 500; }

.hitl-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.hitl-btn {
  padding: 7px 16px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}

.hitl-btn.yes { background: var(--green); color: white; }
.hitl-btn.yes:hover { background: #15803d; }
.hitl-btn.primary { background: var(--accent); color: white; }
.hitl-btn.primary:hover { background: var(--accent2); }
.hitl-btn.review { background: transparent; border: 1px solid var(--border); color: var(--text2); }
.hitl-btn.review:hover { background: var(--bg3); color: var(--text); }

.hitl-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Mini profile cards */

.mini-profiles {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.mini-profile {
  background: var(--bg3);
  border-radius: 8px;
  padding: 10px 12px;
  min-width: 155px;
  flex-shrink: 0;
}

.mini-profile-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.mini-profile-title {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 4px;
}

.mini-profile-score {
  font-size: 10px;
  font-weight: 600;
  color: var(--green);
}

/* ═══ 9. Done Summary ═══ */

.done-block {
  background: var(--bg2);
  border: 1px solid rgba(22, 163, 74, 0.3);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 8px 0;
}

.done-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 10px;
}

.done-stat { text-align: center; }
.done-num { font-size: 20px; font-weight: 700; color: var(--text); }
.done-label { font-size: 11px; color: var(--text3); margin-top: 2px; }

.done-text {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
}

/* ═══ 10. Suggestion ═══ */

.suggestion {
  background: var(--accent-light);
  border: 1px solid rgba(124, 92, 252, 0.2);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 8px 0;
}

.suggestion-text {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
  margin-bottom: 10px;
}

.suggestion-actions { display: flex; gap: 8px; }

/* ═══ Supervision Mode Toggle ═══ */

.supervision {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text3);
  font-weight: 400;
}

.supervision-toggle {
  display: flex;
  background: var(--bg3);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.supervision-opt {
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text3);
  transition: all 0.2s;
  border: none;
  background: transparent;
  letter-spacing: 0.3px;
}

.supervision-opt.active {
  background: var(--accent);
  color: white;
}

.supervision-opt:hover:not(.active) {
  color: var(--text2);
  background: var(--bg4);
}

/* ═══ Auto-approved badge ═══ */

.auto-skipped {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text3);
  padding: 3px 0;
  font-style: italic;
}

.auto-skipped::before {
  content: '~';
  font-style: normal;
}

/* ═══ HITL Stats Line ═══ */

.hitl-stats {
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 10px;
}
