.druckportal-wysiwyg-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
}

.wysiwyg-editor-toolbar {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.wysiwyg-editor-main {
    position: relative;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    padding: 20px;
    margin-bottom: 20px;
    min-height: 500px;
}

.template-page {
    position: relative;
    width: 100%;
    height: 100%;
}

.template-background {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 141.42%; /* A4 Verhältnis */
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.editable-area {
    position: absolute;
    border: 2px dashed #3498db;
    background-color: rgba(52, 152, 219, 0.1);
    cursor: pointer;
    overflow: hidden;
}

.editable-area.active {
    border: 2px solid #e74c3c;
    background-color: rgba(231, 76, 60, 0.1);
    z-index: 10;
}

.area-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 20px;
    background-color: #3498db;
    cursor: move;
}

.area-content {
    width: 100%;
    height: 100%;
    padding: 5px;
    box-sizing: border-box;
}

.text-content, .rich-text-content {
    font-size: 14px;
    outline: none;
}

.image-content {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.image-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background-color: #f9f9f9;
}

/* WYSIWYG Editor Styles */
.wysiwyg-editor-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 800px;
    background-color: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.wysiwyg-toolbar {
    display: flex;
    gap: 5px;
    padding: 10px;
    border-bottom: 1px solid #ddd;
    background-color: #f5f5f5;
}

.wysiwyg-content-container {
    min-height: 200px;
    padding: 10px;
    overflow-y: auto;
    outline: none;
}

.wysiwyg-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 10px;
    border-top: 1px solid #ddd;
    background-color: #f5f5f5;
}

/* Image Selector Dialog Styles */
.image-selector-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1001;
}

.image-selector-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.image-selector-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 600px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    padding: 20px;
}

.image-preview {
    margin: 15px 0;
    background-color: #f5f5f5;
    padding: 10px;
    border: 1px solid #ddd;
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-preview-container img {
    max-width: 100%;
    max-height: 300px;
}

.image-selector-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

/* Preview Dialog Styles */
.design-preview-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1002;
}

.design-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
}

.design-preview-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    padding: 20px;
    overflow-y: auto;
}

.design-preview-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.design-preview-area {
    background-color: #f5f5f5;
    padding: 20px;
    border: 1px solid #ddd;
    min-height: 400px;
    margin-bottom: 15px;
}

.design-preview-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.preview-page {
    position: relative;
}

.preview-area {
    position: absolute;
}

/* Status Message Styles */
.designer-status-message {
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    display: none;
}

.status-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .wysiwyg-editor-container,
    .image-selector-content,
    .design-preview-content {
        width: 95%;
    }
    
    .wysiwyg-toolbar {
        flex-wrap: wrap;
    }
}
