/* ============================================
   QUILL RICH TEXT EDITOR - MOMENTUM52 THEME
   ============================================ */

/* ===== TOOLBAR STYLING ===== */

/* Toolbar container */
.ql-toolbar.ql-snow {
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 6px 6px 0 0;
    padding: 10px;
}

/* Toolbar buttons */
.ql-toolbar.ql-snow .ql-stroke {
    stroke: var(--text-secondary);
}

.ql-toolbar.ql-snow .ql-fill {
    fill: var(--text-secondary);
}

.ql-toolbar.ql-snow .ql-picker-label {
    color: var(--text-secondary);
}

/* Toolbar button hover */
.ql-toolbar.ql-snow button:hover,
.ql-toolbar.ql-snow button:focus {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.ql-toolbar.ql-snow button:hover .ql-stroke,
.ql-toolbar.ql-snow button:focus .ql-stroke {
    stroke: var(--accent-primary);
}

.ql-toolbar.ql-snow button:hover .ql-fill,
.ql-toolbar.ql-snow button:focus .ql-fill {
    fill: var(--accent-primary);
}

/* Active toolbar buttons */
.ql-toolbar.ql-snow button.ql-active,
.ql-toolbar.ql-snow .ql-picker-label.ql-active {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.ql-toolbar.ql-snow button.ql-active .ql-stroke {
    stroke: var(--accent-primary);
}

.ql-toolbar.ql-snow button.ql-active .ql-fill {
    fill: var(--accent-primary);
}

/* Dropdown menus */
.ql-toolbar.ql-snow .ql-picker-options {
    background: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 4px;
    padding: 4px 0;
}

.ql-toolbar.ql-snow .ql-picker-item:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

/* ===== EDITOR STYLING ===== */

/* Editor container */
.ql-container.ql-snow {
    background: var(--bg-primary);
    border: 1px solid var(--bg-tertiary);
    border-top: none;
    border-radius: 0 0 6px 6px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
}

/* Editor content area */
.ql-editor {
    color: var(--text-primary);
    padding: 16px;
    min-height: 150px;
}

/* Placeholder text */
.ql-editor.ql-blank::before {
    color: var(--text-tertiary);
    font-style: italic;
    left: 16px;
    right: 16px;
}

/* Focus state */
.ql-container.ql-snow:focus-within {
    border-color: var(--accent-primary);
}

.ql-toolbar.ql-snow:has(+ .ql-container.ql-snow:focus-within) {
    border-color: var(--accent-primary);
}

/* ===== CONTENT STYLING ===== */

/* Headings */
.ql-editor h1,
.ql-editor h2,
.ql-editor h3 {
    color: var(--text-primary);
    font-family: 'Cinzel', serif;
    font-weight: 600;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.ql-editor h1 {
    font-size: 2em;
}

.ql-editor h2 {
    font-size: 1.5em;
}

.ql-editor h3 {
    font-size: 1.17em;
}

/* Paragraphs */
.ql-editor p {
    margin-bottom: 1em;
    color: var(--text-primary);
}

/* Lists */
.ql-editor ul,
.ql-editor ol {
    padding-left: 2em;
    margin-bottom: 1em;
}

.ql-editor li {
    color: var(--text-primary);
    margin-bottom: 0.5em;
}

/* Blockquotes */
.ql-editor blockquote {
    border-left: 4px solid var(--accent-primary);
    padding-left: 1em;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 1em;
    color: var(--text-secondary);
    font-style: italic;
}

/* Code blocks */
.ql-editor pre.ql-syntax {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 1em;
    overflow-x: auto;
    margin-bottom: 1em;
}

/* Inline code */
.ql-editor code {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* Links */
.ql-editor a {
    color: var(--accent-primary);
    text-decoration: underline;
    transition: color 0.2s;
}

.ql-editor a:hover {
    color: var(--accent-secondary);
}

/* Text formatting */
.ql-editor strong {
    font-weight: 600;
    color: var(--text-primary);
}

.ql-editor em {
    font-style: italic;
}

.ql-editor u {
    text-decoration: underline;
}

.ql-editor s {
    text-decoration: line-through;
}

/* Alignment */
.ql-editor .ql-align-center {
    text-align: center;
}

.ql-editor .ql-align-right {
    text-align: right;
}

.ql-editor .ql-align-justify {
    text-align: justify;
}

/* ===== LIGHT THEME OVERRIDES ===== */

[data-theme="light"] .ql-toolbar.ql-snow {
    background: #f8fafc;
    border-color: #e2e8f0;
}

[data-theme="light"] .ql-container.ql-snow {
    background: #ffffff;
    border-color: #e2e8f0;
}

[data-theme="light"] .ql-toolbar.ql-snow .ql-stroke {
    stroke: #64748b;
}

[data-theme="light"] .ql-toolbar.ql-snow .ql-fill {
    fill: #64748b;
}

[data-theme="light"] .ql-toolbar.ql-snow .ql-picker-label {
    color: #64748b;
}

[data-theme="light"] .ql-toolbar.ql-snow button:hover,
[data-theme="light"] .ql-toolbar.ql-snow button:focus {
    background: #e2e8f0;
}

[data-theme="light"] .ql-toolbar.ql-snow button.ql-active {
    background: #e2e8f0;
}

[data-theme="light"] .ql-editor {
    color: #1e293b;
}

[data-theme="light"] .ql-editor h1,
[data-theme="light"] .ql-editor h2,
[data-theme="light"] .ql-editor h3,
[data-theme="light"] .ql-editor p,
[data-theme="light"] .ql-editor li {
    color: #1e293b;
}

[data-theme="light"] .ql-editor blockquote {
    color: #64748b;
}

[data-theme="light"] .ql-editor pre.ql-syntax {
    background: #f1f5f9;
    color: #1e293b;
}

[data-theme="light"] .ql-editor code {
    background: #f1f5f9;
}

[data-theme="light"] .ql-editor.ql-blank::before {
    color: #94a3b8;
}

[data-theme="light"] .ql-toolbar.ql-snow .ql-picker-options {
    background: #f8fafc;
    border-color: #e2e8f0;
}

[data-theme="light"] .ql-toolbar.ql-snow .ql-picker-item:hover {
    background: #e2e8f0;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */

@media (max-width: 768px) {
    .ql-editor {
        font-size: 0.95rem;
        padding: 12px;
    }
    
    .ql-toolbar.ql-snow {
        padding: 8px;
    }
    
    /* Make toolbar buttons smaller on mobile */
    .ql-toolbar.ql-snow button {
        width: 24px !important;
        height: 24px !important;
    }
}

/* ===== RENDERING-ONLY STYLES ===== */
/* For displaying formatted content without the editor */

.ql-editor-readonly {
    /* Applied to divs showing formatted content on display pages */
    background: transparent;
    border: none;
    padding: 0;
    min-height: auto;
}

/* Remove margins from first/last elements for cleaner rendering */
.ql-editor > *:first-child {
    margin-top: 0;
}

.ql-editor > *:last-child {
    margin-bottom: 0;
}
