/* Modern Quill Editor Styling for osTicket */

/* Container Styling */
.quill-container {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    margin: 8px 0;
/* --- THE FIX START --- */
    display: block;          /* behave like a block element */
    clear: both;             /* Push below any floating labels/fields */
    margin-bottom: 30px;     /* Force 30px of empty space before the Save buttons */
    position: relative;      /* Ensure it respects page flow */
    z-index: auto;           /* Lower than toolbar */
    /* --- THE FIX END --- */
}

.quill-container:hover {
    border-color: #cbd5e0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.quill-container:focus-within {
    border-color: var(--primary-color, #4f7cf2);
    box-shadow: 0 0 0 3px rgba(79, 124, 242, 0.15), 0 2px 12px rgba(0, 0, 0, 0.1);
}

/* Toolbar Styling */
.ql-toolbar {
    background: linear-gradient(to bottom, #f9fafb, #f6f7f9) !important;
    border: none !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-radius: 8px 8px 0 0 !important;
    padding: 10px 12px !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    position: relative !important;
    z-index: 2 !important;
}

/* Toolbar Buttons */
.ql-toolbar button {
    width: 32px !important;
    height: 32px !important;
    padding: 6px !important;
    margin: 0 !important;
    border: 1px solid transparent !important;
    border-radius: 4px !important;
    background: transparent !important;
    color: #4a5568 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    flex-shrink: 0 !important;
}

.ql-toolbar button:hover {
    background: #e2e8f0 !important;
    border-color: #cbd5e0 !important;
}

.ql-toolbar button.ql-active,
.ql-toolbar button:focus {
    background: rgba(79, 124, 242, 0.15) !important;
    border-color: var(--primary-color, #4f7cf2) !important;
    color: var(--primary-color, #4f7cf2) !important;
}

/* Toolbar SVG Icons */
.ql-toolbar button svg {
    width: 16px !important;
    height: 16px !important;
    display: block !important;
    margin: auto !important;
}

.ql-toolbar button:hover svg .ql-fill,
.ql-toolbar button:hover svg .ql-stroke {
    fill: #2d3748 !important;
    stroke: #2d3748 !important;
}

.ql-toolbar button.ql-active svg .ql-fill,
.ql-toolbar button.ql-active svg .ql-stroke {
    fill: var(--primary-color, #4f7cf2) !important;
    stroke: var(--primary-color, #4f7cf2) !important;
}

/* Toolbar Dropdowns */
.ql-toolbar select {
    border: 1px solid #e2e8f0 !important;
    border-radius: 4px !important;
    padding: 4px 24px 4px 8px !important;
    background: #fff !important;
    color: #2d3748 !important;
    font-size:!important;
    vertical-align: middle !important;
    display: inline-block9rem !important;
    height: 32px !important;
    margin: 0 2px !important;
}

.ql-toolbar select:hover {
    border-color: #cbd5e0 !important;
    background: #f9fafb !important;
}

.ql-toolbar select:focus {
    outline: none !important;
    border-color: var(--primary-color, #4f7cf2) !important;
    box-shadow: 0 0 0 3px rgba(79, 124, 242, 0.15) !important;
}

/* Color Picke!important;
    display: inline-flex !important;
    align-items: center !important;
    vertical-align: middle !important;
    height: 32px !important;
}

.ql-toolbar .ql-picker-label {
    border: 1px solid transparent !important;
    border-radius: 4px !important;
    padding: 6px 8px !important;
    transition: all 0.15s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    height: 32pxant;
    padding: 6px 8px !important;
    transition: all 0.15s ease !important;
}

.ql-toolbar .ql-picker-label:hover {
    background: #e2e8f0 !important;
    border-color: #cbd5e0 !important;
}

.ql-toolbar .ql-picker.ql-expanded .ql-picker-label {
    background: rgba(79, 124, 242, 0.15) !important;
    border-color: var(--primary-color, #4f7cf2) !important;
}

/* Picker Dropdown */
.ql-toolbar .ql-picker-options {
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    padding: 4px !important;
}

.ql-toolbar .ql-picker-item {
    padding: 6px 12px !important;
    border-radius: 4px !important;
    transition: all 0.15s ease !important;
}

.ql-toolbar .ql-picker-item:hover {
    background: #f0f4f8 !important;
    color: var(--primary-color, #4f7cf2) !important;
}

.ql-toolbar .ql-picker-item.ql-selected {
    background: rgba(79, 124, 242, 0.1) !important;
    color: var(--primary-color, #4f7cf2) !important;
}

/* Quill Container - size to content */
.ql-container {
    min-height: auto !important;
    height: auto !important;
}

/* Editor Content Area */
.ql-editor {
    background: #fff !important;
    color: #2d3748 !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    padding: 14px 12px !important;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    border: none !important;
    outline: none !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    min-height: 100px !important;
    height: auto !important;
}

.ql-editor:focus {
    outline: none !important;
}

/* Placeholder */
.ql-editor.ql-blank::before {
    color: #a0aec0 !important;
    font-style: italic !important;
    left: 12px !important;
}

/* Content Styling within Editor */
.ql-editor h1 {
    font-size: 2em !important;
    margin: 0.67em 0 !important;
    font-weight: 700 !important;
}

.ql-editor h2 {
    font-size: 1.5em !important;
    margin: 0.75em 0 !important;
    font-weight: 700 !important;
}

.ql-editor h3 {
    font-size: 1.17em !important;
    margin: 0.83em 0 !important;
    font-weight: 700 !important;
}

.ql-editor p {
    margin: 0.5em 0 !important;
}

.ql-editor strong {
    font-weight: 700 !important;
}

.ql-editor em {
    font-style: italic !important;
}

.ql-editor u {
    text-decoration: underline !important;
}

.ql-editor s {
    text-decoration: line-through !important;
}

/* Lists */
.ql-editor ul,
.ql-editor ol {
    margin: 8px 0 !important;
    padding-left: 1.5em !important;
}

.ql-editor li {
    margin: 4px 0 !important;
}

/* Blockquote */
.ql-editor blockquote {
    background: #f0f4f8 !important;
    border-left: 4px solid var(--primary-color, #4f7cf2) !important;
    padding: 10px 12px !important;
    margin: 8px 0 !important;
    color: #4a5568 !important;
}

/* Code */
.ql-editor code {
    background: #f9fafb !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-family: 'Courier New', Courier, monospace !important;
    color: #e53e3e !important;
}

.ql-editor pre {
    background: #1a202c !important;
    color: #e2e8f0 !important;
    padding: 12px !important;
    border-radius: 6px !important;
    overflow-x: auto !important;
    margin: 8px 0 !important;
}

.ql-editor pre.ql-syntax {
    background: #1a202c !important;
    color: #e2e8f0 !important;
}

/* Links */
.ql-editor a {
    color: var(--primary-color, #4f7cf2) !important;
    text-decoration: underline !important;
}

.ql-editor a:hover {
    opacity: 0.8 !important;
}

/* Images */
.ql-editor img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 6px !important;
    margin: 8px 0 !important;
}

/* Video */
.ql-editor iframe {
    max-width: 100% !important;
    border-radius: 6px !important;
    margin: 8px 0 !important;
}

/* Small/No-bar variant */
.richtext.no-bar + .quill-container {
    min-height: 100px !important;
}

.

.richtext.no-bar + .quill-container .ql-picker {
    height: 28px !important;
}

.richtext.no-bar + .quill-container .ql-picker-label {
    height: 28px !important;
}richtext.no-bar + .quill-container .ql-toolbar {
    padding: 6px 8px !important;
}

.richtext.no-bar + .quill-container .ql-toolbar button {
    width: 28px !important;
    height: 28px !important;
}

/* Size variants */
.richtext.small + .quill-container .ql-editor {
    min-height: 75px !important;
}

.richtext.medium + .quill-container .ql-editor {
    min-height: 150px !important;
}

.richtext.large + .quill-container .ql-editor {
    min-height: 225px !important;
}

/* Tooltip Styling */
.ql-tooltip {
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    padding: 8px 12px !important;
}

.ql-tooltip input[type="text"] {
    border: 1px solid #e2e8f0 !important;
    border-radius: 4px !important;
    padding: 6px 8px !important;
    font-size: 0.9rem !important;
}

.ql-tooltip input[type="text"]:focus {
    outline: none !important;
    border-color: var(--primary-color, #4f7cf2) !important;
    box-shadow: 0 0 0 3px rgba(79, 124, 242, 0.15) !important;
}

.ql-tooltip a.ql-action,
.ql-tooltip a.ql-remove {
    color: var(--primary-color, #4f7cf2) !important;
    text-decoration: none !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    transition: all 0.15s ease !important;
}

.ql-tooltip a.ql-action:hover,
.ql-tooltip a.ql-remove:hover {
    background: #f0f4f8 !important;
}

/* Color/Background Swatches */
.ql-color-picker .ql-picker-options,
.ql-background .ql-picker-options {
    width: 152px !important;
    padding: 4px !important;
}

.ql-color-picker .ql-picker-item,
.ql-background .ql-picker-item {
    width: 24px !important;
    height: 24px !important;
    border-radius: 4px !important;
    margin: 2px !important;
}

/* Disabled State */
.ql-container.ql-disabled {
    opacity: 0.6;
    pointer-events: none;
}

.ql-container.ql-disabled .ql-editor {
    background: #f9fafb !important;
}

/* Scrollbar Styling for Editor */
.ql-editor::-webkit-scrollbar {
    width: 8px;
}

.ql-editor::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.ql-editor::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.ql-editor::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* HTML Editor Button */
.ql-toolbar button.ql-html-editor {
    min-width: 45px !important;
    width: auto !important;
    padding: 6px 8px !important;
}

.ql-toolbar button.ql-html-editor span {
    color: #4a5568 !important;
}

.ql-toolbar button.ql-html-editor:hover span {
    color: #2d3748 !important;
}

.ql-toolbar button.ql-html-editor.ql-active {
    background: #4f7cf2 !important;
    border-color: #4f7cf2 !important;
}

.ql-toolbar button.ql-html-editor.ql-active span {
    color: #fff !important;
}

/* Save Draft Button */
.ql-toolbar button.ql-save-draft svg {
    width: 16px !important;
    height: 16px !important;
}

/* Clear Draft Button */
.ql-toolbar button.ql-clear-draft svg {
    width: 16px !important;
    height: 16px !important;
}

/* HTML Editor Textarea */
.html-editor-textarea {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    border: none;
    border-radius: 0 0 8px 8px;
    background: #f9f9f9;
    color: #333;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
}

.html-editor-textarea:focus {
    background: #fff;
    outline: 2px solid rgba(79, 124, 242, 0.2);
}
