/* SuperAgents — superagents-chat.css
 * Module : chat
 * Généré depuis index.html
 */

/* ── CHAT HEADER ────────────────────────── */
.chat-header {
  padding: 14px 24px; background: rgba(255,255,255,0.88);
  backdrop-filter: blur(20px); border-bottom: 1px solid var(--zen-border);
  display: flex; align-items: center; gap: 14px; z-index: 10;
}
.chat-agent-avatar {
  width: 46px; height: 46px; border-radius: 14px;
  object-fit: cover; border: 2px solid var(--zen-primary-light);
}
.chat-agent-avatar-placeholder {
  width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; color: #fff;
  position: relative; flex-shrink: 0;
}
.chat-agent-editable { cursor: pointer; }
.chat-agent-editable:hover h2 { color: var(--zen-primary-dark); }
.avatar-edit-overlay {
  position: absolute; inset: 0; border-radius: 14px;
  background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center;
  font-size: 18px; opacity: 0; transition: opacity 0.2s;
}
.chat-agent-editable:hover .avatar-edit-overlay { opacity: 1; }
.chat-agent-info h2 { font-size: 18px; font-weight: 700; color: var(--zen-text); transition: color 0.2s; }
.chat-agent-info p { font-size: 11.5px; color: var(--zen-text-muted); font-weight: 500; }
.chat-header-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.header-btn {
  padding: 7px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--zen-border); background: var(--zen-surface);
  color: var(--zen-text-secondary); font-size: 11.5px; font-weight: 600;
  cursor: pointer; transition: var(--transition); display: flex; align-items: center; gap: 5px;
}
.header-btn:hover {
  background: var(--zen-surface-hover); border-color: var(--zen-primary);
  color: var(--zen-primary-dark);
}
.header-btn-new {
  background: linear-gradient(135deg, var(--zen-primary), var(--zen-primary-dark)) !important;
  color: #fff !important; border-color: var(--zen-primary) !important;
}
.header-btn-new:hover {
  transform: translateY(-1px); box-shadow: 0 4px 12px var(--zen-shadow-strong);
}
.conv-count-badge {
  font-size: 11px; font-weight: 700; color: var(--zen-primary-dark);
  background: rgba(45,212,168,0.12); padding: 1px 7px; border-radius: 8px;
  margin-left: 4px;
}

/* Conversation picker (inside media modal) */
.conv-picker-wrap {
  background: var(--zen-surface); border-radius: 16px;
  padding: 24px; min-width: 340px; max-width: 520px; width: 90vw;
  max-height: 70vh; display: flex; flex-direction: column;
  box-shadow: 0 12px 50px rgba(0,0,0,0.3);
}
.conv-picker-wrap h3 { font-size: 18px; font-weight: 800; margin-bottom: 14px; }
.conv-picker-list {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
}
.conv-picker-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-md);
  border: 1px solid var(--zen-border); cursor: pointer;
  transition: var(--transition);
}
.conv-picker-item:hover { border-color: var(--zen-primary); background: rgba(45,212,168,0.04); }
.conv-picker-item.active { border-color: var(--zen-primary); background: rgba(45,212,168,0.08); }
.conv-picker-info { flex: 1; min-width: 0; }
.conv-picker-title {
  font-size: 12.5px; font-weight: 600; color: var(--zen-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conv-picker-meta { font-size: 10.5px; color: var(--zen-text-muted); margin-top: 2px; }
.conv-picker-active { color: var(--zen-primary); font-size: 15px; }

/* ── CHAT MESSAGES ──────────────────────── */
.chat-messages {
  flex: 1; overflow-y: auto; padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
}
.chat-messages::-webkit-scrollbar { width: 5px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--zen-border); border-radius: 5px; }

.message {
  display: flex; gap: 10px; max-width: 78%;
  animation: msgSlide 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes msgSlide {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.message.agent { align-self: flex-start; }
.message.user { align-self: flex-end; flex-direction: row-reverse; }

.msg-avatar {
  width: 32px; height: 32px; border-radius: 10px;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff; overflow: hidden;
}
.msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.message.user .msg-avatar { border-radius: 50%; }

.message-bubble {
  padding: 12px 16px; border-radius: var(--radius-lg);
  font-size: 13.5px; line-height: 1.65; position: relative;
  overflow-wrap: break-word; word-break: break-word; min-width: 0; overflow: hidden;
}
.message.agent .message-bubble {
  background: var(--zen-surface); border: 1px solid var(--zen-border);
  border-top-left-radius: 5px; box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}
.message.user .message-bubble {
  background: #fff; border: 1px solid var(--zen-border);
  color: var(--zen-text-primary); border-top-right-radius: 5px;
}
.message-time {
  font-size: 11px; color: var(--zen-text-muted); margin-top: 4px; text-align: right;
}
.message.user .message-time { color: var(--zen-text-muted); }
.message-bubble p { margin-bottom: 6px; }
.message-bubble p:last-child { margin-bottom: 0; }
.message-bubble strong { font-weight: 700; }
.message-bubble em { font-style: italic; }

/* Web search sources */
.web-sources {
  margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(0,0,0,0.06);
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
}
.web-sources-label {
  font-size: 11px; font-weight: 700; color: var(--zen-text-muted);
  margin-right: 2px;
}
.web-source-link {
  font-size: 10.5px; font-weight: 500; color: var(--zen-info);
  text-decoration: none; padding: 2px 7px; border-radius: 6px;
  background: rgba(54,184,224,0.08); border: 1px solid rgba(54,184,224,0.15);
  transition: var(--transition); white-space: nowrap;
  max-width: 200px; overflow: hidden; text-overflow: ellipsis;
  display: inline-block;
}
.web-source-link:hover {
  background: rgba(54,184,224,0.15); border-color: var(--zen-info);
  color: #0C7ABF;
}
.message-bubble code {
  background: rgba(0,0,0,0.05); padding: 1px 5px;
  border-radius: 4px; font-size: 12.5px;
}
.message.user .message-bubble code { background: rgba(0,0,0,0.06); }
.message-bubble pre {
  background: rgba(0,0,0,0.03); border: 1px solid var(--zen-border);
  border-radius: 8px; padding: 12px 14px; margin: 8px 0;
  white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere;
  font-size: 12.5px; line-height: 1.6; overflow-x: auto; max-width: 100%;
}
.message-bubble pre code {
  background: none; padding: 0; font-size: inherit;
}

/* Message action buttons */
.msg-actions {
  display: inline-flex; gap: 2px; margin-left: 6px; vertical-align: middle;
  opacity: 0; transition: opacity 0.15s;
}
.message:hover .msg-actions { opacity: 1; }
.msg-action-btn {
  width: 22px; height: 22px; border: 1px solid var(--zen-border); border-radius: 6px;
  background: var(--zen-card-bg); cursor: pointer; font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); transition: all 0.15s; padding: 0;
}
.msg-action-btn:hover { background: var(--zen-bg); border-color: var(--zen-primary); }

.typing-indicator { display: flex; gap: 5px; padding: 4px 0; }
.typing-indicator span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--zen-primary-light); animation: typBounce 1.4s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

/* ── STREAMING STATUS INDICATOR ──────────── */
.stream-status {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin-bottom: 6px;
  background: linear-gradient(135deg, rgba(45,212,168,0.06), rgba(54,184,224,0.06));
  border: 1px solid rgba(45,212,168,0.15); border-radius: var(--radius-md);
  font-size: 12.5px; font-weight: 600; color: var(--zen-primary-dark);
  animation: statusFadeIn 0.3s ease;
  transition: all 0.3s ease;
}
.stream-status-icon {
  width: 20px; height: 20px; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.spinner-sm {
  width: 16px; height: 16px;
  border: 2.5px solid rgba(45,212,168,0.2);
  border-top-color: var(--zen-primary);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes statusFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.typing-dots { display: inline-flex; gap: 3px; align-items: center; }
.typing-dots span { width: 5px; height: 5px; border-radius: 50%; background: #3B82F6; animation: typDotBounce 1.2s infinite ease-in-out; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typDotBounce { 0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1.1); } }

/* ── CHAT INPUT ─────────────────────────── */
.chat-input-area {
  padding: 14px 24px 20px; background: rgba(255,255,255,0.7);
  backdrop-filter: blur(20px); border-top: 1px solid var(--zen-border);
}
.chat-input-wrapper {
  display: flex; align-items: flex-end; gap: 10px;
  background: var(--zen-surface); border: 2px solid var(--zen-border);
  border-radius: var(--radius-lg); padding: 7px 10px;
  transition: var(--transition);
}
.chat-input-wrapper:focus-within {
  border-color: var(--zen-primary);
  box-shadow: 0 0 0 4px var(--zen-shadow);
}
.chat-input {
  flex: 1; border: none; outline: none; font-size: 13.5px;
  font-family: inherit; background: transparent; resize: none;
  min-height: 22px; max-height: 50vh; padding: 5px 0;
  line-height: 1.5; color: var(--zen-text);
}
.chat-input::placeholder { color: var(--zen-text-muted); }
.btn-send {
  width: 38px; height: 38px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--zen-primary), var(--zen-primary-dark));
  color: #fff; cursor: pointer; display: flex;
  align-items: center; justify-content: center; transition: var(--transition);
  flex-shrink: 0;
}
.btn-send:hover { transform: scale(1.06); box-shadow: 0 4px 14px var(--zen-shadow-strong); }
.btn-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

