/* -- Custom properties -- */
:root {
    --color-background: #FCFCFF;
    --color-background-header: #e6efda;
    --color-primary: #22C55E;
    --color-secondary: #125b33;
    --color-text: #222833;
    --color-breakfast: #f6f6ce;
    --color-breakfast-border: #ffcc01;
    --color-lunch: #e4f6f2;
    --color-lunch-border: #05fabd;
    --color-dinner: #fae8ff;
    --color-dinner-border: #c829f4;
    --ff-text: "Poppins", sans-serif;
    --ff-title: "Inter", sans-serif;
    --border-radius: 1em;
    --border-radius-button: 8px;
}

/* -- Default settings -- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
    font-family: var(--ff-text);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-background);
}

h1 {
    font-family: var(--ff-title);
    color: var(--color-primary);
    font-size: 2em;
}
@media (min-width: 750px) {
    h1 {
        font-size: 2.5em;
    }
}

h2 {
  font-size: 1.1em;
}

/* -- General -- */
/* flex container */
.flex-container {
    display: flex;
    flex-direction: row;
}

/* grid */
.grid {
    display: grid;
    gap: 1em;
}

/* Button */
.button-style {
    font-family: var(--color-text);
    font-size: 1.1rem;
    color: #fff;
    background-color: var(--color-secondary);
    border-radius: var(--border-radius-button);
    border: none;
    border-top: 1px solid rgb(227, 244, 227);
    box-shadow: 0 4px 6px rgba(0,0,0,0.4);
}

.button-style:hover {
    cursor: pointer;
    background-color: var(--color-primary);
}

.button-style:active {
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* -- Header -- */
header {
    background-color: var(--color-background-header);
}

.banner {
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 85em;
    margin: 0px auto;
    padding: 0.5em;
}
@media (min-width: 750px) {
    .banner {
        width: 70%;
    }
}

/* Logo */
header .banner img {
    width: 60px;
    height: 60px;
}
@media (min-width: 750px) {
    header .banner img {
        width: 75px;
        height: 75px;
        margin: 0.5em 0;
    }
}

/* Titel mealplanner */
.title-meal {
    font-weight: 750;
}

.title-planner {
    color: var(--color-secondary);
    font-weight: 500;
}

/* Navigation */
nav ul {
    list-style-type: none;
    /*display: flex;
    flex-direction: row;*/
}

nav a {
    text-decoration: none;
    padding: 0.75em  1.1em;
    color: #fff;
    background-color: var(--color-primary);
    border-radius: var(--border-radius);
    border: none;
    border-top: 1px solid rgb(227, 244, 227);
    box-shadow: 0 8px 16px 0 rgba(0,0,0,0.3);
}

nav a:hover {   
  background-color: var(--color-secondary);
}

nav a:active {
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

@media (max-width: 750px) {
    .show-big-screen {
        display: none;
    }    
}

@media (min-width: 750px) {
    .show-small-screen {
        display: none;
    }    
}

/* -- Main -- */
main {
    width: 95%;
    max-width: 100em;
    margin: 0px auto;
    padding: 1.25em 0.5em;
}
@media (min-width: 750px) {
    main {
        padding: 2em;
    }    
}

main.pageadd {
    max-width: 50em;
} 
@media (max-width: 750px) {
    main.pageadd  {
        width: 97%;
    }    
}

/* -- Home Page -- */
/* no meals added */
#no-meals-added {
    text-align: center;
}

#no-meals-added img {
    width: 250px;
    margin: 0.5em;
}

/* button delete all */
#deleteall {
    padding: 5px 1em;
    margin-bottom: 1em;
}

/* meals */
/* meals - overview */
section.overview {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    margin-bottom: 2em;
    width: 90%;
    max-width: 100em;
    grid-template-areas:
        "mon tue wed thu fri sat sun"
        "meal-mon meal-tue meal-wed meal-thu meal-fri meal-sat meal-sun";
}
@media (max-width: 767px) {
    section.overview {
        gap: 0.5em;
        width: 100%;
        grid-template-columns: 1fr;
        grid-template-areas:
            "mon"
            "meal-mon"
            "tue"
            "meal-tue"
            "wed"
            "meal-wed"
            "thu"
            "meal-thu"
            "fri"
            "meal-fri"
            "sat"
            "meal-sat"
            "sun"
            "meal-sun";
    }
}

.grid-item {
    text-align: center;
}

#mon { grid-area: mon; }
#tue { grid-area: tue; }
#wed { grid-area: wed; }
#thu { grid-area: thu; }
#fri { grid-area: fri; }
#sat { grid-area: sat; }
#sun { grid-area: sun; }

.meal[data-day="mon"] { grid-area: meal-mon; }
.meal[data-day="tue"] { grid-area: meal-tue; }
.meal[data-day="wed"] { grid-area: meal-wed; }
.meal[data-day="thu"] { grid-area: meal-thu; }
.meal[data-day="fri"] { grid-area: meal-fri; }
.meal[data-day="sat"] { grid-area: meal-sat; }
.meal[data-day="sun"] { grid-area: meal-sun; }


/* Show name weekday */
/* Mobile and big screen*/
.meal-day-short {
    display: none;
}

/* Small screen */
@media (min-width: 768px) and (max-width: 1080px) {
    .meal-day-full {
        display: none;
    }    

    .meal-day-short {
        display: inline;
    }
}

.today {
    color: var(--color-primary);
}

/* meals - empty box */
.meal-styling {
    box-shadow: 0 0 3px #999;
    border-radius: var(--border-radius);
    height: 6.5em;
    color: #999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.meal-styling:hover {
    cursor: pointer;
    background-color: #e7e7e7;
    color: #797878;
}

/* meals - added meal */
article {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:   /*Bron: https://www.w3schools.com/css/css_grid_item_name.asp */
        "title buttons"
        "icons icons";
    padding: 0.5em 0.5em 0.5em 0.75em;
    border-radius: var(--border-radius);
    height: 6.5em;
}

article.br {
    background-color: var(--color-breakfast);
    border: 1px solid var(--color-breakfast-border);
}

article.lu {
    background-color: var(--color-lunch);
    border: 1px solid var(--color-lunch-border);
}

article.di {
    background-color: var(--color-dinner);
    border: 1px solid var(--color-dinner-border);
}

article:hover {
    cursor: pointer;
    filter: brightness(1.05);
    border-width: 2px;
}

/* Bron: tekst breekt af (ellipsis): 
https://stackoverflow.com/questions/2108740/how-do-i-indicate-long-text-into-a-smaller-fixed-column-with-css
https://www.w3schools.com/cssref/css3_pr_text-overflow.php 
Bron: titel over meerdere lijnen: 
https://stackoverflow.com/questions/15909489/text-overflow-ellipsis-on-two-lines
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/line-clamp 
https://www.geeksforgeeks.org/css/how-to-apply-an-ellipsis-to-multiline-text-in-css/*/
article h2 {
    margin: 0;
    align-self: start;
    grid-area: title;
    font-size: 0.9em;
    min-width: 0;
    
    display: -webkit-box;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    -webkit-line-clamp: 3;  
    overflow: hidden;
    overflow-wrap: break-word;
    line-height: 1.3;
}

/* TODO: Bekijken nodig -> Toont  notities 
article p:not(.category-icon) {
    font-size: 0.8em;
    width: 9em; 
    white-space: nowrap;
    overflow: hidden; 
    text-overflow: ellipsis; 
}*/

/* meals - buttons delete and edit */
.meal-buttons {
    grid-area: buttons;
    display: flex;
    width: 50px;
    justify-content: flex-end;
}
@media (min-width: 768px) {
    .meal-buttons { 
        display: none;
    }
}
@media (max-width: 1250px) {
    .meal-buttons {
        justify-self: end;
    }
}

article:hover .meal-buttons{
    display: block;
}

article svg {
    width: 25px;
    height: 25px;
}

article svg:hover {
    cursor: pointer;
    transform: scale(1.15);
    transition-duration: 150ms;
}

article.br svg {
    stroke: var(--color-breakfast-border);
}

article.lu svg {
    stroke: var(--color-lunch-border);
}

article.di svg {
    stroke: var(--color-dinner-border);
}

/* meals - icons category and more info */
.icons {
    grid-area: icons;
    display: flex;
}

.category-icon {
    align-self: end;
    margin-left: auto;
}

.more-info-icon {
    align-self: end;
}

/* Popover */
#mealfull {
    position: fixed;
    margin: auto;
    text-align: left;
    width: 340px;
    padding: 1.25rem;
    background: #ecedec;
    color: var(--color-text);
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.05);
}

#mealfull h2 {
    margin: 0 0 1rem;
    padding-bottom: .75rem;
    font-size: 1.4em;
    font-weight: 700;
    border-bottom: 1px solid rgba(0,0,0,.08);
    width: 275px;
}

#mealfull h3 {
    margin: 1rem 0 .35rem;
    font-size: .9em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6b7280;
}

/* Statistieken */
ul.statistics {
    margin-left: 1em;
    margin-bottom: 1em;
}

ul.statistics > li {
    margin-bottom: 1em;
}

li ul {
    list-style-position: inside;
}

/*Bron: emoji als opsommingsteken: https://www.geeksforgeeks.org/css/how-to-apply-emoji-hex-code-in-list-style-type-to-create-custom-list-point/ */
li ul #numberOfMeat{
    list-style-type: "\1F969";  
}

li ul #numberOfFish{
    list-style-type: "\1F41F";
}

li ul #numberOfPoultry{
    list-style-type: "\1F357";  
}

li ul #numberOfVegetarian{
    list-style-type: "\1F96C";  
}

li ul #numberOfVegan{
    list-style-type: "\1F331";  
}

ul.preptime li {
    list-style-type: "\23f1\FE0F";  
}

/* -- Add Page --- */
.help-text {
    font-size: 0.80em;
    line-height: 1.4;
    color: #666;
    margin-top: 4px;
    margin-bottom: 4px;
}

#randommeal {
    padding: 5px 1em;
}

div.feedbackBox ~ div.flex-container
{
    justify-content: space-between;
}

/* -- Form -- */
form {
    display: flex;
    flex-direction: column;
    margin-top: 1em;
    margin-bottom: 2em;
    background-color: #eaebea;
    padding: 1em 1em 0 1em;
    border-radius: var(--border-radius);
}

input {
    padding: 5px;
    margin-bottom: 1.5em;
}

input[type="text"] {
   border-radius: var(--border-radius-button); 
   font-family: var(--ff-text);
   border-style: hidden ;
}

input[type="number"] {
   border-radius: var(--border-radius-button); 
   font-family: var(--ff-text);
   border-style: hidden ;
   width: 5.5em;
}

input[type="number"] + p {
    padding-left: 0.75em;
    padding-top: 0.25em;
}

/* Label */
label {
    font-size: 1.2rem;
}

.required::after {
     content: " *";
     color: red;
}

.not-filled-in {
    color: red;
}

/* Submit button */ 
input[type=submit] {
    width: 10em;
}

/* Checkbox */
input[type=checkbox] {
    margin-right: 0.5em;
    margin-bottom: 1em;
}

/* Radio buttons */
/* Bron styling radio-buttons: https://stackoverflow.com/questions/73572206/how-to-style-an-html-radio-input-element-such-that-the-radio-button-is-absent */
.radio-buttons {
    justify-content: space-between;
}

section.day-view .radio-buttons {
    margin-bottom: 1em;
}

label:has(input[type=radio]) {
    padding: 5px 0em;
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 1em;  
}

label:has(input[type=radio][name="day"]) {
    width: 5em;
}

label:has(input[type=radio][name="type"]) {
    width: 10em;
}

@media (max-width: 850px) {
    label:has(input[type=radio]) {
        font-size: 0.9rem;
    }
    label:has(input[type=radio][name="day"]) {
        width: 3em;
    }
    label:has(input[type=radio][name="type"]) {
        width: 7em;
    }
}

label:has(input[type=radio]:checked) {
  background-color: var(--color-primary);
}

input[type=radio] {
    display: none;
}

/* Drop-down list */
select {
    margin-bottom: 1.5em;
    font-size: 0.9em;
    padding: 0.4em;
    border-radius: var(--border-radius-button);
}

/* Feedback message */
.feedbackBox {  
    width: 100%;
    position: fixed;
    top: 120px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 0 1rem;
    z-index: 9999;
    pointer-events: none;   /*Bron: https://www.w3schools.com/cssref/css3_pr_pointer-events.php */
}

.feedback {
    font-size: 0.9em;
    width: 100%;
    max-width: 400px;
    min-height: 70px;
    padding: 1rem;
    background-color: white;
    border-left-width: 8px;
    border-left-style: solid;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,.12);
    display: flex;
    align-items: center;
    gap: 0.75em;
    position: relative;
    transform: translateX(100vw);
    animation: moveleft 0.6s ease forwards;
    pointer-events: auto;
}

.feedback.hide {
    animation: moveright 1s ease forwards;
}

.feedback i {
    font-size: 1.5em;
    margin: 0;
    flex-shrink: 0;
}

.feedback p {
    flex: 1;
    padding-right: 1.5rem;
}

@media (min-width: 750px) {
    .feedback {
        font-size: 1em;
        gap: 1em;
    }

    .feedback i {
        font-size: 1.8em;
    }
}

/* Bron: https://www.w3schools.com/cssreF/atrule_keyframes.php 
https://www.w3schools.com/cssreF/css3_pr_transform.php 
https://www.w3schools.com/cssreF/func_translate.php*/
@keyframes moveleft {
    from {
        transform: translateX(150%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes moveright {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(150%);
        opacity: 0;
    }
}

.feedback.success {
    border-left-color: green;
}

.feedback.error {
    border-left-color: red;
}

.feedback.success i {
    color: green;
}

.feedback.error i {
    color: red;
}

.close-btn {
    position: absolute; 
    width: 20px;
    height: 20px;
    top: .75rem;
    right: .75rem;
    font-size: 1.2rem;
    background-color: transparent;
    border: none;
    cursor: pointer;
    z-index: 1;
}
@media (min-width: 750px) {
    .close-btn {
        width: 32px;
        height: 32px;
    }
}

.close-btn:hover{
    background-color: #d3d3d3;
    border-radius: var(--border-radius-button);
}

/* footer */
footer {
    background-color: var(--color-secondary);
    box-shadow: 0 0 5px #999;
    padding: 1em;
}

footer p {
    color: #fff;
    text-align: center;
}
