/**
 * WP Stories FilePond Animation Styles
 * Smooth transitions for file replacement
 */

/* Loading overlay for FilePond during replacement */
.filepond--root.filepond--replacing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
}

.filepond--root.filepond--replacing::after {
    content: 'Updating image...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 101;
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

/* Smooth transitions for file items */
.filepond--item {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.filepond--item.filepond--fade-out {
    opacity: 0;
    transform: scale(0.95);
}

.filepond--item.filepond--fade-in {
    animation: fadeInScale 0.4s ease forwards;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pulse animation for the edit button while processing */
.filepond--action-edit-item.processing {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* Smooth preview image transition */
.filepond--image-preview {
    transition: opacity 0.3s ease;
}

/* Loading spinner */
.filepond-loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #333;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success checkmark animation */
.filepond--item.filepond--success .filepond--file-info::after {
    content: '✓';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #4CAF50;
    font-size: 20px;
    animation: checkmarkPop 0.3s ease;
}

@keyframes checkmarkPop {
    0% {
        transform: translateY(-50%) scale(0);
    }
    50% {
        transform: translateY(-50%) scale(1.2);
    }
    100% {
        transform: translateY(-50%) scale(1);
    }
}