.elementor-widget-image-transition {
    flex-grow: 1;
}

.elementor-editor-active .elementor-widget-image-transition div {
    height: 100%;
}

.image-transition-container {
    position: relative;
    display: block;
    overflow: hidden;
    width: 100%;
    height: 100%;
    min-height: 200px; /* ensure container is visible to intersection observer */
    min-width: 200px;
}

.image-transition-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: block;
}

/* Loading state */
.image-transition-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: image-transition-spin 1s linear infinite;
    z-index: 1;
}

@keyframes image-transition-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error state */
.image-transition-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background-color: #f8f8f8;
    color: #666;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-align: center;
    border: 1px dashed #ddd;
    border-radius: 4px;
}

.image-transition-error::before {
    content: '⚠️';
    display: block;
    font-size: 24px;
    margin-bottom: 8px;
}