.wysiwyg-editor-container {
    /*max-width: 800px; /* */
    margin: 20px auto;
    position: relative;
}

.wysiwyg-toolbar {
    background: #f5f5f5;
    padding: 10px;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    display: flex;
    gap: 5px;
    flex-wrap: wrap; /* Permitir que los botones se envuelvan en varias filas */
    width: 100%; /* Asegurar que no exceda el ancho del contenedor */
    box-sizing: border-box; /* Incluir padding y border en el ancho */
}

.wysiwyg-btn, 
.wysiwyg-select {
    margin: 0 2px;
    padding: 5px 10px;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
    border-radius: 3px;
}

.wysiwyg-btn:hover {
    background: #e0e0e0;
}

.wysiwyg-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wysiwyg-content {
    height: 300px; /* Valor por defecto, será sobrescrito por JavaScript */
    overflow-y: auto; /* Barra de desplazamiento vertical */
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
    outline: none;
    resize: vertical;
    width: 100%;
    box-sizing: border-box;
    font-size: 16px;
}

.wysiwyg-content img {
    max-width: 100%;
    height: auto;
    cursor: pointer;
}

.wysiwyg-content img.selected {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.wysiwyg-code-view {
    display: none;
    height: 300px; /* Mismo valor por defecto que wysiwyg-content */
    overflow-y: auto; /* Barra de desplazamiento vertical */
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
    font-family: monospace;
    white-space: pre-wrap;
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
}

.wysiwyg-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    overflow-y: auto;
}

.wysiwyg-modal-content {
    background: white;
    margin: 5% auto;
    padding: 20px;
    width: 500px;
    max-width: 90%;
    border-radius: 5px;
    position: relative;
    box-sizing: border-box;
}

.wysiwyg-modal-content input,
.wysiwyg-modal-content select {
    width: 100%;
    margin: 5px 0;
    padding: 5px;
    box-sizing: border-box;
}

.wysiwyg-modal-preview {
    margin: 10px 0;
    text-align: center;
}

.wysiwyg-modal-preview img {
    max-width: 100%;
    max-height: 200px;
    height: auto;
}

/* Clases predefinidas */
.wysiwyg-highlight { background-color: #fff3cd; padding: 2px 5px; }
.wysiwyg-quote { border-left: 4px solid #ccc; padding-left: 10px; color: #666; }
.wysiwyg-code { font-family: 'Courier New', Courier, monospace; background: #f0f0f0; padding: 2px 5px; }
.wysiwyg-custom1 { color: #ff0000; font-weight: bold; }

/* ------------- */
.wysiwyg-content a {
    color: #007bff;
    text-decoration: underline;
    cursor: pointer;
}

.wysiwyg-content a:hover {
    color: #0056b3;
}

.wysiwyg-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}