.pb-text-editor-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.pb-text-editor-container .ql-editor {
    min-height: 150px;
    line-height: 1.42;
    font-size: 14px;
}

.pb-text-editor-container .ql-toolbar {
    border-top: 1px solid #ccc;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    border-bottom: none;
    background-color: #f7f7f7;
}

.pb-text-editor-container .ql-container {
    border: 1px solid #ccc;
    border-top: none;
}

.pb-text-editor-container .ql-editor.ql-blank::before {
    color: #999;
    font-style: italic;
}

.pb-text-editor-container .ql-editor p {
    margin: 0 0 1em 0;
}

.pb-text-editor-container .ql-editor h1, 
.pb-text-editor-container .ql-editor h2, 
.pb-text-editor-container .ql-editor h3, 
.pb-text-editor-container .ql-editor h4, 
.pb-text-editor-container .ql-editor h5, 
.pb-text-editor-container .ql-editor h6 {
    margin: 0 0 1em 0;
}

.pb-text-editor-container .ql-toolbar .ql-formats {
    margin-right: 15px;
}

.pb-text-editor-container .ql-toolbar button {
    padding: 5px;
    margin: 2px;
}

.pb-text-editor-container .ql-toolbar button:hover {
    background-color: #e6e6e6;
}

.pb-text-editor-container .ql-toolbar button.ql-active {
    background-color: #06c;
    color: white;
}

/* Prevent custom buttons from getting the active state */
.pb-text-editor-container .ql-toolbar .ql-custom-tool.ql-active {
    background-color: #e6e6e6 !important;
    color: #444 !important;
}

/* Custom toolbar buttons styling */
.pb-text-editor-container .ql-toolbar .ql-custom-tool {
    background: none;
    border: 1px solid transparent;
    border-radius: 2px;
    cursor: pointer;
    display: inline-block;
    font-size: 14px;
    height: 24px;
    line-height: 1;
    padding: 3px 5px;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    width: auto;
    color: #444;
    min-width: 24px;
}

.pb-text-editor-container .ql-toolbar .ql-custom-tool:hover {
    background-color: #e6e6e6;
    border-color: #adadad;
}

.pb-text-editor-container .ql-toolbar .ql-custom-tool:active,
.pb-text-editor-container .ql-toolbar .ql-custom-tool:focus {
    background-color: #d4edda;
    border-color: #c3e6cb;
    outline: none;
}

.pb-text-editor-container .ql-toolbar .ql-custom-tool .material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 16px;
    line-height: 1;
    vertical-align: middle;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

/* MudBlazor icon styling in custom toolbar buttons */
.pb-text-editor-container .ql-toolbar .ql-custom-tool .mud-icon-root {
    font-size: 16px;
    line-height: 1;
    vertical-align: middle;
    color: inherit;
}

.pb-text-editor-container .ql-toolbar .ql-custom-tool:hover .mud-icon-root {
    color: #444;
}

/* Template buttons container - hidden after moving to toolbar */
.pb-template-buttons {
    display: none;
}

/* Ensure template buttons in toolbar have proper spacing */
.pb-text-editor-container .ql-toolbar .ql-formats .ql-custom-tool {
    margin-left: 2px;
    margin-right: 2px;
}

/* Ensure proper rendering in MudDialog context */
.mud-dialog .pb-text-editor-container {
    position: relative;
    z-index: 1;
}

.mud-dialog .pb-text-editor-container .ql-container {
    min-height: 250px;
}

/* Better styling for fallback text editor */
.pb-text-editor-container .alert-warning {
    border-radius: 4px;
    font-size: 12px;
    padding: 8px 12px;
}

/* Remove validation error styling when in fallback mode */
.pb-text-editor-container .mud-input-error .mud-input-control {
    border-color: #ccc !important;
}
