/* Coach chat — net-new elements not already covered by main.css's
   .coach-chat-area / .chat-message / .chat-bubble / .mood-* rules. */

.chat-transcript {
  max-height: 60vh;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.chat-message-body { flex: 1; min-width: 0; }

.chat-message[data-role="user"] .chat-message-body { display: flex; flex-direction: column; align-items: flex-end; }
[dir="rtl"] .chat-message[data-role="user"] .chat-message-body { align-items: flex-start; }

.chat-mood-picker { margin-bottom: 4px; }

.chat-bubble.pending { opacity: 0.55; }
.chat-bubble.failed {
  border: 1.5px solid #E85D5D;
  cursor: pointer;
}

.chat-bubble-image { padding: 6px; }
.chat-image-thumb {
  display: block;
  max-width: 200px;
  max-height: 200px;
  border-radius: calc(var(--radius-md) - 4px);
}
.chat-image-caption { padding: 6px 4px 2px; font-size: 13px; }

.chat-typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px 4px 10px 42px;
}
[dir="rtl"] .chat-typing-indicator { padding: 4px 42px 10px 4px; }
.chat-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: chatTypingBounce 1.2s infinite ease-in-out;
}
.chat-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.chat-typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes chatTypingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chat-attachment-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 6px;
  background: var(--section-bg);
  border-radius: var(--radius-md);
}
.chat-attachment-preview img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.chat-attachment-remove {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
[dir="rtl"] .chat-attachment-remove { margin-left: 0; margin-right: auto; }

.chat-recording-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--section-bg);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-secondary);
}
.chat-rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #E85D5D;
  animation: chatRecPulse 1s infinite;
}
@keyframes chatRecPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.chat-rec-stop {
  margin-left: auto;
  border: none;
  background: var(--accent-primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
}
[dir="rtl"] .chat-rec-stop { margin-left: 0; margin-right: auto; }

.chat-typing-indicator[hidden],
.chat-attachment-preview[hidden],
.chat-recording-indicator[hidden] { display: none; }

.chat-icon-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.chat-icon-btn:active { transform: scale(0.92); }
.chat-icon-btn.active { color: #E85D5D; background: rgba(232,93,93,0.12); }
.chat-icon-btn svg { width: 17px; height: 17px; }
