/* #region GENERAL/BODY */
:root {
    --colour1: #D2D8D8ff;
    --colour3: #D9DFDFff;
    --colour2: #E1FCF7ff;
    --colour4: #E5E5E5ff;

    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    --b-radius: var(--spacing-xl);
    --main-bg-color: var(--colour4);
    --negative-margin: -4.4em;
    /* ^ do not change ^ */
}

* {
    box-sizing: border-box;
    font-family: 'Work Sans', Arial, sans-serif;
}

.questions {
    text-align: center;
}

main {
    position: relative;
    z-index: 1;
    background-color: white;
}

body {
    background-color: white;
    background-size: cover;
}

#nav-and-header-bg {
    color: black;
    align-items: flex-end;
    z-index: 3;
}



.diet-study-box,
#diet-study-imgs p {
    background-color: white;
}

/* #mission {
    margin-top: 10%;
} */

body {
    position: relative;
    font-size: clamp(var(--spacing-md), 2vh, var(--spacing-xl));
    line-height: 1.6;
    margin: 0;
    /* background: var(--main-bg-color) */
}

#nav-and-header-bg h1,
#nav-and-header-bg p {
    /* color: var(--colour4); */
    color: black;
    text-shadow: 2px 2px 2px var(--colour4);
}

h1,
h2,
h3,
h4 {
    text-align: center;
    text-shadow: 2px 2px 2px var(--colour4);
}

#nav-and-header-bg p {
    text-align: center;
}

#mission {
    margin-left: 10%;
    margin-right: 10%;
    text-align: center;
    font-size: 1.25rem;
}


#mission p {
    border: 1px solid black;
    padding: var(--spacing-md);
    margin-top: var(--spacing-md);
    backdrop-filter: blur(10px);
    border-radius: var(--b-radius);
    text-align: center;
}

#mission h1 {
    margin: 0;
    margin-top: 1.5em;

}



#mytopnav+h1 {
    padding: var(--spacing-md);
}


#publications-div {
    margin-left: 10%;
    margin-right: 10%;
}

.plan {
    text-align: center;
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    display: flex;
    justify-content: center;
    align-items: center;
}


.plan img {
    height: auto;
    max-height: 40em;
    width: auto;
    object-fit: contain;
    border: 1px solid black;
}




.questions {
    margin: var(--spacing-xl);

}

#wordCanvasDiv {
    margin: 1em 10em 1em 10em;
    height: 40rem;
    width: auto;
    border: 1px solid black;
    border-radius: var(--b-radius);
}

#wordCanvas {
    width: 100%;
    height: 100%;
    border: 1px solid black;
    border-radius: var(--b-radius);
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.publications-img, .publications-text {
    background-color: white;
    padding: var(--spacing-md);
    border: 1px solid black;
    text-align: left;
    margin: 0;
    box-sizing: border-box;
}

.publications-img img {
    width: auto;
    max-height: 400px;
    aspect-ratio: 2.52 / 1;
}

.publications-img a {
    display: block;
}

.publications-text {
    margin-bottom: 1em;
}

.publications-text > span {
    display: block;
}

#message {
    text-align: center;
}

#message img {
    width: 200px;
    height: 200px;
}

/* #endregion */
/* #region TABLE */
table {
    border-collapse: collapse;
}

td,
th {
    border-top: 1px solid black;
    border-bottom: 1px solid black;
    text-align: center;
}

.details-table>tr>th {
    vertical-align: text-top;
}

td.firstdata,
#firstheader {
    border-left: 1px solid black;
}

td.lastdata,
#lastheader {
    border-right: 1px solid black;
}

th {
    background-color: var(--main-bg-color);
    font-weight: 700;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

tr:nth-child(odd) {
    background-color: white;
}

#metabolite-data {
    width: 80%;
    margin-right: 10%;
    margin-left: 10%;
    box-sizing: border-box;
}

.firstdata div {
    height: auto;
    width: 8em;
    display: block;
    position: relative;
    line-height: 0;
}

.firstdata div svg {
    max-height: 100%;
    margin: 0 auto;
    position: relative;
}

a {
    color: black;
}

.details-table th,
.details-table td {
    padding: 1em;
    border: 1px solid var(--colour1);
    text-align: left;
}

.details-table th {
    background-color: var(--main-bg-color);
    /* width: 20%; */
    font-weight: bold;
}

.details-table {
    margin-left: 20%;
    margin-right: 20%;
    width: 60%;
}

.data-table {
    width: 100%;
    margin-top: 1em;
    font-size: var(--spacing-md)
}

.data-table th,
.data-table td {
    border: 1px solid var(--colour1);
}


.inner-table th,
.inner-table td {
    /* properties tables */
    display: table-cell;
    width: auto;
    text-align: center;
    padding: var(--spacing-sm);
    border: 1px solid #ccc;
}

/* #endregion */
/* #region MODELS */
#models {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
    margin: 0 auto;
    border: 1px solid black;
}

#metabolite-structure,
#model-3d {
    max-width: 50%;
    box-sizing: border-box;
    position: relative;
    display: flex;
    align-items: center;
}

#metabolite-structure svg {
    width: 100%;
    height: auto;
}

#undefined {
    /* id of canvas*/
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    min-height: 1px;
    /* necessary as otherwise canvas will collapse */
    aspect-ratio: 1 / 1;
    /* very important! do not remove */
}

#viewer3d {
    width: 100%;
    min-width: 1px;
    min-height: 1px;
    max-width: 18.75em;
}

#metabolite-structure div img {

    float: right;
    width: 19em;
    height: 19em;
}

/* #endregion */
/* #region IMG */

.page-img {
    height: auto;
    max-height: 15.5em;
    width: 100%;
    object-fit: contain;
    margin: auto;
    display: block;
    padding: 0.6em;
}

#cow-img {
    height: 50px;
    width: auto;
    margin: var(--spacing-md);
}

.icon img {
    width: 40px;
    height: 40px;
    margin: 0.75em;
}

/* #endregion */
/* #region GALLERY */
div#graphs {
    margin-left: 20%;
    margin-right: 20%;
    border: 1px solid black;
    padding: 1em;
    background-color: white;
}

#graph-gallery {
    margin: 1.25em;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
}

#graph-gallery img {
    max-width: 100%;
    display: block;
    width: 20em;
    height: auto;
    border-radius: var(--b-radius);
}


iframe {
    width: 100%;
    height: 100%;
}

#graphs .gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

#iframe-div {
    height: 15em;
    width: 50%;
}

/* #iframe-div,
#iframe-div iframe {

} */

#index-gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-md);
    text-align: center;
    align-items: flex-start;
    width: 100%;
}

.gallery-item2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* width: 20%; */
}

.gallery-item2 a {
    width: 100%;
}

.gallery-item2 p {
    margin: 0;
}


.img-wrapper2 {
    height: 12em;
    width: 100%;
}

#index-gallery img {
    width: 100%;
    height: 100%;
    border-radius: var(--b-radius);
    border: 1px solid grey;
    object-fit: contain;
    padding: 4em;
    backdrop-filter: blur(10px);
}

#landing-gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-md);
}

#landing-gallery img {
    max-width: 100%;
    border-radius: var(--b-radius);
    border: 1px solid black;
}

.img-wrapper3 {
    height: 300px;
    width: 300px;
}

.img-wrapper3 img {
    width: 100%;
    height: 100%;
    padding: 2rem;
}



#reveal-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: #baf7fe8e;
    color: black;
    border: none;
    border-radius: var(--b-radius);
    cursor: pointer;
}

/* #endregion */
/* #region HEADER/FOOTER */

.top-nav {
    display: flex;
    justify-content: start;
    align-items: center;
    list-style: none;
    top: 0;
    z-index: 1000;
    position: sticky;
    width: 100%;
    border: 1px solid black;
    background-color: var(--main-bg-color);
    line-height: normal;
    border-top-left-radius: 0;
    border-top-right-radius: 0;

}

body:not(#index-body) .top-nav {
    /* while the nav in index.html also gets this colour, it is originally transparent*/
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

#right-aligned {
    display: flex;
    padding-right: var(--spacing-md);
}

#left-aligned {
    padding-left: var(--spacing-md);
    display: flex;
    align-items: center;
}

.top-nav a {
    text-decoration: none;
    color: black;
    font-weight: 700;
}



#index-body .top-nav {
    background-color: rgba(0, 0, 0, 0);
    /* transparent  */
    border: 1px solid black;
    border: 1px solid transparent;
    transition: background-color 0.4s ease;
    transition: border 0.4s ease;
    will-change: background-color;
    will-change: border;
}

#index-body .top-nav a {
    transition: background-color 0.3s ease;
    transition: border 0.3s ease;
}

#index-body .top-nav.solid {
    border: 1px solid black;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    /*  colour to fade into  */
}

/* .top-nav a:hover {
    background-color: #e0e0e0;
} */

footer {
    position: relative;
    text-align: center;
    background-color: white;
    padding-top: var(--spacing-md);
    list-style: none;
    z-index: 1;
}

#footer-div {
    /* footer images*/
    display: flex;
    justify-content: center;
    align-items: center;
    height: 12em;
    /* not variable as still deciding size*/
    padding: 1em;
}

#sticky-footer {
    position: sticky;
    bottom: 0;
    left: 0;
    z-index: 0;
    display: flex;
    justify-content: center ;
    gap:100px;
    padding-top:1em;
    padding-bottom:1em;
}

.img-wrapper {
    height: 100%;
}

.img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#footer-div :first-child img {
    border-bottom-left-radius: var(--b-radius);
    border-top-left-radius: var(--b-radius);
}

#footer-div :last-child img {
    border-bottom-right-radius: var(--b-radius);
    border-top-right-radius: var(--b-radius);
}

footer > div {
    margin-left: 10%;
    margin-right: 10%;
}

#index-header {
    font-size: var(--spacing-xl);
}


#index-header p {
    margin-top: 0;
    padding-left: 20%;
    padding-right: 20%;
}

#index-header h1 {
    margin: 0;
}

/* #endregion */
/* #region LOGIN */
#loginForm {
    text-align: center;
    height: 65vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
}

#email,
#password,
#loginForm button {
    padding: 0.5em;
    font-size: var(--spacing-xl);
    box-sizing: border-box;
    border-radius: var(--b-radius);
    border: 1px solid grey;
}

/* #buttons {
    margin-top: 1em;
} */

/* #endregion*/
/* #region MEDIA QUERIES */
@media screen and (min-width: 700px) {
    #left-aligned {
        /* keeps navbar items on right */
        margin-right: auto;
    }

    .top-nav a {
        padding: var(--spacing-sm);
    }

    .top-nav .icon {
        display: none;
    }
}

@media screen and (max-width: 700px) {
    #right-aligned {
        /* keeps menu button on right */
        margin-left: auto;
    }

    .top-nav #right-aligned a {
        display: none;
    }

    .top-nav #right-aligned a.icon {
        float: right;
        display: block;
        max-height: 1000px;
    }

    /* responsive navbar mobile*/
    .top-nav.responsive #right-aligned {
        display: block;
        width: 100%;
    }

    .top-nav.responsive a {
        float: none;
        display: block;
        text-align: left;
        padding: var(--spacing-xs);
    }

    .top-nav.responsive a.icon {
        position: absolute;
        right: 0;
        top: 0;
    }

    .top-nav.responsive #right-aligned a {
        display: block;
    }

    .top-nav.responsive #left-aligned {
        display: none;
    }

    /* loginForm mobile */
    #loginForm {
        flex-direction: column;
        height: auto;
    }

    #email,
    #password,
    #loginForm button {
        font-size: var(--spacing-lg);
        width: auto;
    }

    #loginForm button {
        margin-bottom: var(--spacing-md);
    }

    #email {
        margin-top: var(--spacing-md);
    }

    #metabolite-structure,
    /* makes models align vertically */
    #model-3d {
        max-width: 100%;
    }

    /* removes 4th child and adds right border to 3rd*/
    #metabolite-data th:nth-child(4),
    #metabolite-data td:nth-child(4) {
        display: none;
    }

    td.mobilelastdata,
    #mobilelastheader {
        border-right: 1px solid black;
    }

}

/* Responsive layout */
@media screen and (max-width: 1200px) {

    /* database.html table */
    .details-table,
    #metabolite-data {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .details-table th,
    .details-table td {
        display: block;
        width: 100%;
        text-align: left;
    }

    .details-table th {
        background-color: #baf7fe8e;
        font-weight: 700;
        text-transform: uppercase;
    }

    .details-table td {
        position: relative;
    }

    .details-table td:before {
        content: attr(data-label);
        font-weight: 700;
        position: absolute;
        left: 0;
        top: 0;
    }

    /* metabolite.html table */
    .inner-table th,
    .inner-table td {
        display: table-cell !important;
    }

    .inner-table {
        width: 100%;
    }

    /* database table mobile*/
    #metabolite-data {
        width: 100%;
        margin-right: 0;
        margin-left: 0;
        font-size: var(--spacing-sm);
        box-sizing: border-box;
    }

    /* removes 5th child and adds right border to 4th*/
    #metabolite-data th:nth-child(5),
    #metabolite-data td:nth-child(5) {
        display: none;
    }

    td.mobile2ndlastdata,
    #mobile2ndlastheader {
        border-right: 1px solid black;
    }
}

/* #endregion */
/* #region DIET STUDY*/
#diet-study-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 20px;
    /* optional spacing */
    margin-left: 10%;
    margin-right: 10%;
}

.diet-study-box {
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid black;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

.diet-study-box h1,
.diet-study-box p {
    margin: 0;
    padding: 0;

}

#diet-study-imgs {
    display: flex;
    justify-content: space-between;
    margin: 2% 10% 2% 10%;
    text-align: center;
    border: 1px solid black;
}

#diet-study-imgs>div {
    flex: 1;
    display: flex;
    flex-direction: column;

}

#diet-study-imgs div img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;

}

#diet-study-imgs div p {
    padding: 10px;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* #endregion */
/* #region FORM */
#metabolite-form {
    display: flex;
    justify-content: center;
    margin-left: 5%;
    margin-right: 5%;
    gap: var(--spacing-xl);
}

#metabolite-form>* {
    background-color: white;
}


#metabolite-form h3, #metabolite-form h4 {
    margin: 0;
}

#metabolite-form>div {
    border: 1px solid black;
    padding: var(--spacing-md);
    max-width: 100%;
}

#metabolite-form div label {
    font-weight: 700;
    display: block;
}

#metabolite-form div input {
    display: block;
    /* width: 80%; */
}

#metabolite-form div button {
    font-weight: 700;
    display: block;
    width: 100%;
}

#index-gallery figure {
    width: 20%;
    margin: 0;
    position: relative;
    overflow: hidden;
    height: 300px;

}

#index-gallery figcaption {
    position: absolute;
    font-size: var(--spacing-xl);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: var(--spacing-md);
    border-radius: var(--spacing-xl);
    color: transparent;
    transition: all 0.3s ease-in-out;
    text-align: center;
    box-sizing: border-box;
    height: 200px;
    width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#index-gallery figure:hover figcaption {
    color: white;
    text-shadow: 2px 2px 2px black;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

/* #endregion */


#description {
    width: 100%;
    min-height: 0.5em;
    resize: none;
    overflow: hidden;
    box-sizing: border-box;
}


#pdf-container {
    display: flex;
    flex-wrap: wrap;
    flex: 0 0 auto;
    width: 80%;
    margin-left: 10%;
    margin-right: 10%;
    justify-content: space-evenly;
}

#pdf-container div {
    border: 1px solid black;
    text-align: center;
}

#pdf-container canvas {
    width: 100%;
    height: auto;
    max-height: 600px;
    display: block;
    margin-bottom: 8px;
}

#diet-illustration-div {
    display: flex;
    justify-content: center;
    max-width: 80%;
    margin-left: 10%;
    margin-right: 10%;
    margin-bottom: 1em;
}

#diet-illustration {
    width: auto;
    aspect-ratio: 1.43 / 1;
    height: 700px;
}

#team-pictures img{
    height: 200px;
    width: 200px;
    object-fit: cover;
    border: 1px solid black;
}

#update-pictures img {
    max-height: 300px;
    width: auto;
    border: 1px solid black;
}

#update-pictures {
    text-align: center;
}

#team-pictures span {
    display: block;
    max-width: 200px;
}

.update-row {
    display: flex;
    justify-content: center;
    gap: 1em;
    max-width: 80%;
    margin-left: 10%;
    margin-right: 10%;
    align-items: center;
    margin-top: 1em;
    margin-bottom: 1em; 
    backdrop-filter: blur(10px);
    font-size: 1.25rem;

}

.team-row {
    display: flex;
    justify-content: center;
    gap: 1em;
    max-width: 80%;
    margin-left: 10%;
    margin-right: 10%;
    margin-top: 1em;
    margin-bottom: 1em; 
}

#metabolite-data tr {
    opacity: 0;
    border-color: transparent;
    transition: opacity 0.5s ease;
}

#metabolite-data tr.visible {
    opacity: 1;
    border-color: initial;
}

#metabolite-data tr td {
    border-color: transparent;
    transition: border-color 0.5s ease;
}

#metabolite-data tr.visible td {
    border-color: initial;
}

#pdf-container p {
    margin: 0 !important;
}

#attributions, #policy, #termsconditions {
    margin-left: 20%;
    margin-right: 20%;
}

#loginNote {
    text-align: center;
}