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

html {
    color-scheme: dark;
    overflow-x: hidden;
}

body {
    background-color: #111111;
    padding: 0;
    margin: 0;
    color: white;
    font-family: 'Open Sans', sans-serif;
    height: 100vh;
    overflow-x: hidden;
}

header {
    display: flex;
    height: 60px;
    background-color: #222222;
    align-items: top;
    justify-content: space-between;
    padding-inline: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.09);
}

code {
    font-size: 1.2em;
    background-color: #333333;
    color: white;
    padding-inline: 4px;
    padding-block: 1px;
    border: 2px solid #222222;
    border-radius: 4px;
}

help-sign {
    /*display a round circle with question mark*/
    display: inline-block;
    text-align: center;
    line-height: 0.8rem;
    content: "?";
    user-select: none;
    font-size: 0.8rem;
    width: 0.8rem;
    height: 0.8rem;
    padding: 5px;
    border-radius: 50%;
    background-color: #333333;
    color: white;
    margin-inline-end: 4px;
    cursor: pointer;
}

help-sign:hover {
    background-color: #444444;
}

h1 {
    font-size: 1.5em;
    font-weight: 500;
}

blockquote {
    padding-inline: 20px;
    padding-inline-end: 10px;
    opacity: 0.5;
    margin-block: 50px;
    padding-block: 6px;
    border-inline-start: 4px solid white;
}

blockquote:hover {
    opacity: 1;
}

.header-menu {
    display: flex;
}

.tight {
    padding-block: 0;
    margin-block: 0;
}


.container {
    display: flex;
    flex-direction: column;
    padding-inline: 60px;
    gap: 20px;
    align-items: center;
    margin-bottom: 100px;
}

.sort-switch {
    width: 100px;
    height: 40px;
    border: 2px solid #333333;
    background-color: #333333;
    color: white;
    font-size: 0.6em;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sort-switch:hover {
    scale: 1.1;
}

.sort-switch {
    width: 200px;
}

.color-range-display {
    display: flex;
    justify-content: center;
    align-items: center;
    align-content: center;
    padding-inline: 20px;
    padding-block: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.09);
    gap: 5%;
    width: min(100%, 1200px);
}

.color-range-display p {
    display: flex;
    align-items: center;
    flex-direction: row;
}

.color-range-display p::before {
    /* draw circle */
    content: "";
    display: inline-block;
    width: 30px;
    height: 30px;
    border-radius: 100%;
    margin-inline-end: 8px;
    background-color: var(--color);
}

#search-form {
    width: min(100%, 1200px);
    display: flex;
    flex-direction: row;
    height: 40px;
    font-size: 1.2em;
}

#search-form *:last-child {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

#search-form *:last-child:dir(rtl) {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
    border-top-right-radius: unset;
    border-bottom-right-radius: unset;
}

#search-form *:first-child {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

#search-form *:first-child:dir(rtl) {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    border-top-left-radius: unset;
    border-bottom-left-radius: unset;
}

.search {
    min-width: 40px;
    height: 40px;
    border-radius: 0px;
    border: 0px;
    background-color: #333333;
    color: white;
    font-size: 1.8em;
    font-weight: 800;
    text-align: center;
    display: flex;
    vertical-align: middle;
    justify-content: center;
    align-items: center;
}

#food-search {
    width: 100%;
    border: none;
    outline: none;
    padding-inline: 10px;
    background-color: #222222;
    border: 2px solid #333333;
    color: white;
}

#sorting-identifier {
    padding: 0;
    margin: -0.7em 0 -1.2em;
    font-size: 1em;
    z-index: 10000;
}

#food-list {
    width: min(100%, 1200px);
    border-collapse: collapse;
}

#food-list td {
    padding-block: 2px;
}

#food-list td {
    border: 0px;
}

#food-list tr:nth-child(odd) {
    background-color: #181818;
}

#food-list tr:nth-child(even) {
    background-color: #111111;
}

#food-list td:nth-child(n) {
    text-align: center;
    overflow-x: hidden;
}

#food-list td:nth-child(1)>input {
    width: 80px;
    color: white;
    background-color: #222222;
    border: 2px solid #333333;
    border-radius: 2px;
}

#food-list td:nth-child(1) {
    width: 80px;
}

#food-list td:nth-child(2) {
    text-align: unset;
    padding-inline: 10px;
}

#food-list th:nth-child(4) {
    justify-content: center;
}

#food-list tr:hover {
    background-color: #444444;
}

#add-item-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-block: 20px
}

.add-item-button { 
    background-color: #2b2a33;
    border: 1px solid #8f8f9d;
    border-radius: 4px;
    font-size: 1.2em;
    padding-inline: 1em;
    padding-block: 0.5em;
    color: white;
}

@media screen and (min-width: 1400px) {

    #food-list td:nth-child(1)>input {
        width: 120px;
    }
    #food-list td:nth-child(1) {
        width: unset;
        
    }
}

@media screen and (max-width: 900px) {
    .color-range-display {
        /* make it so i t displays as a 2x2 grid */
        display: grid;
        grid-template-columns: 50% 50%;
        grid-template-rows: 50% 50%;
        border-bottom: 1px solid rgba(0, 0, 0, 0.09);
        max-width: max(50%, 300px);
        max-height: 10vh;
        margin-inline-start: 15%;
    }

    .color-range-display p {
        padding-block: -20px;
    }
}

@media screen and (max-width: 800px) {
    :root {
        font-size: 0.8em;
    }

    .color-range-display p::before {
        width: 24px;
        height: 24px;
    }


    header {
        padding-inline-end: 0px;
    }

    #discord {
        font-size: 0.8em;
    }

    .container {
        padding-inline: 10px;
    }

    #food-list td:nth-child(1)>input {
        width: 50px;
    }

    .company-name {
        display: none;
    }
}

@media screen and (max-width: 650px) {
    blockquote {
        margin-block: 30px;
    }
}

@media screen and (max-width: 500px) {
    #food-list {
        font-size: 0.85em;
        display: block !important;
        width: 95vw;
        overflow-x: scroll;
    }

    #food-list td, #food-list th {
        min-width: 50px;
    }

    #food-list td:nth-child(2), #food-list th:nth-child(2) {
        position: sticky;
        left: 0;
        background-color: inherit;
    }
    #food-list td:nth-child(2):dir(rtl), #food-list th:nth-child(2):dir(rtl) {
        right: 0;
        left: unset;
    }

    #food-list tr:hover> td:nth-child(2) {
        background-color: #444444;
    }

    header {
        padding-inline-start: 5px;
    }

    #discord {
        line-height: normal !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    html:dir(ltr) #food-list tr:first-child {
        font-size: 0.8em;
    }
    
    html:dir(ltr) header .logo {
        font-size: 0.9em;
    }
}

@media screen and (max-width: 300px) {
    #food-list td:nth-child(1)>input {
        width: 42px;
    }

    blockquote {
        width: 80%;
        margin-inline-start: calc(50px + 5%);
        margin-block: 30px;
    }
}

@media screen and (max-width: 600px) {
    .hide-600px {
        display: none;
    }
}
@media screen and (min-width: 600px) {
    .show-600px {
        display: none;
    }
}

@media screen and (max-width: 500px) {
    .hide-500px {
        display: none;
    }
}
@media screen and (min-width: 500px) {
    .show-500px {
        display: none;
    }
}

@media screen and (max-width: 400px) {
    .hide-400px {
        display: none;
    }
}
@media screen and (min-width: 400px) {
    .show-400px {
        display: none;
    }
}