/*
 * BWS 2.0 Rich Text Styles
 * Description: Shared frame styling for TinyMCE text editors and fallback
 * textareas used in comments, admin descriptions, and long formatted fields.
 * TOC:
 * - Wrapper/frame styles
 * - TinyMCE skin overrides for the BWS dark UI
 * - Plain textarea fallback
 * Summary: The component keeps TinyMCE visually aligned with BWS panels while
 * remaining usable if the CDN cannot be reached.
 */
.bws-rich-text-field {
  width: 100%;
}

.tox.tox-tinymce {
  border: 1px solid rgba(210, 136, 31, .42) !important;
  border-radius: 8px !important;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .28);
}

.tox .tox-editor-header {
  background: rgba(21, 9, 3, .96) !important;
  border-bottom: 1px solid rgba(210, 136, 31, .28) !important;
}

.tox .tox-toolbar,
.tox .tox-toolbar__primary,
.tox .tox-toolbar-overlord {
  background: rgba(21, 9, 3, .96) !important;
}

.tox .tox-tbtn,
.tox .tox-tbtn svg {
  color: #f2d8ad !important;
  fill: #f2d8ad !important;
}

.tox .tox-tbtn:hover,
.tox .tox-tbtn--enabled {
  background: rgba(210, 136, 31, .18) !important;
}

.tox .tox-statusbar {
  background: rgba(21, 9, 3, .96) !important;
  border-top: 1px solid rgba(210, 136, 31, .18) !important;
  color: rgba(242, 216, 173, .72) !important;
}

textarea[data-rich-text],
.bws-rich-text-fallback {
  width: 100%;
  min-height: 150px;
  padding: 14px;
  border: 1px solid rgba(210, 136, 31, .42);
  border-radius: 8px;
  background: rgba(255, 250, 242, .96);
  color: #1c140c;
  font: 14px/1.5 Inter, Arial, sans-serif;
}

.bws-rich-text-loading {
  background:
    linear-gradient(90deg, rgba(255, 250, 242, .88), rgba(255, 250, 242, 1), rgba(255, 250, 242, .88));
  background-size: 220% 100%;
  animation: bwsRichTextLoading 1.4s ease-in-out infinite;
}

@keyframes bwsRichTextLoading {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
