/* * 1. General (font, *, body, html, var, modeBtn class) */
/* * 2. Desktop Nav */
/* * 3. Hamburger Nav */
/* * 4. Favorite Meals (modeBtn, scrollbar) */
/* * 5. Search input (searchContainer, suggestions, randomBtn) */
/* * 6. Meals (H2, meals, card(text and icons) ) */
/* * 7.Footer */
/* * 8. Pop up () */

/* * 9. About Us (chart) - about.hmtl */
/* * 10. Add Recipe - addRecipe-html */

/* * 1. General (font, *, body, html, var) */
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--bg1-color);
}

html {
    scroll-behavior: smooth;
}

:root {
    /* First set of colors */
    --bg1-color: #eff1f7;
    --txt1-color: #000000;
    --nav-color: #38b6ff;
    --scroll-color: rgb(30, 30, 30);

    /* second set of colors */
    --bg2-color: #352f44;
    --txt2-color: #000000;
}

/* Toggle this class when mode button clicks (changes colors) */
.dark-mode {
    /* First set of colors */
    --bg1-color: #231e1a;
    --txt1-color: #000000;
    --nav-color: #feb72b;
    --scroll-color: rgb(200, 200, 200);

    /* second set of colors */
    --bg2-color: #352f44;
    --txt2-color: #ffffff;
    --txt3--color: #ffffff;
}

/* * 2. Desktop Nav */
nav,
.nav-links {
    display: flex;
}

nav {
    justify-content: space-between;
    align-items: center;
    min-height: 7vh;
    background-color: var(--nav-color);
    opacity: 0.9;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1;
    padding: 0 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.nav-links {
    gap: 3rem;
    list-style: none;
    font-size: 1.4rem;
}

nav a {
    text-decoration: none;
    font-weight: 400;
    color: var(--txt1-color);
}

nav a:hover {
    text-decoration: underline;
    text-underline-offset: 1rem;
    font-weight: 500;
}

.logo {
    width: 70px;
    height: 70px;
}

.logo img {
    width: 100%;
    overflow: hidden;
    transition: 200ms ease-in-out;
}

.logo img:active {
    scale: 0.6;
}

/* * 3. Hamburger Nav  */

.hamburger-nav {
    display: none;
}

.hamburger-menu {
    position: relative;
    display: inline-block;
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 24px;
    width: 30px;
    cursor: pointer;
}

.hamburger-icon span {
    width: 100%;
    height: 2px;
    background-color: var(--txt1-color);
    transition: all 500ms ease;
}

.menu-links {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--nav-color);
    width: fit-content;
    max-height: 0;
    overflow: hidden;
}

.menu-links a {
    display: block;
    padding: 8px;
    text-align: center;
    font-size: 1.8rem;
    color: var(--txt1-color);
    text-decoration: none;
    transition: all 500ms ease-in-out;
}

.menu-links li {
    list-style: none;
}

.menu-links.open {
    max-height: 300px;
    width: 100%;
}

.hamburger-icon.open span:first-child {
    /* Make first span rotate */
    transform: rotate(45deg) translate(10px, 5px);
}

.hamburger-icon.open span:nth-child(2) {
    /* Makes second span invisible */
    opacity: 0;
}

.hamburger-icon.open span:last-child {
    /* Makes last span rotate 45deg the other way */
    transform: rotate(-45deg) translate(10px, -5px);
} /* Make the hamburger menu look like a X */

/* * 4. Favorite Meals (modeBtn, toggleClass, scrollbar) */

/* Mode-btn */
.mode-btn > i {
    font-size: 2rem;
    margin-top: 1rem;
    margin-left: 4rem;
    cursor: pointer;
    color: var(--txt2-color);
    transition: 200ms ease-in-out;
}

/* Center text */
.fav-meals-container {
    text-align: center;
    border-radius: 8px;
    width: 70%;
    margin: auto;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    background-color: var(--nav-color);
    position: relative;
    height: 2.4rem;
    overflow-y: hidden;
}

/* position meals next to each, and add scrollbar */
.fav-meals {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem;
    overflow-x: scroll;
}

/* Position the arrow */
.fav-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.4rem;
    cursor: pointer;
}

.total-fav-meals {
    position: absolute;
    top: 4px;
    right: 32px;
    background-color: black;
    color: white;
    padding: 0.3rem;
    width: 2rem;
    border-radius: 50%;
    font-weight: 600;
    font-size: 15px;
}

/* Position favorite meal */
.fav-meal {
    cursor: pointer;
    width: 78px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    background-color: var(--bg1-color);
    transition: 300ms ease-in-out;
}

.fav-meal:hover {
    scale: 1.1;
}

/* Center fav meal */
.fav-meal .fav-meal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Sizing the img */
.fav-meal-img-container {
    width: 70px;
    height: 60px;
    margin-top: 0.4rem;
    border-radius: 0.4rem;
    overflow: hidden;
}

/* Position the img right */
.fav-meal-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Fix overflow */
.fav-meal-text p {
    width: 80px;
    font-size: 0.7rem;
    padding-left: 0.3rem;
    text-wrap: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    color: var(--txt2-color);
    transition: 300ms ease-in-out;
}

/* Space the X btn and fix hover bugs */
.fa-x {
    color: white;
    background-color: var(--txt1-color);
    width: 100%;
    border-radius: 0 0 0.5rem 0.5rem;
    padding: 0.6rem;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

/* Color */
::-webkit-scrollbar-thumb {
    background-color: var(--scroll-color);
    border-radius: 3rem;
}

/* * 5. Search input (searchContainer, suggestions, randomBtn) */

/* Position the whole container */
.user-input {
    background-color: var(--nav-color);
    width: 70%;
    margin: auto;
    text-align: center;
    border-radius: 8px;
    padding: 0.6rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

/* Position the search input container */
.search-container {
    background: white;
    display: flex;
    width: fit-content;
    margin: auto;
    margin-top: 0.4rem;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

/* Style input */
.search-container input {
    border: none;
    outline: none;
    padding: 0.6rem;
    height: 3rem;
    width: 100%;
    font-size: 1rem;
    border-radius: 6px;
}

.search-container button {
    background-color: var(--txt1-color);
    color: white;
    padding: 1rem;
    border: none;
    outline: none;
    cursor: pointer;
    border-radius: 0 6px 6px 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.suggestions {
    list-style: none;
    display: flex;
    justify-content: space-evenly;
    margin-top: 0.6rem;
    font-weight: 600;
}

.suggestions li {
    cursor: pointer;
}

.suggestions li:hover {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.6rem;
}

.random-btn {
    background-color: var(--txt1-color);
    color: white;
    padding: 0.6rem;
    margin-top: 0.6rem;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    transition: 300ms ease-in-out;
}

/* Make it bigger */
.random-btn:hover {
    scale: 1.1;
}

/* * 6. Meals (H2, meals, card(text and icons) ) */

/* Style the h2 */
.meals-h3 {
    color: var(--txt2-color);
    text-align: center;
    margin-top: 0.6rem;
    font-weight: 400;
    font-size: 1.4rem;
}

/* Puts them next to each other, center and gap */
.meals {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2.4rem;
    padding: 0.6rem;
    min-height: 32vh;
}

/* Size the meal cards and fix border-radius */
.meal-card {
    width: 300px;
    max-width: 400px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    background-color: white;
    transition: 200ms ease-in-out;
}

/* position the image right */
.meal-card-img-container {
    width: 100%;
    min-width: 300px;
    height: 300px;
    cursor: pointer;
}

/* Get the img right */
.meal-card-img-container img {
    width: 100%;
    height: 100%;
}

/* center and position the icons and h2 */
.meal-name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    font-size: 1.2rem;
    transition: 200ms ease-in-out color;
}

/* Make text smaller */
.meal-name p {
    font-size: 0.8rem;
    text-wrap: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* utensils btn */
.meal-name i:nth-child(1) {
    cursor: pointer;
    padding-right: 0.4rem;
}

/* fav btn */
.meal-name i:nth-child(3) {
    color: red;
    cursor: pointer;
}

/* Color change when hovered, and jump */
.meal-card:hover {
    background-color: var(--txt1-color);
    scale: 1.03;
}

/* Text color change when hovered */
.meal-card:hover .meal-name {
    color: white;
}

/* * 7.Footer */
footer {
    background-color: var(--nav-color);
    opacity: 0.9;
    margin-top: 1rem;
}

.footer-container {
    display: flex;
    justify-content: space-around;
    padding-top: 0.6rem;
}

footer .logo {
    height: 80px;
    width: 80px;
}

.footer-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2rem;
    font-size: 1.3rem;
    font-weight: 500;
}

.footer-links li a {
    text-decoration: none;
    color: var(--txt1-color);
}

footer p {
    padding-bottom: 0.6rem;
    text-align: center;
}

/* * 8. Pop up () */

/* Position pop up */
.pop-up-container {
    position: fixed;
    inset: 0;
    background-color: grey;
    display: flex;
    align-items: center;
    justify-content: center;
    display: none; /* as default it will be hidden */
}

/* Position the pop-up */
.pop-up {
    width: 90%;
    max-width: 1000px;
    max-height: 80vh;
    background-color: var(--bg1-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    color: var(--txt2-color);
    margin-top: 4rem;
    padding: 3rem;
    border-radius: 8px;
    overflow: scroll;
    position: relative;
}

.popup-h2 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2rem;
}

/* Style the X */
.pop-up i {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 2rem;
    cursor: pointer;
    background-color: var(--bg1-color);
    color: var(--txt2-color);
    font-size: 1.6rem;
}

/* Make the content left and right  */
.pop-up-content {
    display: flex;
    gap: 1rem;
}

.left-side-content > div.meal-card-img-container {
    width: 300px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    cursor: none;
}

.ingredients-div {
    margin-top: 1rem;
}

/* Moves the bulletpoints */
.left-side-content ul li {
    list-style-position: inside;
}

/* Gives it little space */
.instructions {
    padding: 1rem;
}

.meal-info {
    line-height: 2;
}

/* * 9. About Us (chart) */
/* center */
.about-container {
    text-align: center;
    margin-top: 1rem;
    min-height: 100vh; /* To push down the footer */
    color: var(--txt2-color);
}

.about-container h2 {
    font-size: 2rem;
    font-weight: 500;
}

.about-text h4 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Style the text */
.about-text {
    background-color: var(--nav-color);
    border-radius: 8px;
    width: 70%;
    margin: auto;
    margin-top: 2rem;
    padding: 0.6rem 2rem;
    line-height: 1.8;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    color: var(--txt1-color);
}

/* Center and adds space */
.chart {
    margin: auto;
    margin-top: 0.6rem;
    width: 100%;
    width: fit-content; /* Makes it responsive */
    height: 50vh;
    margin-bottom: 6rem;
    position: relative; /* for loader */
}

/* Center the loader */
#loader {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    width: 120px;
    height: 120px;
    margin: 0 0 0 -50px;
    border: 1rem solid lightblue;
    border-radius: 50%;
    border-top: 16px solid var(--nav-color);
    -webkit-animation: spin 2s linear infinite;
    animation: spin 2s linear infinite;
}

@-webkit-keyframes spin {
    0% {
        -webkit-transform: rotate(0deg);
    }
    100% {
        -webkit-transform: rotate(360deg);
    }
}

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

/* Styles the chart */
#my-chart {
    margin: auto;
    margin-top: 1rem;
    min-height: 100%;
    width: 100%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    padding: 1rem;
    border-radius: 6px;
}

/* * 10. Add Recipe () */

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

.my-recipes {
    background-color: var(--nav-color);
    min-height: 3rem;
    height: fit-content;
    width: fit-content;
    padding: 1rem;
    border-radius: 0 6px 6px 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    position: relative;
}

/* When arrow is pressed --> add this class */
.my-recipes-fixer {
    width: 3rem;
    height: 3rem;
}

.my-recipes h4 {
    margin-top: 1.6rem;
    font-size: 1.4rem;
    text-align: center;
}

.my-recipes-arrow {
    font-size: 1.4rem;
    cursor: pointer;
    position: absolute;
    right: 1rem;
}

.my-recipes-ul {
    list-style: none;
    margin-top: 0.4rem;
}

/* Give space between name and X */
.my-recipes-ul li {
    font-size: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.6rem;
    border-radius: 1rem;
    transition: 100ms ease-in-out;
}

/* adds color */
.my-recipes-ul li:hover {
    background-color: white;
}

.my-recipes-ul li span {
    text-wrap: nowrap; /* W3C Error but it doesn't matter */
    overflow: hidden;
    text-overflow: ellipsis;
}

.my-recipes-ul li span:hover {
    font-weight: 500;
    cursor: pointer;
}

.my-recipes > ul > li > div {
    display: flex;
    flex-wrap: nowrap;
}

.my-recipe-edit {
    font-size: 0.9rem;
    cursor: pointer;
    margin-left: 1rem;
    margin-top: 3px;
}

.my-recipe-x {
    cursor: pointer;
    margin-left: 0.2rem;
    transition: 200ms ease-in-out;
}

.my-recipe-x:hover,
.my-recipe-edit:hover {
    scale: 1.3;
}

/* Center it and style */
.form-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background-color: var(--nav-color);
    margin: 2rem auto;
    width: 80%;
    min-height: 67vh;
    border-radius: 6px;
    padding: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.form-title {
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.recipe-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

/* Take up half the space but 10 px between */
.input-box {
    width: calc(100% / 2 - 10px);
    min-width: 300px;
    margin: auto;
}

/* Style the inputs */
.input-box input,
.input-box textarea {
    min-height: 3rem;
    width: 100%;
    margin-bottom: 1rem;
    border: none;
    outline: none;
    border-radius: 8px;
    padding-left: 0.4rem;
    font-size: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.input-box textarea {
    resize: none;
    padding-top: 6px;
}

.input-box input:focus,
.input-box textarea:focus {
    border: 2px solid black;
}

.details {
    font-weight: 500;
    display: block;
}

.recipe-btn-container {
    display: flex;
    justify-content: center;
}

.add-recipe-btn {
    background-color: var(--txt1-color);
    color: white;
    padding: 0.6rem;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    transition: 300ms ease-in-out;
}

.add-recipe-btn:hover {
    scale: 1.1;
}

/* alert text */
#recipe-form h5 {
    text-align: center;
    margin: 0.6rem;
    font-size: 1.2rem;
}

/* Alert checkmark */
.fa-check {
    color: white;
    padding: 0.2rem;
    background-color: #000000;
    margin-left: 0.6rem;
    border-radius: 50%;
}

/*! All code validated with W3C Web Validator, 1 error at line 743 (but it's okay)*/
