@import url('https://fonts.googleapis.com/css2?family=Josefin+Sans:ital,wght@0,100..700;1,100..700&display=swap');

body {
    height: 100vh;
    width: 100vw;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    align-content: center;
    margin: 0;
    padding: 0;
    font-family: "Josefin Sans", sans-serif !important;
    font-optical-sizing: auto;
    font-style: normal;
    /* background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); */
    background: linear-gradient(90deg, rgba(192, 28, 192, .459) 100%, #fff 0);
}

.app {
    width: fit-content;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    align-content: center;
}

.frame {
    width: 320px;
    height: fit-content;
    min-width: 320px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    align-content: center;
    perspective: 1000px;
    border-radius: 20px;
    background: #3b3b47;
    box-shadow: 10px 10px 5px 0px rgba(0, 0, 0, 0.75);
    -webkit-box-shadow: 10px 10px 5px 0px rgba(0, 0, 0, 0.75);
    -moz-box-shadow: 10px 10px 5px 0px rgba(0, 0, 0, 0.75);
}

.frame__title {
    width: 100%;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    align-content: center;
    margin-top: 10px;
    margin-bottom: 20px;
}

.frame__title img {
    width: auto;
    height: 30px;
    padding-right: 7.5px;
    margin-right: 7.5px;
    border-right: 1px solid #f2f2f2;
}

.frame__title p {
    font-size: 20px;
    font-weight: bold;
    color: #f2f2f2;
    text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.75);
}

.display {
    width: 100%;

}

.display_screen,
.display_result {
    width: calc(100% - 14px);
}

.display input {
    text-align: right;
    padding: 12px 5px;
    border-radius: 10px;
    border-top: 2px solid #979797;
    border-left: 2px solid #979797;
    border-bottom: 2px solid #e3e3e3;
    border-right: 2px solid #e3e3e3;
    width: 100%;
    font-family: "Josefin Sans", sans-serif;
    font-weight: bold;
    font-size: 23px;
    color: #2c2f24;
}

.display_screen input {
    background: #bccd97;
    box-shadow: 5px 5px 5px 0px rgba(0, 0, 0, 0.75) inset;
    -webkit-box-shadow: 5px 5px 5px 0px rgba(0, 0, 0, 0.75) inset;
    -moz-box-shadow: 5px 5px 5px 0px rgba(0, 0, 0, 0.75) inset;
}

.display_result input {
    background: transparent;
    color: #f2f2f2;
    border: none;
    user-select: none;
    opacity: 0.5;
}

/*
*  Keys
*
*/

.keys {
    width: 100%;
}

.keys__body__left__top {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 15px;
}

.keys__body__left__top__row {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.keys button {
    padding: 15px;
    font-size: 18px;
    color: #333;
    background-color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    background-color: rgba(255, 255, 255, 0.69);
    border-radius: 12px;
    border: 1px solid rgba(209, 213, 219, 0.3);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    font-family: "Josefin Sans", sans-serif;
    font-weight: bold;
}

.keys button:hover {
    background-color: rgb(231, 231, 231, 0.69);
}

.keys__special {
    margin-bottom: 20px;
}

.keys__special button {
    background-color: #c01cc0 !important;
    color: #f2f2f2 !important;
}

.key--operator {
    background-color: #c01cc0 !important;
    color: #f2f2f2 !important;
}

.key--equal {
    background-color: #c01cc0 !important;
    color: #f2f2f2 !important;
}

.key--special {
    display: none;
}

.frame.frame--functions .key--special {
    display: block;
    background-color: #c01cc0 !important;
    color: #f2f2f2 !important;
}

.frame.frame--functions .row--special {
    margin-bottom: 10px;
}

.frame.frame--functions .row--special button {
    padding: 8px 15px;
    font-size: 13px;
}

.frame.frame--functions .keys__body__left__top__row {
    grid-template-columns: repeat(5, 1fr) !important;
}

/**
*  History Panel
*
*/

.history-panel {
    display: none;
    border-radius: 20px;
    width: 320px;
    height: 100%;
    background: rgba(58, 58, 69, 0.9);
    color: white;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    transition: right 0.3s ease;
    z-index: 100;
    overflow-x: hidden;
}

.history-panel--open {
    margin-left: 15px;
}

.history-panel__content {
    padding: 20px;
    width: calc(100% - 40px);
    overflow-y: auto;
}

.history-panel__close {
    font-size: 30px;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
}

.history-panel__items {
    flex-grow: 1;
    margin-top: 20px;
    margin-bottom: 20px;
    overflow-x: hidden;
    max-height: 280px;
    overflow-y: scroll;
}

.history-item-ctn {
    width: calc(100% - 10px);
    /* width: calc(100% - 20px); */
    display: flex;
    justify-content: space-between;
    align-items: center;
    align-content: center;
    flex-direction: row;
    transition: all 0.3s ease;
}

.history-item-ctn:hover .history-item__remove {
    display: flex;
    justify-content: center;
    align-items: center;
    align-content: center;
}

.history-item {
    width: 100%;
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item__question {
    float: left;
    text-align: left;
}

.history-item__answer {
    float: right;
    text-align: right;
    opacity: 0.5;
}

.history-item__remove {
    float: right;
    text-align: right;
    opacity: 0.75;
    cursor: pointer;
    height: 100%;
    transform: translateY(-5px);
    width: 20px;
    margin-left: 5px;
    display: none;
    color: #ec3131da;
    transition: all 0.3s ease;
    z-index: 999999999999;
}

.history-panel__clear {
    padding: 10px;
    font-size: 18px;
    color: white;
    font-family: "Josefin Sans", sans-serif;
    font-weight: bold;
    background: #c01cc0;
    border-radius: 10px;
    border: none;
    width: 100%;
    cursor: pointer;
}


/**
*  Utility
*
*/

textarea:focus,
input:focus {
    outline: none;
}

*::-webkit-scrollbar,
#historyItems::-webkit-scrollbar {
    width: 1px;
    background-color: #5c5665;
}

*::-webkit-scrollbar-track,
#historyItems::-webkit-scrollbar-track {
    border-radius: 5px;
    width: 1px;
    background: transparent;
}

*::-webkit-scrollbar-thumb,
#historyItems::-webkit-scrollbar-thumb {
    background-color: #5c5665;
}

/**
*  MediaQueries
*
*/

@media screen and (max-width: 768px) {
    body {
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .history-panel {
        display: none;
        border-radius: 20px;
        width: 320px;
        height: 100%;
        background: rgba(58, 58, 69, 0.9);
        color: white;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        transition: right 0.3s ease;
        z-index: 100;
        overflow-x: hidden;
        position: absolute;
    }

    .history-panel__items {
        flex-grow: 1;
        display: flex;
        height: 100%;
        flex-direction: column;
    }

    .history-panel__content {
        height: 100%;
    }

    .history-panel--open {
        margin-left: 0px;
    }
}

@media screen and (max-width: 320px) {

    .frame,
    .history-panel {
        width: 270px !important;
        min-width: 270px !important;
        /* width: 300px !important;
        min-width: 300px !important; */
    }

    .key__item {
        font-size: 13px !important;
        padding: 15px auto !important;
        max-width: 42px !important;
    }
}