/* Trix Editor Customization */

/* Make Trix editor integrate with Bootstrap form styling */
trix-editor {
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  padding: 0.75rem;
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
}

trix-editor:focus {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Style the Trix toolbar to match Bootstrap */
trix-toolbar .trix-button-group {
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  margin-bottom: 0.5rem;
}

trix-toolbar .trix-button {
  border: none;
  background: white;
}

trix-toolbar .trix-button:hover {
  background: #f8f9fa;
}

trix-toolbar .trix-button.trix-active {
  background: #e9ecef;
}

/* Make Trix content area look like a form control */
trix-editor[placeholder]:empty:not(:focus)::before {
  color: #6c757d;
}

/* Image upload progress */
trix-editor .attachment--preview {
  opacity: 0.6;
}

trix-editor .attachment--preview.attachment--uploading {
  opacity: 0.4;
}

/* Style uploaded images in the editor */
trix-editor img {
  max-width: 100%;
  height: auto;
  border-radius: 0.25rem;
  margin: 0.5rem 0;
}

/* Upload progress indicator */
trix-editor .attachment__progress {
  height: 4px;
  background-color: #007bff;
  transition: width 0.3s ease;
}

/* Rendered Trix content (view mode, not editing) */
.trix-content {
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  padding: 0.75rem;
  min-height: 50px;
  background-color: #fff;
}

.trix-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.25rem;
  margin: 0.5rem 0;
}

.trix-content h1 {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.trix-content strong {
  font-weight: bold;
}

.trix-content em {
  font-style: italic;
}

.trix-content a {
  color: #0d6efd;
  text-decoration: underline;
}

.trix-content ul, .trix-content ol {
  margin-left: 1.5rem;
  margin-bottom: 0.5rem;
}

.trix-content blockquote {
  border-left: 3px solid #dee2e6;
  padding-left: 1rem;
  margin-left: 0;
  color: #6c757d;
}
