/**
 * CF7 Button Spinner - Loader10 Animation
 * Based on SpinThatShit loader10
 */

/* Hide default CF7 spinner */
.wpcf7 .wpcf7-spinner {
    display: none !important;
}

/* Button base styles for loading states */
.wpcf7-submit.is-loading,
.wpcf7-submit.is-accessing {
    position: relative;
    padding-right: 70px !important;
    pointer-events: none;
    cursor: not-allowed;
}

/* Loader10 animation - three dots with shadow effect */
.wpcf7-submit.is-loading::before,
.wpcf7-submit.is-loading::after,
.wpcf7-submit.is-accessing::before,
.wpcf7-submit.is-accessing::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ffffff;
}

/* First and third dots using box-shadow */
.wpcf7-submit.is-loading::before,
.wpcf7-submit.is-accessing::before {
    right: 50px;
    transform: translateY(-50%);
    box-shadow: 
        16px 0 0 0 rgba(255, 255, 255, 0.2),
        32px 0 0 0 rgba(255, 255, 255, 0.2);
    animation: loader10-before 2s infinite ease-in-out;
}

/* Middle dot */
.wpcf7-submit.is-loading::after,
.wpcf7-submit.is-accessing::after {
    right: 34px;
    transform: translateY(-50%);
    animation: loader10-after 2s infinite ease-in-out;
}

/* Animations */
@keyframes loader10-before {
    0%, 80%, 100% {
        box-shadow: 
            16px 0 0 0 rgba(255, 255, 255, 0.2),
            32px 0 0 0 rgba(255, 255, 255, 0.2);
    }
    25% {
        box-shadow: 
            16px 0 0 0 #ffffff,
            32px 0 0 0 rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow: 
            16px 0 0 0 rgba(255, 255, 255, 0.2),
            32px 0 0 0 #ffffff;
    }
}

@keyframes loader10-after {
    0%, 80%, 100% {
        transform: translateY(-50%) scale(0.8);
        opacity: 0.5;
    }
    25%, 50% {
        transform: translateY(-50%) scale(1);
        opacity: 1;
    }
}

/* Additional visual feedback */
.wpcf7-submit.is-loading {
    opacity: 0.9;
}

.wpcf7-submit.is-accessing {
    background-color: #4CAF50 !important; /* Success green */
    border-color: #4CAF50 !important;
}