/* Mention display styles */
.mention {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
  vertical-align: baseline;
  white-space: nowrap;
}

.mention--character {
  background-color: rgba(59, 130, 246, 0.1);
  color: rgb(59, 130, 246);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.mention--character:hover {
  background-color: rgba(59, 130, 246, 0.2);
}

.mention--location {
  background-color: rgba(16, 185, 129, 0.1);
  color: rgb(16, 185, 129);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.mention--location:hover {
  background-color: rgba(16, 185, 129, 0.2);
}

/* Mention avatar styles */
.mention-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.8);
  flex-shrink: 0;
}

.mention-avatar--placeholder {
  background-color: rgba(156, 163, 175, 0.4);
  border: 1px solid rgba(156, 163, 175, 0.6);
}

/* Dark theme avatar styles */
@media (prefers-color-scheme: dark) {
  .mention-avatar {
    border-color: rgba(0, 0, 0, 0.3);
  }
  
  .mention-avatar--placeholder {
    background-color: rgba(75, 85, 99, 0.6);
    border-color: rgba(75, 85, 99, 0.8);
  }
}

/* Tribute dropdown styles */
.tribute-container {
  position: absolute;
  z-index: 999999;
  background-color: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  max-height: 200px;
  overflow-y: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.tribute-container ul {
  margin: 0;
  padding: 4px 0;
  list-style: none;
}

.tribute-container li {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.4;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
}

.tribute-container li:last-child {
  border-bottom: none;
}

.tribute-container li.highlight,
.tribute-container li:hover {
  background-color: #f3f4f6;
  color: #1f2937;
}

.tribute-no-match {
  padding: 8px 12px;
  font-size: 14px;
  color: #6b7280;
  font-style: italic;
}

/* Action Text attachment styles in editor */
action-text-attachment {
  display: inline !important;
}

/* Ensure mentions render inline in rich text */
trix-editor action-text-attachment {
  display: inline !important;
}

/* Ensure mentions render inline when displayed */
.rich-text-content action-text-attachment {
  display: inline !important;
}

/* Force figure elements containing mentions to display inline */
trix-editor figure[data-trix-attachment] {
  display: inline !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Ensure attachment content displays inline */
trix-editor .attachment.attachment--content {
  display: inline !important;
}

/* Hide empty figcaptions for mentions */
trix-editor figure[data-trix-attachment] figcaption.attachment__caption {
  display: none !important;
}

/* Rich text editor styles */
trix-editor {
  min-height: 120px;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background-color: white;
}

trix-editor:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
  .tribute-container {
    background-color: #1f2937;
    border-color: #374151;
  }
  
  .tribute-container li {
    color: #e5e7eb;
    border-bottom-color: #374151;
  }
  
  .tribute-container li.highlight,
  .tribute-container li:hover {
    background-color: #374151;
    color: #f9fafb;
  }
  
  .tribute-no-match {
    color: #9ca3af;
  }
  
  trix-editor {
    background-color: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
  }
  
  trix-editor:focus {
    border-color: #3b82f6;
  }
}