/* Full Screen Rainbow Loader Animation */
/* Based on CodePen: https://codepen.io/callmenick/pen/ZWMOEE */
/* Version: 3.0 - All 7 colors with proper delays */

.rainbow-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #34495e;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.rainbow-loader-overlay.show {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s;
}

.Rainbow {
    position: relative;
    display: block;
    overflow: hidden;
    margin: 0 auto 3rem;
    width: 28rem;
    height: 14rem;
}

.Rainbow-stripe {
    position: absolute;
    right: 0;
    left: 0;
    display: block;
    margin: 0 auto;
    border-radius: 100%;
    transform: rotate(-180deg);
    animation: none;
}

.Rainbow-stripe--violet {
    top: 7rem;
    width: 14rem;
    height: 14rem;
    box-shadow: inset 0 0 0 1rem #9b59b6;
    clip-path: polygon(0 0, 14rem 0, 14rem 7rem, 0 7rem, 0 0);
}

.rainbow-loader-overlay.show .Rainbow-stripe--violet {
    animation: rainbow 3000ms cubic-bezier(0.86, 0, 0.07, 1) 0s infinite !important;
}

.Rainbow-stripe--indigo {
    top: 6rem;
    width: 16rem;
    height: 16rem;
    box-shadow: inset 0 0 0 1rem #8e44ad;
    clip-path: polygon(0 0, 16rem 0, 16rem 8rem, 0 8rem, 0 0);
}

.rainbow-loader-overlay.show .Rainbow-stripe--indigo {
    animation: rainbow 3000ms cubic-bezier(0.86, 0, 0.07, 1) 0.1s infinite !important;
}

.Rainbow-stripe--blue {
    top: 5rem;
    width: 18rem;
    height: 18rem;
    box-shadow: inset 0 0 0 1rem #3498db;
    clip-path: polygon(0 0, 18rem 0, 18rem 9rem, 0 9rem, 0 0);
}

.rainbow-loader-overlay.show .Rainbow-stripe--blue {
    animation: rainbow 3000ms cubic-bezier(0.86, 0, 0.07, 1) 0.2s infinite !important;
}

.Rainbow-stripe--green {
    top: 4rem;
    width: 20rem;
    height: 20rem;
    box-shadow: inset 0 0 0 1rem #2ecc71;
    clip-path: polygon(0 0, 20rem 0, 20rem 10rem, 0 10rem, 0 0);
}

.rainbow-loader-overlay.show .Rainbow-stripe--green {
    animation: rainbow 3000ms cubic-bezier(0.86, 0, 0.07, 1) 0.3s infinite !important;
}

.Rainbow-stripe--yellow {
    top: 3rem;
    width: 22rem;
    height: 22rem;
    box-shadow: inset 0 0 0 1rem #f1c40f;
    clip-path: polygon(0 0, 22rem 0, 22rem 11rem, 0 11rem, 0 0);
}

.rainbow-loader-overlay.show .Rainbow-stripe--yellow {
    animation: rainbow 3000ms cubic-bezier(0.86, 0, 0.07, 1) 0.4s infinite !important;
}

.Rainbow-stripe--orange {
    top: 2rem;
    width: 24rem;
    height: 24rem;
    box-shadow: inset 0 0 0 1rem #e67e22;
    clip-path: polygon(0 0, 24rem 0, 24rem 12rem, 0 12rem, 0 0);
}

.rainbow-loader-overlay.show .Rainbow-stripe--orange {
    animation: rainbow 3000ms cubic-bezier(0.86, 0, 0.07, 1) 0.5s infinite !important;
}

.Rainbow-stripe--red {
    top: 1rem;
    width: 26rem;
    height: 26rem;
    box-shadow: inset 0 0 0 1rem #e74c3c;
    clip-path: polygon(0 0, 26rem 0, 26rem 13rem, 0 13rem, 0 0);
}

.rainbow-loader-overlay.show .Rainbow-stripe--red {
    animation: rainbow 3000ms cubic-bezier(0.86, 0, 0.07, 1) 0.6s infinite !important;
}

@keyframes rainbow {
    0% {
        transform: rotate(-180deg);
    }
    50% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(-180deg);
    }
}

/* Loading message */
.rainbow-message {
    color: white;
    font-size: 1.8rem;
    font-weight: 600;
    text-align: center;
    font-family: var(--subheading-font, 'Patrick Hand', cursive);
    opacity: 0;
    max-width: 600px;
    padding: 0 20px;
}

.rainbow-loader-overlay.show .rainbow-message {
    animation: fadeInMessage 0.8s ease 1.2s forwards;
}

@keyframes fadeInMessage {
    to {
        opacity: 1;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .Rainbow {
        width: 20rem;
        height: 10rem;
    }
    
    .Rainbow-stripe--violet {
        top: 5rem;
        width: 10rem;
        height: 10rem;
        clip-path: polygon(0 0, 10rem 0, 10rem 5rem, 0 5rem, 0 0);
    }
    
    .Rainbow-stripe--indigo {
        top: 4.286rem;
        width: 11.429rem;
        height: 11.429rem;
        clip-path: polygon(0 0, 11.429rem 0, 11.429rem 5.714rem, 0 5.714rem, 0 0);
    }
    
    .Rainbow-stripe--blue {
        top: 3.571rem;
        width: 12.857rem;
        height: 12.857rem;
        clip-path: polygon(0 0, 12.857rem 0, 12.857rem 6.429rem, 0 6.429rem, 0 0);
    }
    
    .Rainbow-stripe--green {
        top: 2.857rem;
        width: 14.286rem;
        height: 14.286rem;
        clip-path: polygon(0 0, 14.286rem 0, 14.286rem 7.143rem, 0 7.143rem, 0 0);
    }
    
    .Rainbow-stripe--yellow {
        top: 2.143rem;
        width: 15.714rem;
        height: 15.714rem;
        clip-path: polygon(0 0, 15.714rem 0, 15.714rem 7.857rem, 0 7.857rem, 0 0);
    }
    
    .Rainbow-stripe--orange {
        top: 1.429rem;
        width: 17.143rem;
        height: 17.143rem;
        clip-path: polygon(0 0, 17.143rem 0, 17.143rem 8.571rem, 0 8.571rem, 0 0);
    }
    
    .Rainbow-stripe--red {
        top: 0.714rem;
        width: 18.571rem;
        height: 18.571rem;
        clip-path: polygon(0 0, 18.571rem 0, 18.571rem 9.286rem, 0 9.286rem, 0 0);
    }
    
    .rainbow-message {
        font-size: 1.4rem;
    }
}

