/* Container for the loading spinner animation */
#spinnerContainer {
    position: absolute;
    left: 50%;
    top: 80%; /* Reduce this value by very small percentages to move dots up closer to the bar */
    /*width: 100%;*/
    max-width: 10%;
    height: 100%;
    max-height: 8%;
    /* Transparent background */
    background: rgba(0, 0, 0, 0) none;
}

/* Animation dots container - holds the moving elements */
.lds-ellipsis {
    display: block;
    position: absolute;
    z-index: 19; /* Ensures it appears above other elements */
    /* Centers the element horizontally and vertically */
    -webkit-transform: translateX(-50%);
    -ms-transform: translateX(-50%) translateY(-50%);
    transform: translateX(-50%) translateY(-50%);
    width: 120px;
    height: 80px;
    background: rgba(0, 0, 0, 0); /* Transparent background */
}

/* Main container for the entire preloader screen */
#fantasma-preloader-container {
    width: 100%;
    height: 100%;
    position: fixed;
    background: rgb(75, 12, 57);
    background: radial-gradient(circle, rgb(170, 0, 0) 0%, rgb(128, 0, 66) 37%, rgb(74, 0, 66) 100%);
}

/* Animation class for fading elements in */
#fade-in {
    -webkit-animation: fade-in 2s ease-out forwards;
    animation: fade-in 2s ease-out forwards;
}

/* Background image container (Game logo) */
#preloader-bg {
    width: 100%;
    height: 100%;
    top: -12px;
    position: absolute;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* Preloader generic container */
#preloader {
    width: 100%;
    height: 100%;
    position: absolute;
}

/* Loading text styling */
#loadingText {
    max-width: 50%;
    height: 3%
}

/* Company logo positioning at bottom of screen */
#corpLogo {
    position: absolute;
    transform: translateX(-50%);
    left: 50%;
    bottom: 2%;
    max-height: 15%;
    max-width: 30%;
}

/* Common positioning for loading elements */
#loadingText, #barBg, #progress {
    position: absolute;
    left: 50%;
    top: 72%;
    max-height: 8%;
    /* Centers elements horizontally and vertically */
    -webkit-transform: translateX(-50%) translateY(-50%);
    -ms-transform: translateX(-50%) translateY(-50%);
    transform: translateX(-50%) translateY(-50%);
}

/* Common styles for loading bar elements */
#barBg, #progress {
    width: 50%;
    border-radius: 1.2em; /* Rounded corners */
    display: grid;
    -webkit-animation: fade-in 1s ease-out;
    animation: fade-in 1s ease-out;
}

/* Loading bar background styling */
#barBg {
    height: 3.1%;
    border: 3px solid #803300; /* Orange border */
    border-radius: 2em;
    /* Dark gradient background */
    background: radial-gradient(ellipse at top, #300, #621),
    radial-gradient(ellipse at bottom, #200, #511);
    /* Orange glow effect */
    -webkit-box-shadow: 0 0 25px rgba(255, 140, 0, 0.4);
    box-shadow: 0 0 25px rgba(255, 140, 0, 0.4),
    inset 0 0 15px rgba(255, 140, 0, 0.2);
}

/* Progress bar styling (green glowing bar) */
#progress {
    left: 10%;
    -webkit-transform: translate(0, -50%);
    -ms-transform: translate(0, -50%);
    transform: translate(0, -50%);
    height: 3%;
    width: 30%;
    border: 3px solid rgba(0, 255, 157, 0.5); /* Green border */
    border-radius: 2em;
    mix-blend-mode: screen; /* Makes the glow effect blend with background */
    /* Green glow effect */
    -webkit-box-shadow: 0 0 20px rgba(0, 255, 157, 0.5);
    box-shadow: 0 0 20px rgba(0, 255, 157, 0.5),
    inset 0 0 15px rgba(255, 255, 255, 0.3);
    /* Green gradient background */
    background: radial-gradient(ellipse closest-corner at center,
    #00ff9d,
    #00986b
    );
}

/* Animation dots styling */
.lds-ellipsis div {
    position: absolute;
    width: 88px;
    height: 50px;
    background-image: url("tick.png");
    background-repeat: no-repeat;
    background-position: center;
    /* Smooth animation timing */
    -webkit-animation-timing-function: cubic-bezier(0, 1, 1, 0);
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

/* Position and animation for each dot */
.lds-ellipsis div:nth-child(1) {
    left: -60px;
    -webkit-animation: lds-ellipsis1 0.6s infinite;
    animation: lds-ellipsis1 0.6s infinite;
}

.lds-ellipsis div:nth-child(2) {
    left: -60px;
    -webkit-animation: lds-ellipsis2 0.6s infinite;
    animation: lds-ellipsis2 0.6s infinite;
}

.lds-ellipsis div:nth-child(3) {
    left: 10px;
    -webkit-animation: lds-ellipsis2 0.6s infinite;
    animation: lds-ellipsis2 0.6s infinite;
}

.lds-ellipsis div:nth-child(4) {
    left: 80px;
    -webkit-animation: lds-ellipsis3 0.6s infinite;
    animation: lds-ellipsis3 0.6s infinite;
}

/* Animation definitions */
/* Fade in animation */
@-webkit-keyframes fade-in {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes fade-in {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Small entrance animation */
@-webkit-keyframes enter-in-small {
    0% {
        -webkit-transform: translate(-50%, -20%);
        transform: translate(-50%, -20%);
        opacity: 0;
    }
    100% {
        -webkit-transform: translate(-50%, 0);
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes enter-in-small {
    0% {
        -webkit-transform: translate(-50%, -20%);
        transform: translate(-50%, -20%);
        opacity: 0;
    }
    100% {
        -webkit-transform: translate(-50%, 0);
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Regular entrance animation */
@-webkit-keyframes enter-in {
    0% {
        -webkit-transform: translate(-50%, 0);
        transform: translate(-50%, 0);
        opacity: 0;
    }
    100% {
        -webkit-transform: translate(-50%, -50%);
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

@keyframes enter-in {
    0% {
        -webkit-transform: translate(-50%, 0);
        transform: translate(-50%, 0);
        opacity: 0;
    }
    100% {
        -webkit-transform: translate(-50%, -50%);
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

/* Loading dots animations */
/* First dot entering */
@-webkit-keyframes lds-ellipsis1 {
    0% {
        -webkit-transform: translate(-120px, 0);
        transform: translate(-120px, 0);
        opacity: 0;
    }
    100% {
        -webkit-transform: translate(0, 0);
        transform: translate(0, 0);
        opacity: 1;
    }
}

@keyframes lds-ellipsis1 {
    0% {
        -webkit-transform: translate(-120px, 0);
        transform: translate(-120px, 0);
        opacity: 0;
    }
    100% {
        -webkit-transform: translate(0, 0);
        transform: translate(0, 0);
        opacity: 1;
    }
}

/* Middle dots moving */
@-webkit-keyframes lds-ellipsis2 {
    0% {
        -webkit-transform: translate(0, 0);
        transform: translate(0, 0);
    }
    100% {
        -webkit-transform: translate(70px, 0);
        transform: translate(70px, 0);
    }
}

@keyframes lds-ellipsis2 {
    0% {
        -webkit-transform: translate(0, 0);
        transform: translate(0, 0);
    }
    100% {
        -webkit-transform: translate(70px, 0);
        transform: translate(70px, 0);
    }
}

/* Last dot exiting */
@-webkit-keyframes lds-ellipsis3 {
    0% {
        -webkit-transform: translate(0, 0);
        transform: translate(0, 0);
        opacity: 1;
    }
    100% {
        -webkit-transform: translate(120px, 0);
        transform: translate(120px, 0);
        opacity: 0;
    }
}

@keyframes lds-ellipsis3 {
    0% {
        -webkit-transform: translate(0, 0);
        transform: translate(0, 0);
        opacity: 1;
    }
    100% {
        -webkit-transform: translate(120px, 0);
        transform: translate(120px, 0);
        opacity: 0;
    }
}
