.template-editor__main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px;
}

.template-editor__top-panels {
    display: flex;
    gap: 20px;
    min-height: 400px;
}

.template-editor__config-panel {
    width: 300px;
    flex-shrink: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
}

.template-editor__canvas-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
    border-radius: 5px;
    border: 1px solid #ddd;
    overflow: hidden;
}

.template-editor__preview-panel--bottom {
    width: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
    border-radius: 5px;
    border: 1px solid #ddd;
    min-height: 400px;
    max-height: 125vh;
}

.affililabs-plugin__header-actions {
    display: flex;
    gap: 10px;
}

.template-editor__config-section {
    background-color: white;
    border-radius: 5px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.template-editor__config-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.template-editor__form-field {
    margin-bottom: 15px;
}

.template-editor__form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.template-editor__form-field input[type="text"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.template-editor__module-instruction {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.template-editor__modules-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 90vh;
    overflow-y: auto;
    padding-right: 5px;
}

.template-editor__table-selector-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #eee;
    padding: 10px;
    border-radius: 4px;
}

.template-editor__table-selector-item {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.template-editor__table-checkbox {
    margin-right: 8px;
}

.template-editor__module {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: grab;
    transition: all 0.2s;
}

.template-editor__module:hover {
    background-color: #f0f0f0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.template-editor__module-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.template-editor__module-icon img {
    max-width: 100%;
    max-height: 100%;
}

.template-editor__module-info {
    flex-grow: 1;
}

.template-editor__module-info h4 {
    margin: 0 0 3px 0;
    font-size: 14px;
}

.template-editor__module-info p {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.template-editor__canvas-header,
.template-editor__preview-header {
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    background-color: #f9f9f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.template-editor__preview-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.template-editor__preview-controls label {
    font-weight: bold;
    margin-right: 5px;
}

.template-editor__preview-controls select {
    min-width: 150px;
    padding: 5px;
}

.template-editor__preview-controls button {
    padding: 5px 8px;
    min-height: auto;
}

.template-editor__preview-controls #refresh-preview-button:hover,
.template-editor__preview-controls #refresh-preview-button:focus,
.template-editor__preview-controls #refresh-preview-button:active {
    padding: 5px 8px;
}

.template-editor__canvas-header h3,
.template-editor__preview-header h3 {
    margin: 0;
    font-size: 16px;
}

.template-editor__canvas {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    min-height: 200px;
    background-color: #ffffff;
}

.template-editor__empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #666;
}

.template-editor__empty-state img {
    width: 50px;
    height: 50px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.template-editor__row {
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.template-editor__row-header {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background-color: #eee;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    border-bottom: 1px solid #ddd;
}

.template-editor__row-handle {
    cursor: grab;
    margin-right: 10px;
}

.template-editor__row-title {
    flex-grow: 1;
    font-weight: bold;
    font-size: 14px;
}

.template-editor__row-actions {
    display: flex;
    gap: 5px;
}

.template-editor__row-action {
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    padding: 2px;
    border-radius: 3px;
}

.template-editor__row-action:hover {
    background-color: #ddd;
    color: #000;
}

.template-editor__row-content {
    display: flex;
    gap: 10px;
    padding: 10px;
    min-height: 50px;
}

.template-editor__column {
    flex: 1;
    min-width: 100px;
    border: 1px dashed #ccc;
    border-radius: 4px;
    background-color: #fff;
    display: flex;
    flex-direction: column;
}

.template-editor__column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 8px;
    background-color: #f5f5f5;
    border-bottom: 1px dashed #ccc;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.template-editor__column-handle {
    cursor: move;
}

.template-editor__column-actions {
    display: flex;
    gap: 5px;
}

.template-editor__column-action {
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    padding: 0;
    font-size: 14px;
}

.template-editor__column-action:hover {
    color: #dc3545;
}

.template-editor__dropzone {
    flex-grow: 1;
    min-height: 80px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.template-editor__dropzone-placeholder {
    color: #aaa;
    text-align: center;
    font-size: 13px;
}

.template-editor__dropzone-active {
    background-color: #e6f7ff;
    border: 2px dashed #1890ff;
}

.template-editor__module-instance {
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    margin-bottom: 5px;
}

.template-editor__module-instance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 8px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    cursor: default;
}

.template-editor__module-handle {
    cursor: grab;
    margin-right: 10px;
    color: #555;
}

.template-editor__module-handle:hover {
    color: #000;
}

.template-editor__module-instance-title {
    font-weight: bold;
    font-size: 13px;
    flex-grow: 1;
}

.template-editor__module-instance-actions {
    display: flex;
    gap: 5px;
}

.template-editor__module-instance-action {
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    padding: 0;
}

.template-editor__module-instance-action:hover {
    color: #dc3545;
}

.template-editor__module-instance-content {
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.template-editor__module-instance .template-editor__module-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.template-editor__module-instance .template-editor__module-icon img {
    max-width: 100%;
    max-height: 100%;
}

.template-editor__module-instance .template-editor__module-info {
    flex-grow: 1;
}

.template-editor__module-instance .template-editor__module-info h4 {
    margin: 0;
    font-size: 14px;
}

.template-editor__preview-header-title-wrapper {
    display: flex;
    align-items: center;
}

.template-editor__preview-header-tooltip-icon {
    margin-left: 10px;
}

.template-editor__preview-content {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #fff;
}

.template-editor__preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #666;
}

.ui-draggable-dragging {
    z-index: 1000;
    opacity: 0.8;
}

.template-editor__row.ui-sortable-placeholder,
.template-editor__column.ui-sortable-placeholder {
    visibility: visible !important;
    background-color: #f0f8ff;
    border: 2px dashed #1890ff;
    box-sizing: border-box;
    min-height: 50px;
}

.template-editor__module-placeholder {
    visibility: visible !important;
    background-color: #e6f7ff;
    border: 2px dashed #1890ff;
    box-sizing: border-box;
    min-height: 50px;
    margin-bottom: 5px;
    border-radius: 4px;
}

.template-editor__module-instance--helper {
    opacity: 0.8;
    border: 1px dashed #ccc;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
