/**
 * JetFormBuilder Loading Animation
 * Enhanced loading spinner for form submissions
 */
form.jet-form-builder.is-loading{opacity: 1;}

/* Expand text background to cover full screen */
.jet-form-builder.is-loading .loading {
    content: "Adding to the database. Please wait…";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.jet-form-builder.is-loading .loading::before {
  content: "Adding to the database. Please wait…";
  margin-top: -90px;
}
/* Outer red spinner using spinning div :before */
.jet-form-builder.is-loading .loading .spinning::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -28px;
    margin-left: -28px;
    width: 56px;
    height: 56px;
    border: 2px solid transparent;
    border-top-color: #e74c3c;
    border-right-color: #e74c3c;
    border-radius: 50%;
    animation: jetfb-spinner-rotate 2s linear infinite;
    -webkit-animation: jetfb-spinner-rotate 2s linear infinite;
    -moz-animation: jetfb-spinner-rotate 2s linear infinite;
    -o-animation: jetfb-spinner-rotate 2s linear infinite;
    z-index: 1;
}

/* Inner blue spinner using spinning div :after */
.jet-form-builder.is-loading .loading .spinning::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -22px;
    margin-left: -22px;
    width: 44px;
    height: 44px;
    border: 2px solid transparent;
    border-top-color: #3498db;
    border-right-color: #3498db;
    border-radius: 50%;
    animation: jetfb-spinner-rotate 1s linear infinite;
    -webkit-animation: jetfb-spinner-rotate 1s linear infinite;
    -moz-animation: jetfb-spinner-rotate 1s linear infinite;
    -o-animation: jetfb-spinner-rotate 1s linear infinite;
    z-index: 2;
}


/* Keyframes for rotation animation */
@keyframes jetfb-spinner-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@-webkit-keyframes jetfb-spinner-rotate {
    0% {
        -webkit-transform: rotate(0deg);
    }
    100% {
        -webkit-transform: rotate(360deg);
    }
}

@-moz-keyframes jetfb-spinner-rotate {
    0% {
        -moz-transform: rotate(0deg);
    }
    100% {
        -moz-transform: rotate(360deg);
    }
}

@-o-keyframes jetfb-spinner-rotate {
    0% {
        -o-transform: rotate(0deg);
    }
    100% {
        -o-transform: rotate(360deg);
    }
}

/* Optional: Add a semi-transparent overlay */
.jet-form-builder.is-loading {
    position: relative;
}

.jet-form-builder.is-loading .jet-form-builder__submit {
    opacity: 0.8;
    pointer-events: none;
}

/* Prevent scrolling during loading */
body:has(.jet-form-builder.is-loading) {
    overflow: hidden;
}

/* Custom properties for easy theming */
:root {
    --jetfb-loader-primary: #3498db;
    --jetfb-loader-secondary: #e74c3c;
    --jetfb-loader-size-small: 44px;
    --jetfb-loader-size-large: 56px;
}

/* Alternative color scheme - uncomment to use */
/*
.jet-form-builder.is-loading::before {
    border-top-color: var(--jetfb-loader-primary);
    border-right-color: var(--jetfb-loader-primary);
}

.jet-form-builder.is-loading::after {
    border-top-color: var(--jetfb-loader-secondary);
    border-right-color: var(--jetfb-loader-secondary);
}
*/