/* ============================================================
 *  Peerly — Vue Chat
 *  v8.1.0 — plus de max-width, radius généreux
 * ============================================================ */

/* ---- Header ---- */
.chat-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--header-height);
  padding: 0 var(--space-5);
  border-bottom: 1px solid var(--md-outline-variant);
  background: var(--md-surface);
  flex-shrink: 0;
}

.chat-header-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  justify-content: center;
  flex: 1;
}
.chat-header-name {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  color: var(--md-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-header-status {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-wide);
  color: var(--md-outline);
}

.chat-call-actions {
  display: flex;
  gap: var(--space-1);
  flex-shrink: 0;
}

/* ---- Zone messages ---- */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  scroll-behavior: smooth;
  background: var(--md-surface);
  transition: margin-top var(--duration-slow) var(--ease-out);
}

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--md-outline);
  font-size: var(--text-md);
  text-align: center;
  padding: var(--space-8);
  gap: var(--space-2);
}
.chat-hint {
  font-size: var(--text-xs);
  color: var(--md-outline);
}

.chat-messages.drag-over {
  background: var(--md-primary-soft);
  outline: 2px dashed var(--md-primary);
  outline-offset: -10px;
  border-radius: var(--radius-lg);
}

/* ---- Réponse ---- */
.reply-preview-bar {
  display: none;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--md-surface-container);
  border-top: 1px solid var(--md-outline-variant);
  border-left: 3px solid var(--md-primary);
}
.reply-preview-bar.visible { display: flex; }

.reply-preview-content {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: var(--space-3);
  align-items: center;
}
.reply-preview-accent {
  width: 3px;
  height: 26px;
  border-radius: 2px;
  background: var(--md-primary);
  flex-shrink: 0;
}
.reply-preview-texts {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
}
.reply-preview-name {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--md-primary);
}
.reply-preview-text {
  font-size: var(--text-xs);
  color: var(--md-on-surface-variant);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reply-preview-close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--md-outline);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.reply-preview-close:hover {
  background: var(--md-surface-container-high);
  color: var(--md-on-surface);
}
.reply-preview-close i { font-size: 15px; line-height: 1; }

/* ---- Input bar ---- */
.chat-input-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--md-outline-variant);
  background: var(--md-surface);
  flex-shrink: 0;
  min-height: 60px;
}

.chat-input-bar input[type="text"] {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--md-surface-container);
  border: 1px solid transparent;
}
.chat-input-bar input[type="text"]:focus {
  border-color: var(--md-primary);
  background: var(--md-surface-container-high);
}

/* ---- Boutons attach/voice ---- */
.btn-attach,
.btn-voice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--md-on-surface-variant);
  font-size: 18px;
  flex-shrink: 0;
  transition: all var(--duration-fast) var(--ease-out);
  cursor: pointer;
  border: none;
}
.btn-attach:hover:not(:disabled),
.btn-voice:hover:not(:disabled) {
  background: var(--md-surface-container-high);
  color: var(--md-on-surface);
}
.btn-attach:disabled,
.btn-voice:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.btn-attach i,
.btn-voice i { line-height: 1; }

/* ============================================================
 *  Recording
 * ============================================================ */
.chat-input-bar.recording > *:not(.voice-recorder-bar) {
  display: none !important;
}

/* ============================================================
 *  Responsive
 * ============================================================ */
@media (max-width: 599px) {
  .chat-header { padding: 0 var(--space-3); gap: var(--space-2); }
  .chat-messages { padding: var(--space-4) var(--space-3); }
  .chat-input-bar { padding: var(--space-2) var(--space-3); gap: var(--space-1); }
}