

/*
Styling for the background, size and overall look of the text box.
*/

.textbox {
    cursor: pointer;

    margin: 0px;
    padding: 0px;
    font-family: 'Courier New', Courier;


    bottom: 5px;
    position: absolute;
    padding-left: 10vw;
    padding-right: 10vw;
    padding-top:0px;
    padding-bottom: 0px;
    min-height: 150px;
    max-height: 90vh;

    width: calc(100% - 20vw - 10px);
    border-radius: 20px;

    background: linear-gradient(0deg, rgb(28, 28, 28) 1%, rgba(30, 30, 30, 0.916)66%);
    

    color: white;
    border-color: rgb(76, 76, 76);
    border-width: 5px;
    border-style: double;
    
    overflow: hidden;
    
    box-shadow: inset 0em 0em 60px rgba(0, 0, 0, 0.87);
    position: fixed;
    z-index: 4;
    right:0px;
}


/*
Styling for when the box contains choices instead of speech.
*/
.textbox:has(button) {
    cursor: default;
}


/*
Name of speaeker styling
*/
.textbox-label {
    text-align: center;
    left: 5vw;
    padding: 20px;
    padding-bottom: 5px;
    font-size: x-large;
    margin-bottom: 1em;
    font-weight: bold;
}


/*
Styling for the section of text box under the name that holds the text itself
*/
#active-text {
    scroll-behavior:auto;
    max-height: calc(70vh - 200px);
    height: 100%;
    width: 100%;
    overflow: auto;
    font-size: larger;
    display: flex;
    align-items: left;
    justify-content: space-evenly;
    flex-direction: column;
  
}

/*
Animation for the text box appearing or disappearing when activated.
*/
.active {
    animation: show 0.2s ease-out;

}

.hidden {
    animation: hide 0.2s ease-out;

}



/*
Examples of classes that could be embedded into text boxes
for animated text styling.
*/
.jitter {
    animation: jitter 0.2s linear infinite;
}


.jitter2 {
    animation: jitter2 0.2s linear infinite;
}




/*
Styling for text choices when they're presented to the user
*/


.text-box-button {
    background-color:rgba(233, 237, 242, 0);
    color: rgba(255, 255, 255, 0.787);
    bottom: 1vw;
    padding: 0.5em;
    margin: 0.5em;
    font-size: larger;
    border-style: none;
    cursor: pointer;
    text-justify: left;
    text-align: left;
    font-family: 'Courier New', Courier, monospace;

}


.text-box-button:hover{
    color:rgba(255, 255, 255, 0.931);
    text-emphasis: bold;
    font-weight: bolder;

}

.text-box-button:before {
    content:"> ";
}



/*
Styling for havin the text letters appear one by one.
*/

.next {
    position: fixed;
    right: 50px;
    bottom: 30px;
    animation: blink-fade 2s infinite linear;
}


/*Hides text/ the next icon before it's time for it to show*/
.invisible {
    opacity: 0%;
    position: fixed;
    right: 50px;
    bottom: 30px;
}


.inner-text {
    display: inline;
}



/*
This styling is a wip for sprites while talking and
animating entrances and exits.
*/

#speaking-sprite {
    place-self: 0px 0px;
    position: absolute;
    min-height: 100%;
}

.entering-sprite {
    animation: slide-out 1s ease-in;

}

.leaving-sprite {
    transition:slide-out 0.5s ease-in
}



/*
Styling is for the blurring div behind the text box 
when active and the animation for it coming in and out of focus. 
*/

.focussed {
    width:0px;
    height: 0px;
    animation: fade-out 3s;
    transition: unfocussed 2s linear;
    position: fixed;
    z-index: 2;
}

.focussing {
    position: absolute;
    width: 110%;
    height: 100%;
    background-color: rgba(235, 235, 235, 0.359);
    opacity: 0;
    transition: opacity 0.5s linear;
    position: fixed;
    z-index: 2;

    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px)!important;

}

.unfocussed {
    position: absolute;
    width: 110%;
    height: 100%;
    background-color: rgba(196, 209, 225, 0.456);
    animation: fade-in 1.25s linear;
    position: fixed;
    z-index: 2;

    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px)!important;
}



#current-image {
    z-index: 3;
    position: fixed;
    top: 0px;
    height: 100vh;
}

.img-hidden {
    transform: scale(0);
}

.img-enter  {
    animation: slide-in 1s ease-in-out ;
}
.img-leave  {
    animation: slide-out .5s ease-in-out ;
}


/*
ANIMATIONS
*/

@keyframes fade-in {
    0% { opacity: 0;}
    100% { opacity: 1;}
    
  }

@keyframes fade-out {
    0% { opacity: 1;}
    100% { opacity: 0;}
    
}


@keyframes show {
    0% { transform: scale(100%, 0%);}
    100% { transform: scale(0px, 0px);}
    
  }

@keyframes hide {
    0% { transform: scale(0px, 0px);}
    100% { transform: scale(100%, 0%);}
    
}

@keyframes slide-in {
    0% { 
        opacity: 0;
        filter: brightness(0);
    }
    25% { 
        filter: brightness(0);
    }
    100% { 
        opacity: 1;
        filter: brightness(1);
    }
    
}

@keyframes slide-out {
    0% { 
        opacity: 1;
        filter: brightness(1)
    }
    25% { 
        filter: brightness(0);
    }
    100% { 
        opacity: 0;
        filter: brightness(0)
    }
    
}

@keyframes jitter {
    0% { transform: translate(0px, 0px);}
    20% { transform: translate(1px, 2px);}
    40% { transform: translate(-1px, -2px);}
    70% { transform: translate(-3px, 5px);}
    100% { transform: translate(0px, 0px);}
    
  }


@keyframes jitter2 {
    0% { transform: translate(0px, 0px);}
    20% { transform: translate(2px, 4px);}
    40% { transform: translate(-2px, -4px);}
    70% { transform: translate(-6px, 10px);}
    100% { transform: translate(0px, 0px);}
    
}


@keyframes blink-fade {
    0% { opacity: 0%;}
    25% { opacity: 75%;}
    50% { opacity: 100%;}
    75% { opacity: 75%;}
    100% { opacity: 0%;}
    
}

.interactable :hover {
    animation: highlight-loop 2s ease-in-out infinite !important;
}


@keyframes highlight-loop {
    0% { 
        filter: brightness(0) contrast(0);}
    50% { 
        filter: brightness(1) contrast(.2);}
    100% { 
        filter: brightness(0) contrast(0);}
    
  }
