:root {
    --switch-width: 2.2em;
    --switch-height: 1.2em;
    --knob-size: 0.8em;
    --knob-offset: 0.1em;
    --switch-transition: 0.4s;
    --switch-color: #2196F3;
    --switch-bg: #ccc;
    --focus-shadow: 0 0 1px var(--switch-color);
}

.recipe-content {
    font-family: din-2014;
}

.recipe-title-row {

}

.recipe-title-row-header,
.recipe-title-row-input {
    display: grid;
    grid-template-columns: 14em 5em 9em 7em 5em 5em 5em 1fr;
    grid-gap: 2px;
}


.recipe-title-row-input input:not([type="checkbox"]){
    width: 100%;
    font-size: calc(0.5vw + 0.3vh + 0.2vmin);
}

.food-source-content {
    display: grid;
    grid-template-columns: auto 1.1em 2fr;
    align-items: center;
    gap: 10px;
}

.recipe-ingredient-item-food-flag{
    width: 100%;
    justify-content: center;
    justify-items: center;
}

.food-source-content input[type="checkbox"] {
    justify-self: start;
}

.food-source-flag {
    justify-self: center;
}

.food-source-content span {
    justify-self: start;
    margin-right: 4px;
}

.recipe-search {

}

.recipe-title-input {

}

.recipe-title-input::placeholder {

}

.recipe-title-input:focus {
    outline: none;
}

.search-box-icon svg path {
    fill: red;
}

.search-box-icon-left {
    margin-left: 5px;
    padding: 5px;
}

.search-box-icon-right {
    margin-right: 5px;
    padding: 5px;
}

.recipe-search-box-input {
    width: 100%;

    border: 0;
    font-size: 1.2em;
}

.recipe-search-box-input::placeholder {
    font-size: 0.8em;
}

.recipe-search-box-input:focus {
    outline: none;
}

.recipe-search-box-result {
    border: solid;
    flex-grow: 1;
}

.recipe-title-icon > div:last-child {
    margin-left: auto;
}

.fa-icon-recipe {
    display: flex;
    font-size: 1.4em;
    justify-content: center;
    align-items: center;
    padding: 4px;
    cursor: pointer;
}
.checkbox-switch {
    position: relative;
    display: inline-block;
    width: var(--switch-width);
    height: var(--switch-height);
}

.checkbox-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--switch-bg);
    transition: var(--switch-transition);
    border-radius: 34px; /* Keep this for the rounded appearance */
}

.checkbox-slider:before {
    position: absolute;
    content: "";
    height: var(--knob-size);
    width: var(--knob-size);
    left: var(--knob-offset);
    top: calc((var(--switch-height) - var(--knob-size)) / 2);
    background-color: white;
    transition: var(--switch-transition);
    border-radius: 50%;
}

input:checked + .checkbox-slider {
    background-color: var(--switch-color);
}

input:focus + .checkbox-slider {
    box-shadow: var(--focus-shadow);
}

input:checked + .checkbox-slider:before {
    transform: translateX(calc(var(--switch-width) - var(--knob-size) - 2 * var(--knob-offset)));
}

.recipe-ingredient-item {
    text-align: right;
}

.recipe-ingredient-item-list {
    display: grid;
    border: 1px solid #ccc;
}

.recipe-ingredient-item-list-row,
.recipe-ingredient-item-list-row-header,
.recipe-ingredient-item-list-summary-row {
    display: grid;
    grid-template-columns: 3em 3em 2em 20em 5em 5em 5em 5em repeat(8, 1fr) 1em;
    grid-gap: 2px;
}

.recipe-ingredient-item-list-row {

}

.recipe-ingredient-item-list-row-header {

}

.recipe-ingredient-item-list-row span {
    align-content: end;
}

.recipe-ingredient-item-list-summary-row {
    padding: 10px;
    border: 1px solid #ccc;
}

.recipe-ingredient-item-grid-item {
    border: 1px solid #ccc; /* Add border for visualization */
}

.recipe-ingredient-item input {
    flex: 1; /* Fill the width of the parent container */
    margin-right: 8px; /* Add margin between input fields */
}

.title-row {
    display: flex;
    align-items: center; /* Center align items vertically */
}

.title-row span {
    flex: 1; /* Fill the width of the grid cell */
    margin-right: 8px; /* Add margin between static text elements */
}

.static-row {
    display: flex;
    align-items: center; /* Center align items vertically */
}

.static-row span {
    flex: 1; /* Fill the width of the grid cell */
    margin-right: 8px; /* Add margin between static text elements */
}

.recipe-ingredient-item {
    font-size: calc(0.5vw + .5vh + 0.2vmin);
    text-align: right;
    padding-right: 1px;
    font-family: din-2014;
    align-content: center;
}

.recipe-food-search-autocomplete {
    display: none;
    color: #4c4849;
    list-style: none;
    padding: 0;
    background-color: white;
    height: 11em;
    overflow-y: auto;
    position: absolute;
    top: 100%;
    width: auto;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 5px 5px;
    z-index: 1;
    overscroll-behavior: contain;
}

.recipe-food-search-autocomplete-item {
    white-space: pre;
}

.recipe-food-search-autocomplete-item:hover {
    background-color: #87CEFA;
    cursor: pointer;
}

.recipe-food-search-search {
    display: none;
    color: #4c4849;
    list-style: none;
    padding: 0;
    background-color: white;
    height: 11em;
    overflow-y: auto;
    position: absolute;
    top: 100%;
    width: auto;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 5px 5px;
    z-index: 1;
    overscroll-behavior: contain;
}

.recipe-food-search-search-item {
    white-space: pre;
}

.recipe-ingredient-item-weight {
    font-size: calc(0.6vw + 0.5vh + 0.2vmin);
    width: 7ch;
    max-width: 100%;
    text-align: right;
    justify-self: end;
}

.recipe-ingredient-item-unit {
    font-size: calc(0.5vw + 0.5vh + 0.2vmin);
    max-width: 100%;
    text-align: left;
}

.recipe-ingredient-item-food-container {
    position: relative;
}

.recipe-ingredient-item-food {
    font-size: calc(0.5vw + 0.5vh + 0.2vmin);
    text-align: left;
    width: 100%;
}

.recipe-ingredient-item,
.recipe-ingredient-item-food,
.recipe-ingredient-item-unit,
.recipe-ingredient-item-weight {

    font-size: calc(0.5vw + 0.2vh + 0.2vmin);
}

.recipe-ingredient-item-list-row-header select {
    width: 100%; /* Adjust the width as needed */
}

.recipe-ingredient-nutrient {
    font-size: 0.8cqw;
    background-color: transparent;
    border: none;
    color: inherit;
    padding: 0 4px;
    container-type: inline-size;
    font-family: din-2014;
}

.recipe-food-search-source {
    position: relative;
}

.recipe-food-search-source:hover {
    background-color: #87CEFA;
    cursor: pointer;
}

.recipe-food-search-source-list {
    display: none;
    list-style: none;
    padding-left: 0;
    background-color: #87CEFA;
    max-height: 200px;
    overflow: auto;
    position: absolute;
    z-index: 25;
    transform: translateX(-40%);
}

.recipe-food-search-source-list-item {
    white-space: pre;
    align-content: flex-start;
}

.recipe-food-search-source-list-item .food-source-flag {
    width: 40px; /* Set the width of the flag */
    margin-right: 5px; /* Adjust spacing between flag and text */
    display: flex;
    justify-content: center;
}

.food-source-flag {
    height: calc(0.45vw + 0.4vh + 0.2vmin);
}

.recipe-ingredient-nutrient, .recipe-ingredient-item {
    white-space: nowrap;
    overflow: hidden;

}

.recipe-ingredient-item-delete {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2px;
    margin-left: 3px;
    visibility: hidden;
    cursor: pointer;
}

.summary-amount {
    text-align: right;
}

.summary-unit {
    text-align: left;
}

.summary-recipe-title {
    text-align: left;
}

.item-unit {
    margin-left: 2px;
}

.grid-item {
    justify-content: flex-end;
    align-items: center;
    display: flex;
    flex-direction: row;
}

.recipe-ingredient-item-list-summary-row input {
    background-color: transparent;
    border-width: thin;
}

.recipe-composition-chart .legend-value {
    width: 4.5em;
}

@media screen and (max-width: 1440px) {

    .recipe-ingredient-item-list-row,
    .recipe-ingredient-item-list-row-header,
    .recipe-ingredient-item-list-summary-row {

        grid-template-columns: 3cqw 2.5cqw 2cqw 10cqw  3.4cqw 4cqw 4.5cqw 4cqw 4cqw repeat(7, 1fr) 1em;
    }

}

@media screen and (max-height: 933px) {

    .recipe-ingredient-item-list-row,
    .recipe-ingredient-item-list-row-header,
    .recipe-ingredient-item-list-summary-row {

        grid-template-columns: 3cqw 2.5cqw 2cqw 10cqw  3.4cqw 4cqw 4.5cqw 4cqw 4cqw repeat(7, 1fr) 1em;
    }
}

/* Media queries for responsiveness */
@media (max-width: 600px) {
    :root {
        --switch-width: 2.8em;
        --switch-height: 1.2em;
        --knob-size: 0.8em;
        --knob-offset: 0.1em;
    }
}

@media (max-width: 400px) {
    :root {
        --switch-width: 2.4em;
        --switch-height: 1em;
        --knob-size: 0.6em;
        --knob-offset: 0.1em;
    }
}