@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

.chat-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.chat-scrollbar::-webkit-scrollbar-track {
  background: #f1f3f5;
  border-radius: 10px;
}

.chat-scrollbar::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 10px;
}

.chat-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

.chat-input:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
}

/* Mention highlight inside messages */
.mention-highlight {
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background-color: rgba(0, 123, 255, 0.15);
  color: #0056b3;
  animation: mentionPulse 0.4s ease-in-out;
}

.is-mine .mention-highlight {
  background-color: #ffffffcc;
  color: #003a80;
}

@keyframes mentionPulse {
  from {
    transform: scale(0.96);
  }

  to {
    transform: scale(1);
  }
}

/* mention dropdown under input */
.mention-dropdown {
  position: absolute;
  bottom: 48px;
  /* just above the input */
  left: 0;
  right: 120px;
  /* leave space for Send button */
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  max-height: 200px;
  overflow-y: auto;
  z-index: 9999;
  padding: 4px 0;
}

.mention-item {
  padding: 6px 12px;
  font-size: 0.9rem;
  cursor: pointer;
}

.mention-item:hover {
  background: #f1f3f5;
}

/* participants bar & popover */

.chat-participants-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
}

.chat-participants-hover-area {
  position: relative;
  display: inline-block;
}

.chat-participants-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background-color: #f5f7fb;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.chat-participants-trigger:hover {
  background-color: #e9f0ff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.chat-group-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-group-avatar-icon {
  font-size: 0.95rem;
  color: #ffffff;
}

.chat-participants-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1f2933;
}

.chat-participants-popover {
  position: absolute;
  top: 110%;
  left: 0;
  z-index: 9999;
  width: 260px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
  padding: 8px;
}

.chat-participants-search-wrapper {
  padding: 4px 4px 6px 4px;
}

.chat-participants-search {
  width: 100%;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 4px 9px;
  font-size: 0.8rem;
  outline: none;
}

.chat-participants-search:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
}

.chat-participants-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 4px 2px 4px 2px;
}

.chat-participant-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px;
  border-radius: 8px;
  cursor: default;
}

.chat-participant-row:hover {
  background-color: #f5f7fb;
}

.chat-participant-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.chat-participant-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-participant-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-participant-email {
  font-size: 0.75rem;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-participants-empty {
  font-size: 0.8rem;
  color: #9ca3af;
  text-align: center;
  padding: 10px 0;
}

/* Utility: center content in modal when not participant / no messages */
.modal-full-center {
  width: 100%;
  height: 100%;
}

/* In chatModal.css */
.chat-input-mention-tag {
  background-color: #e0f7fa; /* Light cyan/blue background */
  color: #007bff; /* Primary blue text */
  padding: 2px 6px;
  border-radius: 4px;
  margin: 0 1px;
  font-weight: 500;
  display: inline-block; /* Essential for padding/margin to work */
  user-select: none; /* Prevents selecting only part of the name */
}