* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Play, sans-serif;
    transition: background-color 300ms ease-in;
}

html {
    filter: invert(0.0);
}

body {
    background-color: var(--background-color);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    margin: 0;
}

/* Setup the Colors for the project */
:root {
    --background-color: #F9F9F9;
    --control-bg: #F2F2F2;
    --button-bg: #ECECEC;
    --button-key: #2BBFA8;
    --button-operation: #FF7373;
    --text-color: #434343;
    --mode-on: #434343;
    --mode-off: #d5d5d5;
}



/*Header*/
header {
    width: 100vw;
    color: var(--text-color);
    text-align: center;
    font-size: 48px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    margin-top: 40px;
    margin-bottom: 16px;
}

/* Light/Dark Mode Toggle */
#mode {
    width: 110px;
    height: 49px;
    background-color: var(--button-bg);
    position: fixed;
    border-radius: 12px;
    right: 96px;
    top: 68px;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    z-index: 3;
}

#mode img {
    filter: brightness(1);
}

img.inactive {
    cursor: pointer;
    filter: brightness(3) !important;
}

#main-area {
    height: 700px;
    display: flex;
    flex-direction: column;
    justify-content: start;
    gap: 30px;
}

/* Color Swatch */
#theme {
    width: 110px;
    max-height: 700px;
    height: 80vh;
    border-radius: 32px;
    background-color: var(--control-bg);
    position: fixed;
    left: 96px;
    top: 50vh;
    transform: translate(50%, -50%);
    display: grid;
    grid-template-rows: repeat(8, 1fr);
    gap: 20px;
    align-items: center;
    align-content: center;
    justify-items: center;
    padding: 20px;
}


.color-swatch {
    max-width: 60px;
    width: 90%;
    max-height: 60px;
    height: 90%;
    border-radius: 24px;
    background: var(--button-bg);
    box-shadow: 2px 2px 22px -10px rgba(0, 0, 0, 0.2) inset;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--button-operation);
}



.active {
    cursor: unset;
}


/*Screen */
#screen {
    width: 400px;
    height: 180px;
    border-radius: 33px;
    background: var(--control-bg);
    display: flex;
    flex-direction: column;
    align-items: end;
    justify-content: end;
    padding: 20px 24px;
    /* margin-bottom: 16px; */
}

#old-calc {
    font-size: 22px;
    text-align: right;
    color: var(--text-color);
}

#old-calc a {
    color: var(--text-color);
    text-decoration: overline;
    cursor: cell;
}

color: var(--text-color);

#old-calc a:visited {
    color: var(--button-operation);
}

#old-calc a:hover {
    color: var(--button-key);
}


#result {
    font-size: 48px;
    color: var(--text-color);
    text-align: right;
    font-weight: 700;
}
#result, #old-calc
{
    width: 100%;
    overflow: scroll;
}


/* control-area */
#controls {
    width: 400px;
    max-height: 477px;
    height: 56vh;
    border-radius: 33px;
    background: var(--control-bg);
    display: grid;
    grid-template-rows: repeat(5, 1fr);
    grid-template-columns: repeat(4, 1fr);
    row-gap: 21px;
    column-gap: 23px;
    padding: 40px 28px;
}


.button {
    border-radius: 15px;
    background: var(--button-bg);
    border: 0px;
    color: var(--text-color);
    text-align: center;
    font-size: 28px;
    cursor: pointer;
}

.key {
    color: var(--button-key);
}

.operation-color {
    color: var(--button-operation);
}

footer {
    color: var(--text-color);
    text-align: center;
    font-family: Play;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    margin: 32px;
}

/* Special CSS */
/* to remove the blue-box on tap */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Animations and Color Transitions */
html {
    transition: filter 300ms ease-in;
}

button {
    transition: color 300ms ease-in, box-shadow 120ms ease-in-out;
}

button:active {
    /* border: 1px solid #c4c4c4; */
    box-shadow: 0px 0px 20px -12px rgba(0, 0, 0, 0.2) inset
}


/* Media queries for responsiveness */

/* For Mobile Phones Portrait or Landscape View */
@media screen and (max-device-width: 640px) {

    header>p,
    footer {
        display: none;
    }

    #main-area {
        max-width: 500px;
    }

    #screen {
        background-color: var(--background-color);
        max-width: 500px;
        width: 100%;
    }

    #controls {
        max-width: 500px;
        width: 100%;
    }


    #main-area {
        width: 100vw;
        justify-content: flex-end;
        gap: 4px;

    }

    body {
        justify-content: flex-end;
        gap: 0px;
    }

    #mode {
        top: 16px;
        left: 50%;
        transform: translate(-50%, 50%);
    }

    #theme {
        position: fixed;
        width: 100%;
        height: 25vh;
        top: 0px;
        left: 50vw;
        transform: translate(-50%, -90%);
        z-index: 1;
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(2, 1fr);
        border-radius: 0 0 28px 28px;
        /* box-shadow: 2px 2px 22px -10px rgba(0, 0, 0, 0.2); */

        z-index: 3;
        cursor: pointer;

        /* animation */
        transition: transform 550ms ease, background-color 200ms ease-in;
    }

    .slide-out {
        transform: translate(-50%, 0px) !important;
    }
}