/* Custom Quill Editor Styling */
.ql-snow.ql-toolbar,
.ql-snow .ql-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    box-sizing: border-box;
}

.ql-snow.ql-toolbar .ql-formats,
.ql-snow .ql-toolbar .ql-formats {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-right: 0.25rem;
}

.ql-snow.ql-toolbar button,
.ql-snow .ql-toolbar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0.25rem;
    border: 0;
    background: transparent;
    line-height: 1;
    vertical-align: middle;
}

.ql-snow.ql-toolbar button svg,
.ql-snow .ql-toolbar button svg,
.ql-snow.ql-toolbar .ql-picker svg,
.ql-snow .ql-toolbar .ql-picker svg {
    width: 1.125rem;
    height: 1.125rem;
}

.ql-snow.ql-toolbar .ql-picker,
.ql-snow .ql-toolbar .ql-picker {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    color: #495057;
    vertical-align: middle;
}

.ql-snow.ql-toolbar .ql-picker-label,
.ql-snow .ql-toolbar .ql-picker-label {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    min-width: 4.5rem;
    min-height: 2rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background: #fff;
    cursor: pointer;
}

.ql-snow.ql-toolbar .ql-picker-options,
.ql-snow .ql-toolbar .ql-picker-options {
    display: none;
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    z-index: 10;
    min-width: 100%;
    padding: 0.25rem 0;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 0.75rem 1.5rem rgba(15, 23, 42, 0.12);
}

.ql-snow.ql-toolbar .ql-picker.ql-expanded .ql-picker-options,
.ql-snow .ql-toolbar .ql-picker.ql-expanded .ql-picker-options {
    display: block;
}

.ql-snow.ql-toolbar .ql-picker-item,
.ql-snow .ql-toolbar .ql-picker-item {
    display: block;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    white-space: nowrap;
}

.ql-toolbar {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-bottom: none;
    border-radius: 0.375rem 0.375rem 0 0;
}

.ql-container {
    border: 1px solid #dee2e6;
    border-radius: 0 0 0.375rem 0.375rem;
    font-family: inherit;
}

.ql-editor {
    min-height: 100px;
    font-size: 1rem;
}

.ql-editor h4,
.ql-editor h5 {
    line-height: 1.3;
}

.ql-editor h4 {
    margin: 1.25rem 0 0.75rem;
}

.ql-editor h5 {
    margin: 1rem 0 0.5rem;
}

.ql-editor h4:first-child,
.ql-editor h5:first-child {
    margin-top: 0;
}

.ql-editor h4 + p,
.ql-editor h4 + ul,
.ql-editor h5 + p,
.ql-editor h5 + ul {
    margin-top: 0.25rem;
}

.ql-editor.ql-blank::before {
    color: #6c757d;
    font-style: normal;
}

/* Make Quill editor work well in Bootstrap */
.ql-snow .ql-stroke {
    stroke: #495057;
}

.ql-snow .ql-fill {
    fill: #495057;
}

.ql-snow .ql-picker-label {
    color: #495057;
}

/* Active state colors */
.ql-snow.ql-toolbar button:hover,
.ql-snow .ql-toolbar button:hover,
.ql-snow.ql-toolbar button.ql-active,
.ql-snow .ql-toolbar button.ql-active {
    color: #0d6efd;
}

.ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow .ql-toolbar button:hover .ql-stroke,
.ql-snow.ql-toolbar button.ql-active .ql-stroke,
.ql-snow .ql-toolbar button.ql-active .ql-stroke {
    stroke: #0d6efd;
}

.ql-snow.ql-toolbar button:hover .ql-fill,
.ql-snow .ql-toolbar button:hover .ql-fill,
.ql-snow.ql-toolbar button.ql-active .ql-fill,
.ql-snow .ql-toolbar button.ql-active .ql-fill {
    fill: #0d6efd;
}
