/*
 * Provides a drop-in pointer for the default Trix stylesheet that will format the toolbar and
 * the trix-editor content (whether displayed or under editing). Feel free to incorporate this
 * inclusion directly in any other asset bundle and remove this file.
 *
 *= require trix
*/

/*
 * We need to override trix.css's image gallery styles to accommodate the
 * responsive nature of the Rails-generated elements for attachments.
 */

/*
 * Dark theme overrides for Trix
 */

trix-editor {
  min-height: 200px;
  color: #f0f0f0;
  background-color: #2a2a2a;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
}

trix-editor:focus {
  border-color: #e31e24;
  outline: none;
  box-shadow: 0 0 0 2px rgba(227, 30, 36, 0.2);
}

trix-toolbar {
  background-color: #1a1a1a;
  border: 1px solid #444;
  border-radius: 4px 4px 0 0;
  padding: 0.5rem;
  margin-bottom: -1px;
}

trix-toolbar .trix-button {
  background-color: transparent;
  border: none;
  border-radius: 3px;
  margin: 2px;
  color: #fff;
}

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

trix-toolbar .trix-button.trix-active {
  background-color: #e31e24;
  color: #fff;
}

trix-toolbar .trix-button-group {
  border: 1px solid #444;
  border-radius: 3px;
  margin-right: 5px;
  overflow: hidden;
}

trix-toolbar .trix-button--icon {
  width: 2.5em;
  height: 2.5em;
  filter: invert(1);
}

trix-toolbar .trix-button--icon::before {
  opacity: 0.7;
}

trix-toolbar .trix-button--icon:hover::before {
  opacity: 1;
}

trix-toolbar .trix-dialog {
  background-color: #2a2a2a;
  border: 1px solid #444;
  border-radius: 4px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
  color: #fff;
}

trix-toolbar .trix-input {
  background-color: #333;
  border: 1px solid #444;
  border-radius: 3px;
  color: #fff;
  padding: 6px 8px;
}

trix-toolbar .trix-input:focus {
  border-color: #e31e24;
  outline: none;
  box-shadow: 0 0 0 2px rgba(227, 30, 36, 0.2);
}

/* Content styling */
.trix-content {
  color: #f0f0f0;
  line-height: 1.6;
}

.trix-content h1 {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 1rem 0;
  color: #fff;
}

.trix-content a {
  color: #e31e24;
  text-decoration: none;
}

.trix-content a:hover {
  color: #ff3f45;
  text-decoration: underline;
}

.trix-content ul, .trix-content ol {
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.trix-content ul {
  list-style-type: disc;
}

.trix-content ol {
  list-style-type: decimal;
}

.trix-content li {
  margin-bottom: 0.5rem;
}

.trix-content blockquote {
  border-left: 3px solid #e31e24;
  padding-left: 1rem;
  margin: 1rem 0;
  font-style: italic;
  color: #bbb;
}

.trix-content pre {
  background-color: #333;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-family: monospace;
  margin: 1rem 0;
}

.trix-content code {
  background-color: #333;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: monospace;
}

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

/* Attachment styling */
.trix-content .attachment {
  margin: 1rem 0;
}

.trix-content .attachment__caption {
  color: #bbb;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Progress bar for uploads */
.trix-content .attachment-progress {
  background-color: #333;
  border-radius: 3px;
  height: 10px;
  margin: 5px 0;
}

.trix-content .attachment-progress .attachment-progress-bar {
  background-color: #e31e24;
  height: 100%;
  border-radius: 3px;
}

/* Improve content presentation */
.trix-content {
  color: #f0f0f0;
}

.trix-content h1 {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 1rem 0;
  color: #fff;
}

.trix-content a {
  color: #e31e24;
}

.trix-content a:hover {
  color: #ff3f45;
  text-decoration: underline;
}

.trix-content ul, .trix-content ol {
  padding-left: 1.5rem;
}

.trix-content ul {
  list-style-type: disc;
}

.trix-content ol {
  list-style-type: decimal;
}

.trix-content li {
  margin-bottom: 0.5rem;
}

/* Display the rich text content better on the frontend */
.rich-text-content {
  color: #f0f0f0;
  line-height: 1.6;
}

.rich-text-content h1 {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 1rem 0;
  color: #fff;
}

.rich-text-content a {
  color: #e31e24;
  text-decoration: none;
}

.rich-text-content a:hover {
  color: #ff3f45;
  text-decoration: underline;
}

.rich-text-content ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.rich-text-content ol {
  list-style-type: decimal;
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.rich-text-content li {
  margin-bottom: 0.5rem;
}

.rich-text-content blockquote {
  border-left: 3px solid #e31e24;
  padding-left: 1rem;
  margin: 1rem 0;
  font-style: italic;
  color: #bbb;
}

.rich-text-content pre {
  background-color: #333;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-family: monospace;
  margin: 1rem 0;
}

.rich-text-content img {
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
  border-radius: 4px;
}

/* Fix for admin form field containers */
.field-container.full-width {
  grid-column: 1 / -1;
}

.field-rich-text {
  width: 100%;
}

/* Fix field label styling */
.field-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #ddd;
}

.field-help {
  font-size: 0.85rem;
  color: #888;
  margin-top: 0.5rem;
}

.field-input-container {
  margin-bottom: 0.5rem;
}

/* Admin show page styling for rich text */
.admin-show-content {
  background-color: #2a2a2a;
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Style badges for consistency */
.badge {
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
}

.bg-success {
  background-color: #2e7d32;
  color: white;
}

.bg-secondary {
  background-color: #616161;
  color: white;
}

/* Admin show details */
.admin-show-details {
  background-color: #2a2a2a;
  border-radius: 6px;
  padding: 1.5rem;
  margin-top: 2rem;
}

.admin-show-details h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #ffd700;
  font-size: 1.2rem;
}

.admin-details-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-details-table th, 
.admin-details-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #444;
  text-align: left;
}

.admin-details-table th {
  width: 150px;
  color: #bbb;
  font-weight: 600;
}