/* ============================================================
   CKEDITOR CUSTOM STYLES - Optimiert für Edit- und Preview-Modus
   ============================================================ */

/* ===== GRUNDLEGENDE EDITOR-STYLES ===== */
.richtext-editor .ck-editor__editable,
.richtext-editor .ck.ck-editor__main > .ck-editor__editable,
.richtext-editor .ck.ck-editor__main > .ck-editor__editable:not(.ck-focused),
.richtext-editor .ck.ck-editor__main > .ck-editor__editable.ck-focused,
.ck-rounded-corners .richtext-editor .ck.ck-editor__main > .ck-editor__editable.ck-rounded-corners {
  min-height: 180px !important;
  background: #fff !important;
  border: 1px solid #e9ecef !important;
  border-radius: 0 0 8px 8px !important;
  font-family: var(--base-font-family) !important;
  font-size: 15px !important;
  color: var(--base-text-color) !important;
  box-shadow: none !important;
  padding: 16px !important;
  outline: none !important;
  line-height: 1.6 !important;
}

/* CKEditor Container komplett anpassen */
.richtext-editor .ck.ck-editor__main {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.richtext-editor .ck.ck-editor__main > .ck-editor__editable {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 12px !important;
  outline: none !important;
}

/* ===== TOOLBAR STYLES ===== */
/* Toolbar-Styles werden von super-build.css übernommen - keine Überschreibungen hier */

/* ===== ALLE TEXTELEMENTE IM EDITOR SCHWARZ ===== */
.richtext-editor .ck-editor__editable *,
.richtext-editor .ck-editor__editable,
.richtext-editor .ck.ck-editor__main > .ck-editor__editable *,
.richtext-editor .ck.ck-editor__main > .ck-editor__editable {
  font-family: var(--base-font-family) !important;
  color: var(--base-text-color) !important;
}

/* ===== ÜBERSCHRIFTEN IM EDITOR ===== */
.richtext-editor .ck-editor__editable h1 {
  font-size: 24px !important;
  font-weight: 500 !important;
  margin: 24px 0 16px 0 !important;
  line-height: 1.3 !important;
  color: var(--base-text-color) !important;
  text-align: left !important;
}

.richtext-editor .ck-editor__editable h2 {
  font-size: 20px !important;
  font-weight: 500 !important;
  margin: 20px 0 12px 0 !important;
  line-height: 1.3 !important;
  color: var(--base-text-color) !important;
  text-align: left !important;
}

.richtext-editor .ck-editor__editable h3 {
  font-size: 16px !important;
  font-weight: 500 !important;
  margin: 16px 0 10px 0 !important;
  line-height: 1.4 !important;
  color: var(--base-text-color) !important;
  text-align: left !important;
}

.richtext-editor .ck-editor__editable h4,
.richtext-editor .ck-editor__editable h5,
.richtext-editor .ck-editor__editable h6 {
  font-size: 14px !important;
  font-weight: 500 !important;
  margin: 14px 0 8px 0 !important;
  line-height: 1.4 !important;
  color: var(--base-text-color) !important;
  text-align: left !important;
}

/* ===== ABSÄTZE IM EDITOR ===== */
.richtext-editor .ck-editor__editable p {
  margin: 8px 0 !important;
  line-height: 1.6 !important;
  color: var(--base-text-color) !important;
  text-align: left !important;
  font-size: 15px !important;
}

/* ===== LISTEN IM EDITOR - KRITISCH FÜR AUFZÄHLUNGSPUNKTE ===== */
.richtext-editor .ck-editor__editable ul,
.richtext-editor .ck.ck-editor__main > .ck-editor__editable ul,
.richtext-editor .ck-editor__editable ol,
.richtext-editor .ck.ck-editor__main > .ck-editor__editable ol {
  padding-left: 40px !important;
  margin: 12px 0 !important;
  list-style-position: outside !important;
}

.richtext-editor .ck-editor__editable ul,
.richtext-editor .ck.ck-editor__main > .ck-editor__editable ul {
  list-style-type: disc !important;
}

.richtext-editor .ck-editor__editable ol,
.richtext-editor .ck.ck-editor__main > .ck-editor__editable ol {
  list-style-type: decimal !important;
}

.richtext-editor .ck-editor__editable ul li,
.richtext-editor .ck.ck-editor__main > .ck-editor__editable ul li,
.richtext-editor .ck-editor__editable ol li,
.richtext-editor .ck.ck-editor__main > .ck-editor__editable ol li {
  margin: 6px 0 !important;
  line-height: 1.6 !important;
  color: var(--base-text-color) !important;
  font-size: 15px !important;
  padding-left: 8px !important;
}

/* Verschachtelte Listen */
.richtext-editor .ck-editor__editable ul ul,
.richtext-editor .ck-editor__editable ol ol,
.richtext-editor .ck-editor__editable ul ol,
.richtext-editor .ck-editor__editable ol ul {
  margin: 4px 0 !important;
  padding-left: 30px !important;
}

/* Aufzählungspunkte sichtbar machen */
.richtext-editor .ck-editor__editable ul li::marker {
  color: var(--base-text-color) !important;
  font-size: 15px !important;
}

.richtext-editor .ck-editor__editable ol li::marker {
  color: var(--base-text-color) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
}

/* ===== WEITERE TEXTELEMENTE IM EDITOR ===== */
.richtext-editor .ck-editor__editable strong,
.richtext-editor .ck-editor__editable b {
  font-weight: 700 !important;
  color: var(--base-text-color) !important;
}

.richtext-editor .ck-editor__editable em,
.richtext-editor .ck-editor__editable i {
  font-style: italic !important;
  color: var(--base-text-color) !important;
}

.richtext-editor .ck-editor__editable a {
  color: #007bff !important;
  text-decoration: underline !important;
}

/* ===== PREVIEW-STYLES (identisch mit Editor für Konsistenz) ===== */
.richtext-preview,
.rt-preview {
  min-height: 100px;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  font-family: var(--base-font-family) !important;
  font-size: 11px !important;
  color: var(--base-text-color) !important;
  box-shadow: none !important;
  padding: 0px !important;
  line-height: 1.3 !important;
}

.richtext-preview *,
.rt-preview * {
  font-family: var(--base-font-family) !important;
  color: var(--base-text-color) !important;
}

/* Überschriften in Preview */
.richtext-preview h1,
.rt-preview h1 {
  font-size: 24px !important;
  font-weight: 500 !important;
  margin: 24px 0 16px 0 !important;
  line-height: 1.3 !important;
  color: var(--base-text-color) !important;
  text-align: left !important;
}

.richtext-preview h2,
.rt-preview h2 {
  font-size: 20px !important;
  font-weight: 500 !important;
  margin: 20px 0 12px 0 !important;
  line-height: 1.3 !important;
  color: var(--base-text-color) !important;
  text-align: left !important;
}

.richtext-preview h3,
.rt-preview h3 {
  font-size: 20px !important;
  font-weight: 500 !important;
  margin: 16px 0 10px 0 !important;
  line-height: 1.4 !important;
  color: var(--base-text-color) !important;
  text-align: left !important;
}

.richtext-preview h4,
.richtext-preview h5,
.richtext-preview h6,
.rt-preview h4,
.rt-preview h5,
.rt-preview h6 {
  font-size: 14px !important;
  font-weight: 500 !important;
  margin: 14px 0 8px 0 !important;
  line-height: 1.4 !important;
  color: var(--base-text-color) !important;
  text-align: left !important;
}

/* Absätze in Preview */
.richtext-preview p,
.rt-preview p {
  margin: 8px 0 !important;
  line-height: 1.6 !important;
  color: var(--base-text-color) !important;
  text-align: left !important;
  font-size: 15px !important;
}

/* Listen in Preview - identisch mit Editor */
.richtext-preview ul,
.richtext-preview ol,
.rt-preview ul,
.rt-preview ol {
  padding-left: 40px !important;
  margin: 12px 0 !important;
  list-style-position: outside !important;
}

.richtext-preview ul,
.rt-preview ul {
  list-style-type: disc !important;
}

.richtext-preview ol,
.rt-preview ol {
  list-style-type: decimal !important;
}

.richtext-preview ul li,
.richtext-preview ol li,
.rt-preview ul li,
.rt-preview ol li {
  margin: 6px 0 !important;
  line-height: 1.6 !important;
  color: var(--base-text-color) !important;
  font-size: 15px !important;
  padding-left: 8px !important;
}

/* Verschachtelte Listen in Preview */
.richtext-preview ul ul,
.richtext-preview ol ol,
.richtext-preview ul ol,
.richtext-preview ol ul,
.rt-preview ul ul,
.rt-preview ol ol,
.rt-preview ul ol,
.rt-preview ol ul {
  margin: 4px 0 !important;
  padding-left: 30px !important;
}

/* Aufzählungspunkte in Preview */
.richtext-preview ul li::marker,
.rt-preview ul li::marker {
  color: var(--base-text-color) !important;
  font-size: 15px !important;
}

.richtext-preview ol li::marker,
.rt-preview ol li::marker {
  color: var(--base-text-color) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
}

/* Weitere Textelemente in Preview */
.richtext-preview strong,
.richtext-preview b,
.rt-preview strong,
.rt-preview b {
  font-weight: 700 !important;
  color: var(--base-text-color) !important;
}

.richtext-preview em,
.richtext-preview i,
.rt-preview em,
.rt-preview i {
  font-style: italic !important;
  color: var(--base-text-color) !important;
}

.richtext-preview a,
.rt-preview a {
  color: #007bff !important;
  text-decoration: underline !important;
}

/* ===== CONTAINER-ANPASSUNGEN ===== */
.edit-container {
  padding: 0 !important;
}

/* CKEditor spezifische Korrekturen */
.richtext-editor .ck.ck-content {
  border: 1px solid #e9ecef !important;
  border-radius: 0 0 8px 8px !important;
  min-height: 200px !important;
}

/* Sicherstellen, dass alle Inhalte die richtige Schrift haben */
.richtext-editor .ck-editor__editable,
.richtext-editor .ck-editor__editable p,
.richtext-editor .ck-editor__editable div,
.richtext-editor .ck-editor__editable span,
.richtext-editor .ck-editor__editable li {
  font-family: var(--base-font-family) !important;
  color: var(--base-text-color) !important;
}

/* ===== SPEZIFISCHE ÜBERSCHREIBUNG NUR FÜR DETAIL-ANSICHTEN ===== */
/* Full Preview in Action-Detail (overview-tab) und Edit-Modus - IDENTISCHES Styling */
.pm-panel .rt-preview,
.overview-edit-standard .rt-preview,
.pm-panel__body .rt-preview {
  border-top: none !important;
  padding-top: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  min-height: auto !important;
  font-family: var(--base-font-family) !important;
  font-size: 12px !important;
  color: var(--base-text-color) !important;
  line-height: 1.2 !important;
}

/* Sicherstellen, dass pm-grid Karten den Cutoff behalten */
.pm-grid .rt-preview,
.pm-card .rt-preview {
  max-height: 88px !important;
  overflow: hidden !important;
  border-top: 1px dashed #eee !important;
  padding-top: 8px !important;
}

/* ===== PM-ELLIPSIS SCHRIFTGRÖSSE KORRIGIEREN ===== */
.pm-ellipsis {
  font-size: 12px !important;
}

/* Spezifische Korrekturen für verschiedene Kontexte */
.pm-list .pm-ellipsis,
.pm-grid .pm-ellipsis,
.pm-card .pm-ellipsis {
  font-size: 12px !important;
  line-height: 1.2 !important;
}

/* ===== PM-CARD-BODY RT-PREVIEW KORREKTUREN ===== */
/* Für die Editor-Vorschau in Karten (generalcomponents.js Zeile 62 & 344) */
.pm-card-body .rt-preview,
.pm-card-body .rt-preview *,
.pm-card .rt-preview,
.pm-card .rt-preview * {
  font-size: 11px !important;
  line-height: 1.3 !important;
  color: var(--base-text-color) !important;
  font-family: var(--base-font-family) !important;
}

.pm-card-body .rt-preview p,
.pm-card .rt-preview p {
  font-size: 12px !important;
  line-height: 1.3 !important;
  margin: 4px 0 !important;
}

.pm-card-body .rt-preview ul,
.pm-card-body .rt-preview ol,
.pm-card .rt-preview ul,
.pm-card .rt-preview ol {
  font-size: 12px !important;
  padding-left: 20px !important;
  margin: 4px 0 !important;
}

.pm-card-body .rt-preview li,
.pm-card .rt-preview li {
  font-size: 12px !important;
  line-height: 1.3 !important;
  margin: 2px 0 !important;
}

/* ===== ULTIMATIVE CKEDITOR-ÜBERSCHREIBUNG ===== */
/* Überschreibt alle CKEditor-internen Styles mit maximaler Spezifität */
.ck.ck-reset.ck-editor.ck-rounded-corners .richtext-editor .ck.ck-editor__main > .ck-editor__editable.ck-rounded-corners.ck-editor__editable_inline.ck-blurred,
.ck.ck-reset.ck-editor.ck-rounded-corners .richtext-editor .ck.ck-editor__main > .ck-editor__editable.ck-rounded-corners.ck-editor__editable_inline.ck-focused,
.ck.ck-reset.ck-editor.ck-rounded-corners .richtext-editor .ck.ck-editor__main > .ck-editor__editable.ck-rounded-corners,
.richtext-editor .ck.ck-editor__main > .ck-editor__editable.ck-rounded-corners,
.richtext-editor .ck-editor__editable {
  background: #fff !important;
  border: 1px solid #e9ecef !important;
  border-radius: 0 0 8px 8px !important;
  color: var(--base-text-color) !important;
  font-family: var(--base-font-family) !important;
  font-size: 15px !important;
  line-height: 1.6 !important;
  padding: 16px !important;
  min-height: 180px !important;
}

/* Alle Listen-Elemente mit maximaler Spezifität */
.ck.ck-reset.ck-editor .richtext-editor .ck-editor__editable ul,
.ck.ck-reset.ck-editor .richtext-editor .ck-editor__editable ol,
.richtext-editor .ck-editor__editable ul,
.richtext-editor .ck-editor__editable ol {
  padding-left: 40px !important;
  margin: 12px 0 !important;
  list-style-position: outside !important;
  color: var(--base-text-color) !important;
}

.ck.ck-reset.ck-editor .richtext-editor .ck-editor__editable ul li,
.ck.ck-reset.ck-editor .richtext-editor .ck-editor__editable ol li,
.richtext-editor .ck-editor__editable ul li,
.richtext-editor .ck-editor__editable ol li {
  color: var(--base-text-color) !important;
  font-family: var(--base-font-family) !important;
  font-size: 15px !important;
  line-height: 1.6 !important;
  margin: 6px 0 !important;
  padding-left: 8px !important;
}