/* ==============================================================
   Quill Content Renderer Styles
   Ensures formatted Rich Text renders identically to the Editor
   ============================================================== */

.ql-editor-content,
.ql-editor {
    box-sizing: border-box;
    line-height: 1.8;
    font-size: 15px;
    direction: rtl;
    text-align: right;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Headings */
.ql-editor-content h1, .ql-editor h1 { font-size: 1.85rem; font-weight: 700; margin-top: 1.25rem; margin-bottom: 0.75rem; color: inherit; }
.ql-editor-content h2, .ql-editor h2 { font-size: 1.5rem; font-weight: 700; margin-top: 1.15rem; margin-bottom: 0.65rem; color: inherit; }
.ql-editor-content h3, .ql-editor h3 { font-size: 1.25rem; font-weight: 600; margin-top: 1rem; margin-bottom: 0.5rem; color: inherit; }
.ql-editor-content h4, .ql-editor h4 { font-size: 1.1rem; font-weight: 600; margin-top: 0.85rem; margin-bottom: 0.5rem; color: inherit; }
.ql-editor-content h5, .ql-editor h5 { font-size: 1rem; font-weight: 600; margin-top: 0.75rem; margin-bottom: 0.5rem; color: inherit; }
.ql-editor-content h6, .ql-editor h6 { font-size: 0.9rem; font-weight: 600; margin-top: 0.75rem; margin-bottom: 0.5rem; color: inherit; }

/* Paragraphs */
.ql-editor-content p, .ql-editor p {
    margin-bottom: 0.75rem;
    line-height: 1.9;
}

/* Basic Formatting */
.ql-editor-content strong, .ql-editor strong,
.ql-editor-content b, .ql-editor b { font-weight: 700; }
.ql-editor-content em, .ql-editor em,
.ql-editor-content i, .ql-editor i { font-style: italic; }
.ql-editor-content u, .ql-editor u { text-decoration: underline; }
.ql-editor-content s, .ql-editor s,
.ql-editor-content strike, .ql-editor strike { text-decoration: line-through; }

/* Alignments */
.ql-editor-content .ql-align-center, .ql-editor .ql-align-center, .ql-align-center { text-align: center !important; }
.ql-editor-content .ql-align-right, .ql-editor .ql-align-right, .ql-align-right { text-align: right !important; }
.ql-editor-content .ql-align-left, .ql-editor .ql-align-left, .ql-align-left { text-align: left !important; }
.ql-editor-content .ql-align-justify, .ql-editor .ql-align-justify, .ql-align-justify { text-align: justify !important; }

/* Directions */
.ql-editor-content .ql-direction-rtl, .ql-editor .ql-direction-rtl, .ql-direction-rtl { direction: rtl !important; text-align: inherit; }
.ql-editor-content .ql-direction-ltr, .ql-editor .ql-direction-ltr, .ql-direction-ltr { direction: ltr !important; text-align: inherit; }

/* Font Sizes */
.ql-editor-content .ql-size-small, .ql-editor .ql-size-small, .ql-size-small { font-size: 0.75em !important; }
.ql-editor-content .ql-size-large, .ql-editor .ql-size-large, .ql-size-large { font-size: 1.5em !important; font-weight: 600; }
.ql-editor-content .ql-size-huge, .ql-editor .ql-size-huge, .ql-size-huge { font-size: 2.25em !important; font-weight: 700; }

/* Lists */
.ql-editor-content ol, .ql-editor ol {
    list-style-type: decimal !important;
    padding-right: 2rem !important;
    padding-left: 0 !important;
    margin: 0.75rem 0 !important;
}
.ql-editor-content ul, .ql-editor ul {
    list-style-type: disc !important;
    padding-right: 2rem !important;
    padding-left: 0 !important;
    margin: 0.75rem 0 !important;
}
.ql-editor-content li, .ql-editor li {
    margin-bottom: 0.35rem;
    line-height: 1.9;
}

/* Quill specific list items with counter pseudo-elements */
.ql-editor ol li:not(.ql-direction-rtl),
.ql-editor ul li:not(.ql-direction-rtl) {
    padding-right: 0.5rem;
}

/* Blockquotes */
.ql-editor-content blockquote, .ql-editor blockquote {
    border-right: 4px solid #3b82f6;
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    font-style: italic;
    background-color: rgba(59, 130, 246, 0.05);
    border-radius: 0 4px 4px 0;
    color: #475569;
}

/* Code Blocks */
.ql-editor-content pre, .ql-editor pre {
    background-color: #282c34;
    color: #abb2bf;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    direction: ltr;
    text-align: left;
    font-family: Consolas, Monaco, 'Courier New', Courier, monospace;
    font-size: 13.5px;
    margin: 1rem 0;
}
.ql-editor-content code, .ql-editor code {
    background-color: rgba(0, 0, 0, 0.06);
    color: #e11d48;
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: Consolas, Monaco, 'Courier New', Courier, monospace;
}

/* Links */
.ql-editor-content a, .ql-editor a {
    color: #2563eb !important;
    text-decoration: underline !important;
    transition: color 0.2s ease;
}
.ql-editor-content a:hover, .ql-editor a:hover {
    color: #1d4ed8 !important;
}

/* Images & Media */
.ql-editor-content img, .ql-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 0.5rem 0;
    display: inline-block;
}
.ql-editor-content .ql-video, .ql-editor .ql-video {
    display: block;
    max-width: 100%;
    margin: 1rem auto;
    border-radius: 8px;
}

/* Colors */
.ql-editor .ql-color-white, .ql-color-white { color: #fff !important; }
.ql-editor .ql-color-red, .ql-color-red { color: #e60000 !important; }
.ql-editor .ql-color-orange, .ql-color-orange { color: #f90 !important; }
.ql-editor .ql-color-yellow, .ql-color-yellow { color: #ff0 !important; }
.ql-editor .ql-color-green, .ql-color-green { color: #008a00 !important; }
.ql-editor .ql-color-blue, .ql-color-blue { color: #06c !important; }
.ql-editor .ql-color-purple, .ql-color-purple { color: #93f !important; }

/* Backgrounds */
.ql-editor .ql-bg-black, .ql-bg-black { background-color: #000 !important; }
.ql-editor .ql-bg-red, .ql-bg-red { background-color: #e60000 !important; }
.ql-editor .ql-bg-orange, .ql-bg-orange { background-color: #f90 !important; }
.ql-editor .ql-bg-yellow, .ql-bg-yellow { background-color: #ff0 !important; }
.ql-editor .ql-bg-green, .ql-bg-green { background-color: #008a00 !important; }
.ql-editor .ql-bg-blue, .ql-bg-blue { background-color: #06c !important; }
.ql-editor .ql-bg-purple, .ql-bg-purple { background-color: #93f !important; }

/* Indents */
.ql-editor .ql-indent-1, .ql-indent-1 { padding-right: 2em !important; }
.ql-editor .ql-indent-2, .ql-indent-2 { padding-right: 4em !important; }
.ql-editor .ql-indent-3, .ql-indent-3 { padding-right: 6em !important; }
.ql-editor .ql-indent-4, .ql-indent-4 { padding-right: 8em !important; }
.ql-editor .ql-indent-5, .ql-indent-5 { padding-right: 10em !important; }
