@view-transition {
    navigation: auto;
}

table {
    border-collapse: collapse;
}

.margin-2rem {
    margin: 2rem;
}

.margin-top-2rem {
    margin-top: 2rem;
}

.font-size-0.7rem {
    font-size: 0.7rem;
}

.font-bold {
    font-weight: bold;
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-column {
    flex-direction: column;
}

.gap-1rem {
    gap: 1rem;
}

.width-6rem {
    width: 6rem;
}

.width-100 {
    width: 100%;
}

.text-blue {
    color: blue;
}

.background-danger {
    background: #881b1b !important;
}

.display-none {
    display: none;
}

.display-inline-block {
    display: inline-block;
}

.position-fixed-centre {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

tr.hx-swapping td {
    opacity: 0;
    transition: opacity 1s ease-out;
}

.ttfd-main {
    min-height: 500px;
    justify-content: flex-start !important;
    align-items: flex-end !important;
    gap: 0 !important;
}

.ttfd-loading-indicator {
    width: 48px;
    height: 48px;
    border: 3px solid #fff;
    border-radius: 50%;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

.ttfd-loading-indicator::after {
    content: '';
    box-sizing: border-box;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 40px;
    border: 3px solid transparent;
    border-bottom-color: #ff3d00;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

span.marked {
    color: #1cbbba;
}

.ttfd-main-app {
    width: calc(100% - 265px);
    display: flex;
    flex-direction: column;
}

.ttfd-summary {
    order: -1;  /* Summary always displays first in parent */
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding-left: 3rem;
    padding-right: 3rem;
    position: sticky;
    top: 0;
    align-self: flex-start;
}

.ttfd-bottom-nav {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-left: 3rem;
    padding-right: 3rem;
}

.ttfd-summary-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    position: absolute;
    left: 0;
    top: 0;
}

.ttfd-button {
    background-color: #1b2944;
    color: white !important;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4px;
    text-decoration: none;
    border-radius: 2px;
    font-weight: bold;
}

.ttfd-button:hover {
    text-decoration: none;
    filter: brightness(150%);
    cursor: pointer;
}

.ttfd-card {
    background-color: white;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    overflow: hidden;
    width: 220px;
    height: 220px;
    padding: 0px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.ttfd-filters {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
}

.ttfd-filter-button {
    font-size: 1.25em;
    font-weight: bold;
    line-height: 1;
    text-transform: uppercase;
    position: relative;
    border: .1875em solid;
    padding: .2em;
    color: #293d66;
    background: transparent;
    border-radius: .125em;
    transition: background .3s;
}

.ttfd-svg-icon {
    position: relative;
    top: .125em;
    flex-shrink: 0;
    height: 1em;
    width: 1em;
    fill: currentColor;
    transition: fill .3s;
}

.ttfd-filter-button:hover, .ttfd-filter-button:focus {
    color: white;
    background: #293d66;
    border-color: #293d66;
}

dialog#ttfd-filters {
    margin: 0;
    transform: translateX(-50%);
    left: 50%;
    top: 5em;
}

::backdrop {
    background-color: #222;
    opacity: 0.9;
}

.ttfd-filter-item {
    font-size: 1.25em;
    line-height: 1;
}

.ttfd-filter-excluded {
    background-color: #ffc3ca;
}

.ttfd-filter-included {
    background-color: #caffc3;
}

.ttfd-filter-tabs-wrapper {
    border-radius: 6px;
    max-width: 100%;
    display: flex;
    flex-wrap: wrap;
    position: relative;
    list-style: none;
    background-color: transparent;
}

input#ttfd-filter-reactions:checked ~ div#ttfd-filter-reactions-tab {
    opacity: 1;
    transition: 0.5s opacity ease-in, 0.8s transform ease;
    position: relative;
    top: 0;
    z-index: 100;
    transform: translateY(0px);
    text-shadow: 0 0 0;
}

input#ttfd-filter-metabolites:checked ~ div#ttfd-filter-metabolites-tab {
    opacity: 1;
    transition: 0.5s opacity ease-in, 0.8s transform ease;
    position: relative;
    top: 0;
    z-index: 100;
    transform: translateY(0px);
    text-shadow: 0 0 0;
}

input#ttfd-filter-pathways:checked ~ div#ttfd-filter-pathways-tab {
    opacity: 1;
    transition: 0.5s opacity ease-in, 0.8s transform ease;
    position: relative;
    top: 0;
    z-index: 100;
    transform: translateY(0px);
    text-shadow: 0 0 0;
}

.ttfd-tab:checked + label {
  background-color: #fff;
  box-shadow: 0 -1px 0 #fff inset;
  cursor: default;
  font-weight: bold;
}
.ttfd-tab:checked + label:hover {
  box-shadow: 0 -1px 0 #fff inset;
  background-color: #fff;
}
.ttfd-tab + label {
    box-shadow: 0 -1 0 #eee inset;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: #333;
    flex-grow: 3;
    text-align: center;
    background-color: #f2f2f2;
    user-select: none;
    transition: 0.3s background-color ease, 0.3s box-shadow ease;
    height: 50px;
    box-sizing: border-box;
    padding: 15px;
}

.ttfd-tab + label:hover {
    background-color: #f9f9f9;
    box-shadow: 0 1px 0 #f4f4f4 inset;
}

.ttfd-filter-tab {
    padding: 10px 25px;
    background-color: transparent;
    position: absolute;
    width: 100%;
    z-index: -1;
    opacity: 0;
    left: 0;
    transform: translateY(-3px);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.ttfd-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    list-style: none;
    width: 100%;
    margin: 0;
    padding: 0;
}

.ttfd-grid-element {
    height: 164px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    border: 3px solid transparent;
    transition: border-color 0.3s linear;
    text-align: center;
    text-decoration: none;
}

.ttfd-grid-element:hover {
    border: 3px solid orange;
}

.ttfd-grid-element-selected {
    border: 3px solid orange;
}

.ttfd-metabolite-container {
    font-size: 0.7px;
    font-family: sans-serif;
}

.ttfd-metabolite-title {
    font-size: 1rem;
    line-height: 24px;
    text-overflow: ellipsis;
    white-space: nowrap;    
}

.ttfd-molecule-image {
    max-width: 100%;
    max-height: 100%;
}

.ttfd-stepper {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.ttfd-step {
    padding-left: 8px;
    padding-right: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 0%;
    position: relative;
    text-decoration: none;
}

.ttfd-step-icon {
    width: 1em;
    height: 1em;
    font-size: 1.5rem;
}

.ttfd-step-icon-active {
    fill: #293d66
}

.ttfd-step-icon-inactive {
    fill: rgba(0, 0, 0, 0.38);
}

.ttfd-step-icon-text {
    fill: white;
    font-size: 0.75rem;
    font-family: Roboto, Helvetica, Arial, sans-serif;
}

.ttfd-step-text {
    text-align: center;
    margin-top: 16px;
    color: #293d66;
    font-family: Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.875rem;
    line-height: 1.43;
    letter-spacing: 0.01071rem;
}

.ttfd-step-text-active {
    font-weight: 500;
}

.ttfd-step-connector {
    position: absolute;
    top: 12px;
    left: calc(-50% + 20px);
    right: calc(50% + 20px);
    display: block;
    border-color: rgb(189, 189, 189);
    border-top-style: solid;
    border-top-width: 1px;
}

.ttfd-warning {
    border-radius: 6px;
    background-color: #fdf0e1;
    color: #492b08;
    padding: 12px;
}

.ttfd-table {
    --gap: 0;
    --padding: 1rem;
    display: grid;
    background-color: white;
    border: 1px solid rgb(224, 224, 224);
    border-radius: 4px;
    padding: 0.5rem;
    gap: var(--gap);
    margin-top: 1rem;
    margin-bottom: 3rem;
}

.ttfd-table-row {
    display: contents;
}

.ttfd-table-row:hover > div {
    background-color: #eee;
    color: inherit;
}

.ttfd-table-row-selected > div {
    background-color: #eee;
    color: orange;
}

.ttfd-table-cell {
    position: relative;
    padding: var(--padding);
}

.ttfd-table-cell::before, .ttfd-table-cell::after {
    content: '';
    position: absolute;
    background-color: rgb(224, 224, 224);
    z-index: 1;
}

/* table row (horizontal) lines */
.ttfd-table-cell::after {
    inline-size: calc(100% + 1rem);
    block-size: 1px;
    inset-inline-start: calc(0.5rem * -1); /* x-axis */
    inset-block-start: calc(1.3rem + var(--padding) * 2); /* y-axis */
}

.ttfd-table-heading {
    grid-row: 1;
    font-weight: 500;
    line-height: normal;
}

.ttfd-list {
    display: flex;
    flex-direction: column;
    font-family: "Roboto", "Helvetica", "Arial", "sans-serif";
    font-weight: 400;
    font-size: 0.875rem;
    letter-spacing: 0.01071rem;
    background-color: white;
    border: 1px solid rgb(224, 224, 224);
    border-radius: 4px;
    margin-top: 1rem;
    margin-bottom: 3rem;
}

.ttfd-list-heading {
    font-weight: 500;
    line-height: normal;
    align-self: center;
    padding: 1rem;
}

.ttfd-list-row {
    border-top: 1px solid rgb(224, 224, 224);
    padding: 1rem;
}

.ttfd-list-row:hover {
    background-color: #eee;
}

.ttfd-list-row-selected {
    background-color: #eee;
}

.ttfd-list > a {
    text-decoration: none;
}

.ttfd-pathway {
    color: black;
}

.ttfd-pathway-element {
    margin: 5px;
}

.ttfd-results-container {
    display: flex;
    flex-direction: column;
    background-color: white;
    justify-content: center;
}

.ttfd-pathway-summary-container {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    font-family: "Arial", "sans-serif";
}

.ttfd-reaction-summary {
    display: flex;
    flex-wrap: wrap;
    margin: 0.5rem;
}

.ttfd-pathway-summary {
    display: flex;
    flex-direction: column;
    padding-top: 1rem;
}

.ttfd-pathway-summary-item {
    align-self: flex-start;
}

.ttfd-reaction-summary-text {
    font-weight: bold;
    color: #109d99;
}

#ttfd-pathway-result-image {
    max-width: 100%;
}

#ttfd-results-gauge-alternatives {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-evenly;
    align-content: space-evenly;
    gap: 1em;
}

#ttfd-results-gauge-alternatives > svg {
    aspect-ratio: 1;
    flex-grow: 1;
    height: 100%;
    max-width: 30%;
}

.ttfd-atom-index {
    font-size: 0.3px;
}

/* Atom highlight hovering and animations */
.ttfd-summary g[class="marked"] > circle {
    fill: #1cbbba;
}

.ttfd-summary g[class="marked"] > text {
    fill: white;
}

.ttfd-summary g[class="marked"] > text.ttfd-atom-index {
    fill: #1cbbba;
}
