body {
    width: 100%;
    height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    flex-direction: row;
    justify-content: center;
    background-color: black;
    overflow: hidden;
}

.container {
    width: fit-content;
    height: 565px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

h1 {
    margin: 0;
    font-size: 16px;
    font-family: 'Courier New', Courier, monospace;
    align-self: flex-end;
    color: orange;
}

footer {
    width: calc(100% - 48px);
    height: fit-content;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 6px;
    margin-bottom: 24px;
}

footer img {
    width: 24px;
    height: 24px;
}

.calculator-box {
    width: calc(288px + 48px);
    height: fit-content;
    background-color: rgb(129, 152, 158);
    border-radius: 20px;
    display: flex;
    align-items: center;
    flex-direction: column;
}

.screen-box {
    display: flex;
    width: calc(100% - 48px);
    margin: 24px;
    margin-bottom: 5px;
    border-radius: 20px 20px 0 0;
    overflow: auto;
}

#calculator {
    width: auto;
    min-width: 100%;
    display: inline;
    background-color: white;
    font-size: 24px;
    text-align: right;
    border: none;
    pointer-events: none;
    padding: 12px 12px;
    font-family: "Roboto", serif;
    font-weight: 500;
}

.big-screen {
    font-size: 24px;
}

.preview-box {
    width: calc(100% - 48px);
    height: 24px;
    background-color: white;
    display: flex;
    justify-content: flex-end;
    gap: 24px;
    border-radius: 4px;
    margin: 0;
    margin-top: 0px;
}

.preview-box p {
    font-size: 14px;
    padding: 4px 0;
    margin: 0;
    margin-right: 12px;
    color: rgba(128, 128, 128, 1);
    font-family: 'Courier New', Courier, monospace;
}

.screen-box::-webkit-scrollbar {
    width: 12px; /* Larghezza della scrollbar */;
    height: 20px;
}

.screen-box::-webkit-scrollbar-thumb {
    background-color: rgb(129, 152, 158); /* Colore del pollice della scrollbar */
    border: 2px solid white;
    border-radius: 0 0 20px 20px; /* Bordo arrotondato del pollice */
}

.screen-box::-webkit-scrollbar-track {
    background: #f1f1f1; /* Colore della traccia della scrollbar */
    border-radius: 0 0 20px 20px;
}

.buttons-box {
    width: calc(100% - 48px);
    height: fit-content;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    margin: 24px;
    grid-gap: 16px;
}

button {
    background-color: white;
    width: 60px;
    height: 60px;
    align-self: center;
    justify-self: center;
    font-size: 36px;
    border: none;
    border-radius: 50%;
    user-select: none;
    outline: none;
    transition: all 0.1s;
}

button:focus-visible {
    display: none;
}

button:hover {
    background-color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transform: scale(1.1);
}

.c-button-box {
    width: 100%;
    display: flex;
    justify-content: space-around;
    gap: 16px;
    grid-column: span 4;
    justify-self: end;
}

.btn-canc {
    font-size: 16px;
}

.history-open {
    height: 100%;
}

.btn-history {
    height: 100%;
    border-radius: 20px;
    width: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.btn-history p {
    margin: 15px;
    width: 100%;
    text-align: center;
}

.btn-history:hover {
    background-color: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
    cursor: unset;
}

.history-box {
    height: 100%;
    width: 280px;
    border-radius: 20px;
    background-color: rgb(129, 152, 158);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.history-box ul {
    list-style-type: none;
    padding: 20px 20px 20px 20px;
    margin: 0;
    font-size: 18px;
    height: 100%;
    width: calc(100% - 40px);
    overflow: scroll;
    overflow-x: hidden;
}

.history-box ul li {
    margin: 8px 0;
    padding: 8px;
    border-radius: 12px;
    background-color: white;
    width: 90%;
    display: flex;
    font-family: "Roboto", serif;
    font-weight: 500;
    justify-content: space-between;
    align-items: center;
    overflow-y: hidden;
    overflow-x: auto;
    white-space: nowrap; /* Prevent text wrapping */
}

.history-box ul::-webkit-scrollbar {
    width: 20px; /* Larghezza della scrollbar */;
}

.history-box ul::-webkit-scrollbar-thumb {
    background-color: rgb(129, 152, 158); /* Colore del pollice della scrollbar */
    border-left: 1px solid white;
    border-radius: 0 20px 20px 0; /* Bordo arrotondato del pollice */
}

.history-box ul::-webkit-scrollbar-track {
    background: whitesmoke; /* Colore della traccia della scrollbar */
    border-radius: 0 20px 20px 0;
}

.history-box ul li::-webkit-scrollbar {
    height: 12px;
}

.history-box ul li::-webkit-scrollbar-thumb {
    background-color: rgb(129, 152, 158); /* Colore del pollice della scrollbar */
    border: none;
    border: 1px solid white;
    border-radius: 0 0 12px 12px; /* Bordo arrotondato del pollice */
}

.history-box ul li::-webkit-scrollbar-track {
    background: whitesmoke; /* Colore della traccia della scrollbar */
    border-radius: 0 0 12px 12px;
}

.history-list li:hover {
    background-color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transform: scale(1.05);
}

/* animations */

@keyframes button-click {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

button:active {
    animation: button-click 0.1s;
    -webkit-box-shadow: 0px 0px 6px 6px rgba(185, 185, 185, 0.8);
    -moz-box-shadow: 0px 0px 6px 6px rgba(185, 185, 185, 0.8);
    box-shadow: 0px 0px 6px 6px rgba(185, 185, 185, 0.8);
}

.active {
    animation: button-click 0.1s;
    -webkit-box-shadow: 0px 0px 6px 6px rgba(185, 185, 185, 0.8);
    -moz-box-shadow: 0px 0px 6px 6px rgba(185, 185, 185, 0.8);
    box-shadow: 0px 0px 6px 6px rgba(185, 185, 185, 0.8);
}

@media (min-width: 1921px) {
    .calculator-box {
        width: 424px;
    }

    #calculator {
        font-size: 28px;
    }

    button {
        width: 80px;
        height: 80px;
        font-size: 46px;
    }

    .btn-canc {
        font-size: 20px;
    }

    .container {
        height: 669px;
    }
}

