.mgt-editor{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;border:1px solid #ddd;border-radius:4px;background:#fff}.mgt-editor-toolbar{display:flex;flex-wrap:wrap;gap:4px;padding:8px;border-bottom:1px solid #ddd;background:#f8f9fa}.mgt-editor-toolbar-group{display:flex;gap:2px;padding-right:8px;border-right:1px solid #ddd}.mgt-editor-toolbar-group:last-child{border-right:none;padding-right:0}.mgt-editor-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:1px solid transparent;border-radius:4px;background:transparent;color:#333;cursor:pointer;font-size:14px;font-weight:600;transition:all .15s ease}.mgt-editor-btn:hover{background:#e9ecef;border-color:#dee2e6}.mgt-editor-btn.active{background:#007bff;color:#fff;border-color:#007bff}.mgt-editor-btn:disabled{opacity:.5;cursor:not-allowed}.mgt-editor-color-picker{width:32px;height:32px;padding:2px;border:1px solid #ddd;border-radius:4px;cursor:pointer}.mgt-editor-font-size{height:32px;padding:4px 8px;border:1px solid #ddd;border-radius:4px;background:#fff;font-size:14px;cursor:pointer}.mgt-editor-content{min-height:200px;padding:16px;outline:none}.mgt-editor-content:focus{outline:none}.mgt-editor-content .ProseMirror{outline:none;min-height:200px}.mgt-editor-content .ProseMirror p{margin:0 0 1em}.mgt-editor-content .ProseMirror p:last-child{margin-bottom:0}.mgt-editor-content .ProseMirror p.is-editor-empty:first-child:before{content:attr(data-placeholder);float:left;color:#adb5bd;pointer-events:none;height:0}.mgt-editor-content table{border-collapse:collapse;width:100%;margin:1em 0}.mgt-editor-content th,.mgt-editor-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.mgt-editor-content th{background:#f8f9fa;font-weight:600}.mgt-editor-content .selectedCell{background:#e3f2fd}.mgt-editor-content img{max-width:100%;height:auto;cursor:pointer}.mgt-editor-content img.ProseMirror-selectednode{outline:2px solid #007bff}.mgt-image-resizer{display:inline-block;position:relative;line-height:0;max-width:100%}.mgt-image-resizer img{display:block;max-width:100%}.mgt-image-resizer:hover{cursor:pointer}.mgt-resize-handle{position:absolute;width:10px;height:10px;background:#007bff;border:2px solid #fff;border-radius:2px;z-index:10;box-shadow:0 1px 3px #0000004d}.mgt-resize-handle-nw{top:-5px;left:-5px;cursor:nw-resize}.mgt-resize-handle-ne{top:-5px;right:-5px;cursor:ne-resize}.mgt-resize-handle-sw{bottom:-5px;left:-5px;cursor:sw-resize}.mgt-resize-handle-se{bottom:-5px;right:-5px;cursor:se-resize}.mgt-editor-content ul,.mgt-editor-content ol{padding-left:24px;margin:1em 0}.mgt-editor-content li{margin:.25em 0}.mgt-editor-modal-overlay{position:fixed;inset:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:10000}.mgt-editor-modal{background:#fff;border-radius:8px;padding:24px;min-width:400px;max-width:90vw;max-height:90vh;overflow:auto;box-shadow:0 4px 20px #00000026}.mgt-editor-modal h3{margin:0 0 16px;font-size:18px}.mgt-editor-modal-close{position:absolute;top:16px;right:16px;background:none;border:none;font-size:24px;cursor:pointer;color:#666}.mgt-editor-upload-area{border:2px dashed #ddd;border-radius:8px;padding:40px;text-align:center;cursor:pointer;transition:all .2s ease}.mgt-editor-upload-area:hover,.mgt-editor-upload-area.dragover{border-color:#007bff;background:#f8f9ff}.mgt-editor-upload-area input{display:none}.mgt-editor-image-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(100px,1fr));gap:12px;margin-top:16px}.mgt-editor-image-gallery img{width:100%;height:80px;object-fit:cover;border-radius:4px;cursor:pointer;border:2px solid transparent;transition:all .15s ease}.mgt-editor-image-gallery img:hover{border-color:#007bff}.mgt-editor-image-gallery img.selected{border-color:#007bff;box-shadow:0 0 0 2px #007bff40}.mgt-editor-modal-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:16px}.mgt-editor-modal-btn{padding:8px 16px;border-radius:4px;border:1px solid #ddd;background:#fff;cursor:pointer;font-size:14px}.mgt-editor-modal-btn.primary{background:#007bff;border-color:#007bff;color:#fff}.mgt-editor-modal-btn:hover{opacity:.9}.mgt-editor-content .image-resizer{display:inline-block;position:relative}.mgt-editor-content .image-resizer .resize-handle{position:absolute;bottom:0;right:0;width:12px;height:12px;background:#007bff;cursor:se-resize;border-radius:2px}

/* Gallery label */
.mgt-gallery-label{font-size:13px;font-weight:600;color:#6c757d;margin-top:20px;margin-bottom:4px;padding-bottom:6px;border-bottom:1px solid #eee}

/* Gallery items */
.mgt-gallery-item{position:relative;border-radius:6px;overflow:hidden;cursor:pointer;border:2px solid transparent;transition:all .15s ease;background:#f8f9fa}
.mgt-gallery-item:hover{border-color:#007bff;transform:translateY(-1px);box-shadow:0 2px 8px rgba(0,0,0,.1)}
.mgt-gallery-item.selected{border-color:#007bff;box-shadow:0 0 0 2px rgba(0,123,255,.25)}
.mgt-gallery-item img{width:100%;height:80px;object-fit:cover;display:block;border:none}

/* Tooltip met bestandsnaam */
.mgt-gallery-tooltip{position:absolute;bottom:0;left:0;right:0;padding:4px 6px;background:linear-gradient(transparent,rgba(0,0,0,.7));color:#fff;font-size:10px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;opacity:0;transition:opacity .15s ease;pointer-events:none}
.mgt-gallery-item:hover .mgt-gallery-tooltip{opacity:1}

/* Delete knop */
.mgt-gallery-delete{position:absolute;top:2px;right:2px;width:20px;height:20px;padding:0;border:none;border-radius:50%;background:rgba(0,0,0,.5);color:#fff;font-size:14px;line-height:20px;text-align:center;cursor:pointer;opacity:0;transition:opacity .15s ease}
.mgt-gallery-item:hover .mgt-gallery-delete{opacity:1}
.mgt-gallery-delete:hover{background:rgba(220,53,69,.9)}

/* Upload loading overlay */
.mgt-gallery-uploading{pointer-events:none;border-color:#dee2e6}
.mgt-gallery-uploading img{opacity:.5}
.mgt-gallery-loading-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.3)}
.mgt-gallery-spinner{width:24px;height:24px;border:3px solid rgba(0,123,255,.2);border-top-color:#007bff;border-radius:50%;animation:mgt-spin .7s linear infinite}
@keyframes mgt-spin{to{transform:rotate(360deg)}}

/* Upload mislukt */
.mgt-gallery-failed{border-color:#dc3545;pointer-events:none}
.mgt-gallery-failed img{opacity:.4}
.mgt-gallery-error-icon{width:24px;height:24px;background:#dc3545;color:#fff;border-radius:50%;font-size:14px;font-weight:700;line-height:24px;text-align:center}

/* Image alignment / float */
.mgt-editor-content .mgt-image-resizer[style*="float: left"]{margin:0 16px 8px 0}
.mgt-editor-content .mgt-image-resizer[style*="float: right"]{margin:0 0 8px 16px}
.mgt-editor-content .ProseMirror::after{content:"";display:table;clear:both}
