/* Animations for Form.io Editor */

/* 1. Highlight Change Animation */
/* Refactored to use ::after overlay to cover all children (like inputs) */
.highlight-change {
    position: relative;
    /* Ensure z-index context but don't force high z-index on the element itself unless needed */
}

.highlight-change::after {
    content: "";
    position: absolute;
    /* Expand slightly outward to create breathing room */
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    width: auto;
    height: auto;
    pointer-events: none;
    z-index: 100;
    border-radius: 8px;
    /* Slightly larger radius */
    animation: highlightFade 10s ease-out;
}

@keyframes highlightFade {
    0% {
        /* Soft outer glow + border */
        box-shadow: 0 0 0 2px #48bb78, 0 4px 12px rgba(72, 187, 120, 0.4);
        background-color: rgba(72, 187, 120, 0.1);
        transform: scale(1);
    }

    10% {
        box-shadow: 0 0 0 2px #48bb78, 0 2px 8px rgba(72, 187, 120, 0.2);
    }

    20% {
        box-shadow: 0 0 0 1px #48bb78, 0 0 0 rgba(72, 187, 120, 0);
        background-color: rgba(72, 187, 120, 0.05);
    }

    100% {
        box-shadow: 0 0 0 0 transparent;
        background-color: transparent;
    }
}

/* 2. Undo Counter Pulse */
@keyframes pulse-count {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.4);
        color: #fff;
    }

    100% {
        transform: scale(1);
    }
}

.undo-counter-pulse {
    animation: pulse-count 0.6s ease-in-out;
    display: inline-block;
}

/* 3. Undo Button Pulse (Receive Item) */
@keyframes undo-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(72, 187, 120, 0);
    }

    50% {
        transform: scale(1.2);
        box-shadow: 0 0 20px rgba(72, 187, 120, 0.6);
        background-color: #48bb78;
        color: white;
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(72, 187, 120, 0);
    }
}

.undo-btn-pulse {
    animation: undo-pulse 0.6s ease-in-out;
}

/* 4. Page/Form Transitions */
.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.fade-in {
    opacity: 1;
    animation: fadeIn 0.4s ease-in forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}