@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;700&display=swap');

:root {
    --bg-page: linear-gradient(180deg, rgb(191 113 71) 20%, rgba(242,107,34,1) 100%);
    --button: transparent;
    --button-hover: #31343f;
    --button-active: #414553;
    --bg-screen: #15171c;
    --result-preview: #acadaf;
    --result: #e3fdfd;
    --bg-buttons: #23252d;
    --text-top-buttons: #f26b22;
    --text-numbers: #ffffff;
    --text-operators: #acadaf;
}
* {
    margin: 0;
    box-sizing: border-box;
}
html, body {
    height: 100%;
}
body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-page);
    display: flex;
    justify-content: center;
    align-items: center;
}
button {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 15px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background-color: var(--button);
}
button:hover {
    background-color: var(--button-hover);
}
button:active {
    background-color: var(--button-active);
}
#calculator {
    width: 350px;
    height: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0px 0px 20px 4px rgba(0,0,0,0.62);
    border-radius: 8px;
    overflow: hidden;
    margin: 10px;
}
/* ---- Screen ---- */
#screen {
    background-color: var(--bg-screen);
    height: 105px;
}
#screen div {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px;
}
#result-preview {
    color: var(--result-preview);
    text-align: right;
    cursor: default;
    min-height: 25px;
}
/* */
#screen .result {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}
.result #copy {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.result #copy svg {
    width: 25px;
    height: 25px;
}
#result {
    color: var(--result);
    text-align: right;
    font-size: 40px;
}
/* ---- Buttons: all ---- */
#buttons {
    background-color: var(--bg-buttons);
    padding: 0 8px 8px 8px;
}
/* ---- Buttons: clear and delete ---- */
#clear-delete {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    gap: 8px;
}
#clear-delete button {
    background-color: var(--button);
    width: 100%;
    color: var(--text-top-buttons);
}
#clear-delete button:hover {
    background-color: var(--button-hover);
}
#clear-delete button:active {
    background-color: var(--button-active);
}

/* ---- Buttons: numbers and operators ---- */
#buttons div {
    display: flex;
    gap: 8px;
    margin-top: 12px;

}
#buttons div section {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 8px;
}
#buttons div section button {
    width: 100%;
    height: 40px;
    color: var(--text-numbers);
}
#buttons div section .operator {
    color: var(--text-operators);
}

/* ---- Footer ---- */
footer {
    position: absolute;
    bottom: 25px;
    display: flex;
    gap: 20px;
}
footer a:hover {
    opacity: 90%;
}
footer a svg {
    width: 35px;
    height: 35px;
}

/* ---- Responsive: mobile ---- */
@media (max-width: 370px) {
    #calculator {
        width: 280px;
    }
    button {
        height: auto;
        font-size: 13px;
    }
    #screen {
        height: 95px;
    }
    #result-preview {
        min-height: 20px;
        font-size: 13px;
    }
    #result {
        font-size: 27px;
    }
    .result #copy {
        width: 35px;
        height: 35px;
    }
    #buttons div section button {
        height: 30px;
    }
    footer {
        bottom: 15px;
    }
    footer a svg {
        width: 30px;
        height: 30px;
    }
}

@media (max-height: 450px) {
    body {
        flex-direction: column;
        gap: 24px;
    }
    footer {
        position: inherit;
    }
}