@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700&display=swap');

body {
    margin: 0;
    padding: 0;
    font-family: 'Source Sans 3', sans-serif;
    background-image: url('background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
}

h1 {
    text-align: center;
    color: #fff;
    font-size: 2.5rem;
    font-weight: bolder;
    padding: 1rem 0;
    margin: 0.5rem auto;
}

label {
    display: block;
    font-weight: bold;
}

input,
select {
    width: 100%;
    padding: 0.7rem;
    margin-bottom: 0.8rem;
    border: 0.1rem solid skyblue;
    border-radius: 0.3rem;
}

button {
    display: block;
    width: 100%;
    padding: 0.7rem;
    background-color: dodgerblue;
    color: #f0f0f0;
    border: none;
    border-radius: 0.3rem;
    cursor: pointer;
}

button:hover {
    background-color: rgb(122, 128, 133);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: fixed;
    width: 20rem;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 1rem;
    text-align: center;
    border: 0.2rem solid skyblue;
    border-radius: 1rem;
    box-shadow: 0 0 1rem rgba(0, 0, 0, 0.4);
}

#table-container,
#table-container-new {
    max-height: 15.2rem;
    height: auto;
    overflow-y: auto;
    overflow-x: auto;
    margin: 0;
    margin-bottom: 0.8rem;
    padding-right: 0.5rem;
}

#table-container-new {
    display: none;
}

h3 {
    margin: 0;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.result-container,
.result-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.label-and-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 72%;
}


#result {
    background-color: #fff;
    height: 2rem;
    width: 51.4%;
    margin: 0 auto;
    margin-right: 4%;
    margin-left: 2.8%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0.2rem solid skyblue;
    border-radius: 1rem;
    box-shadow: 0 0 1rem rgba(0, 0, 0, 0.4);
    font-size: 1rem;
    text-align: center;
    color: #333;
    font-weight: bold;
}

#resultExp {
    background-color: #fff;
    height: 2rem;
    width: 53%;
    margin-left: 2%;
    margin: 1rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0.2rem solid skyblue;
    border-radius: 1rem;
    box-shadow: 0 0 1rem rgba(0, 0, 0, 0.4);
    font-size: 1rem;
    text-align: center;
    color: #333;
    font-weight: bold;
}

button#showExplanationButton {
    background-color: dodgerblue;
    color: #f0f0f0;
    width: 28%;
    border: none;
    border-radius: 0.3rem;
    cursor: pointer;
}

button#showExplanationButton:hover {
    background-color: rgb(122, 128, 133);
}

.inputCalc {
    width: 25rem;
    margin: 0.5rem auto 2rem auto;
    background-color: #fff;
    padding: 1.2rem;
    border-radius: 0.5rem;
    box-shadow: 0 0 1rem rgba(0, 0, 0, 0.2);
    color: dodgerblue;
    border: 0.2rem solid skyblue;
}

.outputCalc {
    width: 30rem;
    margin: auto;
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 0 1rem rgba(0, 0, 0, 0.2);
    color: dodgerblue;
    border: 0.2rem solid skyblue;
}

table {
    border-collapse: collapse;
    width: 100%;
}

th,
td {
    border: 0.1rem solid black;
    padding: 0.1rem;
    text-align: center;
}

#learnDesLink {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.2rem;
    display: block;
    margin: 0.5rem auto;
    background-color: #f0f0f0;
    padding: 0.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 0 1rem rgba(0, 0, 0, 0.2);
    color: dodgerblue;
    border: 0.2rem solid skyblue;
}

#learnDesLink:hover {
    background-color: rgb(122, 128, 133);
}

.footer {
    color: skyblue;
    width: 100%;
    margin-top: 1rem;
}

.footer p {
    margin: 0;
    margin-left: 0.5rem;
}

#menuButton {
    position: absolute;
    top: 55%;
    left: 0.8rem;
    transform: translate(-50%, -50%) rotate(-90deg);
    height: 3rem;
    width: 9rem;
    padding: 0.5rem;
    background-color: #f0f0f0;
    color: dodgerblue;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 2.3rem;
    border-radius: 0.5rem;
    box-shadow: 0 0 1rem rgba(0, 0, 0, 0.2);
    border: 0.2rem solid skyblue;
}

#menu {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    left: -200%;
    background-color: #f0f0f0;
    color: dodgerblue;
    transition: left 0.3s ease;
    overflow: hidden;
    overflow-y: auto;
}

#menu ul {
    list-style-type: none;
    padding: 0;
    margin: 1rem;
}

#menu ul li {
    margin-bottom: 1rem;
}

#menuButton:hover+#menu,
#menu:hover {
    left: 0;
}

#menuButton:hover {
    background-color: rgb(122, 128, 133);
}

.history-block {
    border: 0.1rem solid skyblue;
    margin: 0.7rem;
    padding: 0.7rem;
    background-color: #f0f0f0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.history-block p {
    margin: 0;
    padding: 0;
}

.history-block:hover {
    background-color: skyblue;
}

.desCalculationMenuTitle {
    text-align: center;
    color: dodgerblue;
    padding: 1rem;
    margin: 0 auto;
    text-decoration: underline;
    margin-top: 0.5rem;
    font-size: 1.25rem;
    position: relative;
}

.close-button {
    float: right;
    color: black;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-button:hover {
    color: red;
}

.replay-button {
    cursor: pointer;
    position: absolute;
    top: 0.8rem;
    left: 1.5rem;
    color: #f0f0f0;
    background-color: dodgerblue;
    padding: 0.1rem 0.3rem;
    border: 0.2rem solid skyblue;
    border-radius: 0.5rem;
    transform: rotate(90deg);
}

.replay-button:hover {
    background-color: rgb(122, 128, 133);
    ;
}

.otherdesCalculationMenuTitle {
    text-align: center;
    color: #f0f0f0;
    padding: 1rem;
    margin: 0 auto;
    margin-top: 0.5rem;
    font-size: 1.25rem;
    background-color: dodgerblue;
    position: relative;
}

#othermenuButton {
    position: absolute;
    top: 55%;
    right: 1rem;
    transform: translate(50%, -50%) rotate(-90deg);
    height: 2rem;
    width: 10rem;
    padding: 0.5rem;
    background-color: #f0f0f0;
    color: dodgerblue;
    cursor: pointer;
    font-size: 1.25rem;
    border-radius: 0.5rem;
    box-shadow: 0 0 1rem rgba(0, 0, 0, 0.2);
    border: 0.2rem solid skyblue;
    line-height: .0rem;
}

#othermenu {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    right: -200%;
    background-color: #f0f0f0;
    color: dodgerblue;
    transition: right 0.3s ease;
    overflow: hidden;
}

#othermenuButton:hover+#othermenu,
#othermenu:hover {
    right: 0;
}

#othermenuButton:hover {
    background-color: rgb(122, 128, 133);
}

.page-container {
    margin: 0;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-container img {
    max-width: 100%;
    height: auto;
}

.button-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 0;
    margin-top: 1rem;
    margin-bottom: 1rem;
    background-color: #f0f0f0;
}

.prev-page,
.next-page {
    padding: 0.5rem 0.7rem;
    margin: 0 0.7rem;
    flex: 1;
    display: block;
    width: 100%;
    background-color: dodgerblue;
    color: #f0f0f0;
    border: none;
    border-radius: 0.3rem;
    cursor: pointer;
    position: relative;
}

.prev-page:hover,
.next-page:hover {
    background-color: rgb(122, 128, 133);
}

.prev-page::before,
.next-page::before {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
}

.prev-page::before {
    left: 0.5rem;
    border-width: 0.4rem 0.533rem 0.4rem 0;
    border-color: transparent #f0f0f0 transparent transparent;
}

.next-page::before {
    right: 0.5rem;
    border-width: 0.4rem 0 0.4rem 0.533rem;
    border-color: transparent transparent transparent #f0f0f0;
}

.prev-page::after {
    content: "Prev Slide";
}

.next-page::after {
    content: "Next Slide";
}

@media (max-width: 800px) {
    .inputCalc {
        width: 45vw;
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    .outputCalc {
        width: 45vw;
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    input,
    select {
        font-size: 0.7rem;
    }

    #othermenuButton {
        font-size: 1rem;
        width: 8.3rem;
    }

    #menuButton {
        font-size: 1rem;
        width: 7.5rem;
    }

    #learnDesLink {
        top: 0.7rem;
        right: 0;
        font-size: 0.9rem;
        margin-right: 1rem;
    }

    .label-and-result {
        width: 100%;
        margin-top: 0.5rem;
        align-items: center;
        justify-content: center;
    }

    #result {
        width: 50%;
        margin-right: 0;
        margin-left: 3%;
        height: 1.7rem;
        font-size: 0.8rem;
    }

    .result-container {
        flex-direction: column;
        align-items: flex-start;
        align-items: center;
        justify-content: center;
    }

    button#showExplanationButton {
        width: 100%;
        margin-top: 1rem;
    }

    h3 {
        font-size: 1.4rem;
    }

    button {
        padding: 0.6rem;
    }

    .footer p {
        font-size: 0.9rem;
    }

    button {
        font-size: 0.8rem;
    }

    .close-button {
        color: red;
    }

    @media (max-width: 600px) {

        .label-and-result {
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        #result {
            width: 80%;
            margin-top: 0.3rem;
            font-size: 0.7rem;
        }

        .outputCalc {
            width: 30vw;
            font-size: 0.9rem;
        }

        .inputCalc {
            font-size: 0.9rem;
        }

        #learnDesLink {
            position: initial;
            background-color: transparent;
            padding: 0;
            border-radius: 0;
            box-shadow: none;
            border: none;
            top: auto;
            margin: 0;
            margin-top: 1rem;
            margin-left: 0.5rem;
            font-size: 1rem;
            width: 6rem;
        }

        .footer {
            margin-top: 0.2rem;
        }

        button {
            font-size: 0.7rem;
        }
    }

    @media (max-width: 500px) {

        h3 {
            font-size: 1.3rem;
        }

        .modal-content {
            width: 60vw;
            padding: 0.5rem;
            margin-bottom: 2rem;
        }

        #resultExp {
            width: 52%;
            margin-top: 0.3rem;
            margin-right: 0;
            margin-left: 2%;
            height: 1.7rem;
            font-size: 0.7rem;
        }

        #table-container {
            display: none;
        }

        #table-container-new {
            max-height: 10.2rem;
            display: block;
            font-size: 0.8rem;
        }

        .result-label {
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        .outputCalc {
            width: 40vw;
        }

        .inputCalc {
            width: 50vw;
        }
    }

    @media (max-width: 400px) {
        .outputCalc {
            width: 45vw;
        }

        .inputCalc {
            width: 55vw;
        }

        #resultExp {
            width: 70%;
        }

        .otherdesCalculationMenuTitle {
            padding: 0.7rem;
            font-size: 1.2rem;
        }

        .desCalculationMenuTitle {
            padding: 0.7rem;
            font-size: 1.2rem;
        }

        .button-container {
            margin-top: 0.5rem;
            margin-bottom: 0.5rem;
        }

        .page-container {
            margin-top: 0;
        }

        .prev-page,
        .next-page {
            padding: 0.3rem 0.5rem;
            margin: 0 0.2rem;
        }

        .prev-page {
            margin-right: 10%;
        }

        .next-page {
            margin-left: 10%;
        }

        .prev-page::after {
            content: "Prev";
        }

        .next-page::after {
            content: "Next";
        }

        #othermenu {
            width: 90vw;
        }

        .page-container img {
            width: 90%;
        }

        .footer p {
            font-size: 0.8rem;
        }

        .replay-button {
            left: 1rem;
            top: 0.7rem;
        }

        .history-block p {
            font-size: 0.9rem;
        }
    }

    @media (max-width: 350px) {

        h3 {
            font-size: 1.25rem;
        }

        .otherdesCalculationMenuTitle {
            padding: 0.7rem;
            font-size: 1.1rem;
        }

        .desCalculationMenuTitle {
            padding: 0.7rem;
            font-size: 1.1rem;
        }

        .prev-page::after {
            font-size: 0.7rem;
        }

        .next-page::after {
            font-size: 0.7rem;
        }

        .history-block {
            margin-top: 1.5rem;
        }

        .history-block p {
            font-size: 0.7rem;
        }
    }

    @media (max-width: 320px) {

        .replay-button {
            left: 0.5rem;
            top: 2.3rem;
        }

        #result {
            font-size: 0.7rem;
            width: 90%;
        }

        #resultExp {
            font-size: 0.7rem;
        }
    }
}

@media (max-height: 600px) {

    .modal-content {
        max-height: 60vh;
        overflow-y: auto;
    }

    #othermenu {
        max-height: 60vh;
        overflow-y: auto;
    }

}