/* =========================================================
   Quill overrides — robusto para IIS / dark theme
   Reemplaza SVG rotos de la toolbar por Bootstrap Icons.
   ========================================================= */

.pf-editor,
.ce-editor {
    overflow: hidden;
}

.pf-editor .ql-toolbar.ql-snow,
.ce-editor .ql-toolbar.ql-snow,
.pf-editor .ql-container.ql-snow,
.ce-editor .ql-container.ql-snow {
    border: 0 !important;
}

.pf-editor .ql-toolbar.ql-snow,
.ce-editor .ql-toolbar.ql-snow {
    border-bottom: 1px solid rgba(148, 163, 184, 0.28) !important;
    background: #f8fbff;
    padding: 6px 8px !important;
}

.pf-editor .ql-container.ql-snow,
.ce-editor .ql-container.ql-snow {
    min-height: 170px;
    font-size: 1rem;
}

.ql-snow .ql-toolbar button,
.ql-snow .ql-toolbar .ql-picker-label {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    float: none !important;
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    margin: 0 2px !important;
    border-radius: 4px;
    color: #475569 !important;
    vertical-align: middle;
}

.ql-snow .ql-toolbar .ql-picker {
    float: none !important;
    display: inline-flex !important;
    align-items: center;
    height: 28px;
    margin: 0 4px 0 0 !important;
    color: #475569 !important;
}

.ql-snow .ql-toolbar .ql-picker-label {
    width: auto !important;
    padding: 0 8px !important;
    font-size: 13px !important;
    font-weight: 600;
}

/* Ocultar SVG nativos de Quill (se ven corruptos en algunos hosts) */
.ql-snow .ql-toolbar button svg,
.ql-snow .ql-toolbar .ql-picker-label svg {
    display: none !important;
}

.ql-snow .ql-toolbar button::before {
    font-family: bootstrap-icons !important;
    font-style: normal;
    font-weight: 400 !important;
    font-size: 15px;
    line-height: 1;
    speak: never;
}

.ql-snow .ql-toolbar button.ql-bold::before { content: "\f5f0"; }      /* type-bold */
.ql-snow .ql-toolbar button.ql-italic::before { content: "\f5f4"; }    /* type-italic */
.ql-snow .ql-toolbar button.ql-underline::before { content: "\f5f6"; } /* type-underline */
.ql-snow .ql-toolbar button.ql-image::before { content: "\f42a"; }     /* image */
.ql-snow .ql-toolbar button.ql-code-block::before { content: "\f2c6"; }/* code-slash */

.ql-snow .ql-toolbar button:hover,
.ql-snow .ql-toolbar button.ql-active,
.ql-snow .ql-toolbar .ql-picker-label:hover {
    color: #0d47a1 !important;
    background: rgba(13, 71, 161, 0.08);
}

.ql-snow .ql-editor {
    min-height: 140px;
    line-height: 1.55;
    color: #152b52;
    font-size: 1rem;
}

/* ---- Dark theme ---- */
html[data-theme="dark"] .pf-editor .ql-toolbar.ql-snow,
html[data-theme="dark"] .ce-editor .ql-toolbar.ql-snow {
    background: #1c263a !important;
    border-bottom-color: rgba(148, 163, 184, 0.22) !important;
}

html[data-theme="dark"] .pf-editor .ql-container.ql-snow,
html[data-theme="dark"] .ce-editor .ql-container.ql-snow,
html[data-theme="dark"] .ql-container.ql-snow .ql-editor {
    background-color: #121a26 !important;
}

html[data-theme="dark"] .ql-snow .ql-toolbar button,
html[data-theme="dark"] .ql-snow .ql-toolbar .ql-picker,
html[data-theme="dark"] .ql-snow .ql-toolbar .ql-picker-label {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .ql-snow .ql-toolbar button:hover,
html[data-theme="dark"] .ql-snow .ql-toolbar button.ql-active,
html[data-theme="dark"] .ql-snow .ql-toolbar .ql-picker-label:hover {
    color: #93c5fd !important;
    background: rgba(147, 197, 253, 0.12);
}

html[data-theme="dark"] .ql-snow .ql-picker-options {
    background-color: #1a2332 !important;
    border-color: rgba(148, 163, 184, 0.22) !important;
    color: #e2e8f0 !important;
}

/* Forzar texto legible: el HTML guardado suele traer color negro inline */
html[data-theme="dark"] .ql-editor,
html[data-theme="dark"] .ql-editor p,
html[data-theme="dark"] .ql-editor li,
html[data-theme="dark"] .ql-editor h1,
html[data-theme="dark"] .ql-editor h2,
html[data-theme="dark"] .ql-editor h3,
html[data-theme="dark"] .ql-editor span,
html[data-theme="dark"] .ql-editor strong,
html[data-theme="dark"] .ql-editor em,
html[data-theme="dark"] .ql-editor u,
html[data-theme="dark"] .ql-editor * {
    color: #e8edf4 !important;
    background-color: transparent !important;
}

html[data-theme="dark"] .ql-editor.ql-blank::before {
    color: #64748b !important;
    font-style: italic;
}

html[data-theme="dark"] .ql-snow a {
    color: #93c5fd !important;
}
