/* Enhanced HTML Editor Styles */

/* Syntax highlighting for source view */
.rz-html-editor-source {
    font-family: Consolas, Monaco, "Courier New", monospace !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    tab-size: 2 !important;
    background-color: #1e1e1e !important;
    color: #d4d4d4 !important;
    border: 1px solid #3c3c3c !important;
    border-radius: 4px !important;
    padding: 12px !important;
}

/* Light theme for source view */
[data-bs-theme="light"] .rz-html-editor-source,
.rz-body:not([data-bs-theme="dark"]) .rz-html-editor-source {
    background-color: #f5f5f5 !important;
    color: #333333 !important;
    border: 1px solid #d0d0d0 !important;
}

/* Enhanced toolbar */
.rz-html-editor-toolbar {
    background-color: var(--rz-base-200) !important;
    border-bottom: 2px solid var(--rz-border-color) !important;
    padding: 8px !important;
    flex-wrap: wrap !important;
}

/* Custom toolbar buttons */
.html-editor-custom-button {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    margin: 2px;
    border: 1px solid var(--rz-border-color);
    border-radius: 4px;
    background-color: var(--rz-base-background-color);
    color: var(--rz-text-color);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.html-editor-custom-button:hover {
    background-color: var(--rz-primary-lighter);
    border-color: var(--rz-primary);
}

.html-editor-custom-button i {
    margin-right: 4px;
}

.html-editor-custom-button.beautify {
    background-color: #4caf50;
    color: white;
    border-color: #4caf50;
}

.html-editor-custom-button.beautify:hover {
    background-color: #45a049;
}

.html-editor-custom-button.validate {
    background-color: #2196f3;
    color: white;
    border-color: #2196f3;
}

.html-editor-custom-button.validate:hover {
    background-color: #0b7dda;
}

/* Validation errors display */
.html-validation-errors {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 12px;
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
}

[data-bs-theme="dark"] .html-validation-errors {
    background-color: #332701;
    border-color: #997404;
}

.html-validation-error-item {
    padding: 6px 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
}

[data-bs-theme="dark"] .html-validation-error-item {
    border-bottom-color: #4a4a4a;
}

.html-validation-error-item:last-child {
    border-bottom: none;
}

.html-validation-error-type {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    margin-right: 8px;
    text-transform: uppercase;
}

.html-validation-error-type.unclosed {
    background-color: #f44336;
    color: white;
}

.html-validation-error-type.unopened {
    background-color: #ff9800;
    color: white;
}

.html-validation-error-type.mismatch {
    background-color: #ff5722;
    color: white;
}

.html-validation-success {
    background-color: #d4edda;
    border: 1px solid #28a745;
    border-radius: 4px;
    padding: 12px;
    margin-top: 8px;
    color: #155724;
}

[data-bs-theme="dark"] .html-validation-success {
    background-color: #1a4d2e;
    border-color: #28a745;
    color: #b8e6c9;
}

/* Enhanced content area */
.rz-html-editor-content {
    min-height: 400px !important;
    padding: 12px !important;
    line-height: 1.6 !important;
}

/* Color picker enhancement */
.rz-html-editor .rz-colorpicker {
    border: 1px solid var(--rz-border-color);
    border-radius: 4px;
}

/* Font dropdown enhancement */
.rz-html-editor .rz-dropdown {
    min-width: 120px;
}

/* Responsive toolbar */
@media (max-width: 768px) {
    .rz-html-editor-toolbar {
        flex-wrap: wrap;
    }
    
    .html-editor-custom-button {
        font-size: 12px;
        padding: 4px 8px;
    }
}

/* Loading state */
.html-editor-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Beautify animation */
@keyframes beautifyFlash {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(76, 175, 80, 0.2); }
}

.beautify-animation {
    animation: beautifyFlash 0.5s ease-in-out;
}
