﻿/* Fix overlay and enable auto-grow for BlazoredTextEditor (Quill) */
.ql-container {
    height: auto !important;
    margin-bottom: 15px !important;
}

    .ql-editor {
        height: auto !important;
        min-height: 80px; /* keep a sensible starting size */
        overflow-y: visible; /* let content expand the container */
    }

/* Issue #3716 (epic #3612 W3b, E3, E11): the table tools show only with the cursor in a table; text buttons size to
   their words; a read-only email editor shows no toolbar. */
.tip-email-body-editor .tip-table-tools { display: none !important; }
.tip-email-body-editor.tip-in-table .tip-table-tools { display: inline-block !important; }
.tip-email-body-editor .ql-toolbar button.tip-text-button { width: auto; padding: 2px 6px; font-size: 12px; }
.tip-email-body-editor.tip-read-only .ql-toolbar { display: none; }
.tip-email-body-editor .ql-editor table { border-collapse: collapse; }
.tip-email-body-editor .ql-editor td { border: 1px solid var(--mud-palette-lines-default); padding: 4px 8px; }
.tip-email-body-editor .ql-editor hr { border: 0; border-top: 1px solid var(--mud-palette-lines-default); margin: 12px 0; }

/* Issue #3716 Tier 3 round 1 (Agent B). Image is always in the toolbar (Blazor never diffs Quill's buttons); without an
   uploader the wrapper hides it. While an image uploads, the toolbar and the text take no input (E8). */
.tip-email-body-editor.tip-no-image .ql-toolbar .ql-image { display: none !important; }
.tip-email-body-editor .tip-uploading .ql-toolbar,
.tip-email-body-editor .tip-uploading .ql-container { pointer-events: none; opacity: 0.6; }

/* Dark theme: Quill's toolbar icons, pickers and their menus draw in fixed greys; use the palette instead. Hover, active
   and selected go from secondary to primary text (the accent is not a text color, ColorRoleRuleTests). */
body.theme-dark .tip-email-body-editor .ql-toolbar .ql-stroke { stroke: var(--mud-palette-text-secondary); }
body.theme-dark .tip-email-body-editor .ql-toolbar .ql-fill { fill: var(--mud-palette-text-secondary); }
body.theme-dark .tip-email-body-editor .ql-toolbar .ql-picker { color: var(--mud-palette-text-secondary); }
body.theme-dark .tip-email-body-editor .ql-toolbar button:hover .ql-stroke,
body.theme-dark .tip-email-body-editor .ql-toolbar button:focus .ql-stroke,
body.theme-dark .tip-email-body-editor .ql-toolbar button.ql-active .ql-stroke,
body.theme-dark .tip-email-body-editor .ql-toolbar .ql-picker-label:hover .ql-stroke,
body.theme-dark .tip-email-body-editor .ql-toolbar .ql-picker-label.ql-active .ql-stroke { stroke: var(--mud-palette-text-primary); }
body.theme-dark .tip-email-body-editor .ql-toolbar button:hover .ql-fill,
body.theme-dark .tip-email-body-editor .ql-toolbar button.ql-active .ql-fill { fill: var(--mud-palette-text-primary); }
body.theme-dark .tip-email-body-editor .ql-toolbar .ql-picker-label:hover,
body.theme-dark .tip-email-body-editor .ql-toolbar .ql-picker-label.ql-active,
body.theme-dark .tip-email-body-editor .ql-toolbar .ql-picker-item:hover,
body.theme-dark .tip-email-body-editor .ql-toolbar .ql-picker-item.ql-selected { color: var(--mud-palette-text-primary); }
body.theme-dark .tip-email-body-editor .ql-toolbar .ql-picker-options { background-color: var(--mud-palette-surface); border-color: var(--mud-palette-lines-default); }
body.theme-dark .tip-email-body-editor .ql-toolbar button.tip-text-button { color: var(--mud-palette-text-secondary); }
body.theme-dark .tip-email-body-editor .ql-toolbar .ql-picker-label:hover .ql-fill,
body.theme-dark .tip-email-body-editor .ql-toolbar .ql-picker-label.ql-active .ql-fill,
body.theme-dark .tip-email-body-editor .ql-toolbar button:focus .ql-fill { fill: var(--mud-palette-text-primary); }
body.theme-dark .tip-email-body-editor .ql-toolbar.ql-snow,
body.theme-dark .tip-email-body-editor .ql-container.ql-snow { border-color: var(--mud-palette-lines-default); }
