@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');

:root {
    --opacity: 1;

    --light-color: #294665;
    --light-background: #7FB8AA;
    --light-output: rgba(0, 0, 0, 0.05);
    --light-gradient-1: linear-gradient(145deg, #88C5B6, #72A699);
    --light-gradient-2: linear-gradient(145deg, #72A699, #88C5B6);
    --light-box-shadow: 10px 10px 20px #598177,
                       -10px -10px 20px #98DDCC;
    --light-button-shadow-1: 7px 7px 35px #649186,
                          -7px -7px 35px #9ADFCE;
    --light-button-shadow-2: 7px 7px 15px #649186,
                            -7px -7px 15px #9ADFCE;

    --dark-color: rgb(175, 175, 175);
    --dark-background: #08120F;
    --dark-output: rgba(56, 56, 56, 0.05);
    --dark-gradient-1: linear-gradient(145deg, rgb(11, 21, 18), rgb(5, 14, 12));
    --dark-gradient-2: linear-gradient(145deg, rgb(5, 14, 12), rgb(11, 21, 18));
    --dark-box-shadow: 10px 10px 20px #040908,
                      -10px -10px 20px #0C1B17;
    --dark-button-shadow-1:  7px 7px 35px #030706,
                          -7px -7px 35px #0d1d18;
    --dark-button-shadow-2:  7px 7px 15px #030706,
                            -7px -7px 15px #0d1d18;

    --current-color: var(--light-color);
    --current-background: var(--light-background);
    --current-output: var(--light-output);
    --current-gradient-1: var(--light-gradient-1);
    --current-gradient-2: var(--light-gradient-2);
    --current-box-shadow: var(--light-box-shadow);
    --current-button-shadow-1:  var(--light-button-shadow-1);
    --current-button-shadow-2:  var(--light-button-shadow-2);
    

    --transition: all 0.5s, background 1s, color 0.2s;
}

* {
    box-sizing: border-box;
    font-family: "Roboto", serif;
}

html {
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    background: var(--current-background);
    transition: var(--transition);
}

#change-theme-button {
    position: fixed;
    top: 2em;
    right: 2em;
    margin: 0;
    padding: 0;
    border: none;
    width: 5vh;
    aspect-ratio: 1;
    background-color: transparent;
    background-image: url("./img/theme-icon.png");
    background-size: contain;
    cursor: pointer;
}

#main-container {
    margin-top: auto;
    margin-bottom: 8vh;
    background: var(--current-background);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 50px;
    overflow: hidden;
    height: 70%;
    min-height: 400px;
    aspect-ratio: 9 / 16;
    box-shadow: var(--current-box-shadow);
    transition: var(--transition);
    z-index: 2;
    will-change: box-shadow;
}

#main-container::before {
    position: absolute;
    content: "";
    inset: 0;
    background: var(--current-gradient-1);
    z-index: -1;
    opacity: var(--opacity);
    transition: var(--transition);
}

#output-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10% 15% 0;
    gap: 20%;
    width: 100%;
    height: 30%;
    background: var(--current-output);
    transition: var(--transition);
}

#history {
    display: flex;
    flex-direction: column-reverse;
    padding: 0;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    height: 1.2em;
    font-size: 1.2em;
    font-weight: bold;
    color: #4C6279;
}

#calculation {
    display: flex;
    justify-content: flex-end;
    white-space: nowrap;
    overflow: hidden;
    font-size: 2em;
    font-weight: bold;
    color: var(--current-color);
    transition: var(--transition);
}

#buttons-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5%;
    width: 73%;
    color: var(--current-color);
    transition: var(--transition);
}

.button-row {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 11%;
    width: 100%;
    gap: 8.5%;
}

.button-row button {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    color: inherit;
    font-weight: bold;
    font-size: 1.5em;
    padding: 0;
    margin: 0;
    height: 100%;
    border: none;
    border-radius: 50px;
    aspect-ratio: 1;
    cursor: pointer;
    background: var(--current-background);
    box-shadow: var(--current-button-shadow-1);
    transition: var(--transition);
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
    will-change: box-shadow;
}

.button-row button::before {
    position: absolute;
    content: "";
    inset: 0;
    background: var(--current-gradient-1);
    border-radius: 50px;
    z-index: -1;
    opacity: var(--opacity);
    transition: var(--transition);
}

.button-row button:hover {
    box-shadow: var(--current-button-shadow-2);
}

.button-row button:active {
    background: var(--current-gradient-2);
    box-shadow: none;
}

.button-row button:active::before {
    background: var(--current-gradient-2);
}

#equal {
    flex-grow: 1;
}

#divide, #multiply, #minus, #plus, #equal {
    color: #BF4242;
}

#copyright {
    font-size: 0.9em;
    margin-bottom: 5vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-weight: bold;
    color: var(--current-color);
}

#copyright a {
    color: var(--current-color);
}

#attribution {
    font-size: 0.8em;
}