html{
    font-size: clamp(40px, 8vw, 55px);
}
body{
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #F5F7FF;
    margin: 0;
    padding: 0;
}
.container{
    display: flex;
    padding: 0px;
    width: 60vw;
    height: calc(100vh - 100px);
    position: relative;
    border: 5px solid transparent;
    border-radius: 45px 25px 25px 45px;
}
/* Styles for screens smaller than 768px */
@media (max-width: 768px) {
    .container {
        flex-direction: column-reverse; 
        width: 90vw;
        height: 90vh;
    }
}
.calculator {
    box-shadow: 0 0 5px;
    border: 2px solid rgba(0,0,0,0.05);
    background-color: white;
    z-index: 1000;
    padding: 30px 20px;
    border-radius: 40px;
    box-sizing: border-box;
    align-self: stretch;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(6,1fr);
    grid-auto-flow: row;
    gap: 10px;
    width: 50%;
    /* Translation */
    position: relative;
    left: 50%;
    translate: -50%;
    transition:1000ms ease;
}
@media (max-width: 768px) {
    .calculator {
        flex-direction: column-reverse; 
        width: auto;
        height: 70%;
        left: 0%;
        bottom: 15%;
        translate: 0; 
    }
}
.display {
    grid-column: span 4;
    overflow: hidden;
    white-space: nowrap;
    display: flex;
    background-color: #2388FF;
    justify-content: right;
    align-items: center;
    box-sizing: border-box;
    border-radius: 100px;
    color: white;
    font-family: "Lexend Exa", serif;
    font-weight: normal;
    letter-spacing: -2px;
    padding-right: 0.2em;
    margin-bottom: 0.1em;
    min-height: 1.2em;
    font-size: 1rem;
    box-shadow: inset 0px 0px 10px 1px rgba(0, 0, 0, 0.337);
}
.key{
    background-color: #D8DDF0;
    color: #6E7691;
    border-radius: 100px;
    border: none;
    box-shadow: 0px 3px 0px 0px rgba(0,0,0,0.1);
    font-size: 0.6rem;
    font-family: "Lexend Exa", serif;
    font-weight: bolder;
    display: flex;
    position: relative;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
    /* min-height: 2.5em; */
}
@media (max-width: 768px) {
    .key {
        font-size: 0.7rem;
    }
}
.history{
    /* align-self: stretch; */
    display: flex;
    flex-direction: column;
    width: 50%;
    height: 100%;
    font-family: "Lexend Exa", serif;
    font-size: 1rem;
    font-weight: bold;
    color: rgb(91, 91, 91);
    border-radius: 40px;
    background-color: #c8c8c8;
    box-sizing: border-box;
    padding: 0.6rem 20px 20px 20px;
    overflow-y: scroll;
    overflow-x: hidden;
    position: relative;
    translate: -50%;
    transition: 1000ms ease;
}
@media (max-width: 768px) {
    .history {
        flex-direction: column-reverse;
        width: auto;
        height: 30%;
        top: 15%;
        translate: 0;
    }
}
.history::-webkit-scrollbar {
    display: block;
    width: 10px;
}
.history::-webkit-scrollbar-track {
    background: transparent;
}
.history::-webkit-scrollbar-thumb {
    background-color: #2388FF;
    border-radius: 100px;
}
.history::-webkit-scrollbar-track-piece:end {
    background: transparent;
    margin-bottom: 40px; 
}
.history::-webkit-scrollbar-track-piece:start {
    background: transparent;
    margin-top: 40px;
}
.operation {
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
    z-index: 100;
    font-size: 0.9rem;
    padding: 0.1rem 0;
}
.separate{
    border-top: 1px solid rgba(0, 0, 0, 0.253);
    border-bottom: none;
}
@media (max-width: 768px) {
    .operation {
        justify-content: flex-end;
    }
    .separate{
        border-top: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.253);
    }
}
.operand {
    font-family: "Lexend Exa", serif;
    font-weight: bold;
    position: relative;
    /* font-size: 50px; */
}
.operand-box{
    border: 2px dashed rgba(91, 91, 91, 0.675);
    border-radius: 5px;
}
.operator{
    font-family: "Lexend Exa", serif;
}
.number-box{
    border: 2px dashed rgba(91, 91, 91, 0.675);
    border-radius: 5px;
}
.prev-operation{
    font-family: "Lexend Exa", serif;
    font-size: 0.5rem;
    font-weight: bold;
}
.shine-container{
    animation: shine-container 0.8s ease-in-out;
}
@keyframes shine-container {
    0% {
        color: gray;
        border-color: transparent;
    }
    50% {
        border-color: #63DE77;
    }
    100% {
        border-color: transparent; 
    }
}
.shine-equal{
    animation: shine-equal 0.8s  ease-in-out;
}
@keyframes shine-equal{
    0% {
    }
    50% {
        color: #63DE77;
    }
    100% {
        color: gray; 
    }
}
.arrow-toggle > img{
    height: 40px;
}
.container > .history{/*:hover*/
    border-radius: 20px;
    translate: 0;
}
@media (max-width: 768px) {
    .container > .history {
        top: 0%;
        translate: 0;
    }
}
.container > .calculator{
    left: 0;
    translate: 0;
}
@media (max-width: 768px) {
    .container > .calculator {
        bottom: 0%;
    }
}
.container > .arrow-toggle{
    left: 98%;
}
@media (max-width: 768px) {
    .container > .arrow-toggle {
        top: 1%;
        left: 50%;
    }
}
.key:hover{
    cursor: pointer;
}
.key:active{
    box-shadow: none;
    top: 2px;
}
.key.div{
    background-color: #FF445A;
}
.key.sum{
    background-color: #63DE77;
}
.key.sub{
    background-color: #FFC804;
}
.key.mult{
    background-color: #2388FF;
}
.key.equal{
    background-color: #F5F7FF;
}
.key.percent{
    background-color: #F5F7FF;
}   
.key.root{
    background-color:  #F5F7FF;
}
.key.ce{
    background-color:  #1F2B54;
    color: white;
}
.key .root{
    width: 0.8rem;
}
.key img{
    width: 0.9rem;
}
.aux{
    /* border: 3px solid blue; */
    background-color: #c8c8c8;
    width: 20%;
    height: 100%;
    z-index: -100;
    border: 2px solid rgba(0,0,0,0.05);
    box-sizing: border-box;
    position: absolute;
    display: flex;
    left: 50%;
    translate: -50%;
}
@media (max-width: 768px) {
    .aux {
        width: 100%;
        height: 15%;
        top: 20%;
    }
}
.arrow-toggle{
    padding: 10px 10px;
    background-color: #c8c8c8;
    border: none;
    border-radius: 0 10px 10px 0;
    position: absolute;
    top: 50%;
    left: 75%;
    translate: 0 -50%;
    transition: 1000ms ease;
    z-index: -100;
}
@media (max-width: 768px) {
    .arrow-toggle {
        top: 15%;
        left: 50%;
        translate: -50% -100%;
        transform: rotate(-90deg);
    }
}