@import url('https://fonts.googleapis.com/css2?family=Work+Sans:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

/* 
maincolors reference:
primary: #44250c (dark brown)
secondary: #d2691e (light brown)
auxiliar: #53800a (green) 
*/

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Work Sans', sans-serif;
  font-weight: 500;
  transition: all 0.3s ease-in-out;
}

body {
  font-size: 14px;
  /* Make the body occupy the full height of the viewport */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100vh;
}

/* Header con logo y menu */
header {
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header img {
  flex-grow: 0;
}

nav {
  flex-grow: 1;
  text-align: right;
}

nav ul {
  font-size: 1.2rem;
  font-weight: 200;
  display: flex;
  justify-content: flex-end;
  gap: 1em;
  list-style: none;
}

.link {
  cursor: pointer;
  text-decoration: none;
  color: #d2691e;
}

.link:hover {
  color: #44250c;
}

/* Media queries para ajustar el logo y los enlaces cuando la pantalla es pequeña */
@media (max-width: 600px) {
  header {
    flex-direction: column;
  }

  header img {
    /* Centrar el logo */
    margin-right: auto;
    margin-left: auto;
  }

  nav {
    text-align: center;
  }
}

/* Barra superior busqueda/titulo meal */
.topbar {
  background-color: #44250c;
  margin-bottom: 2rem;
  padding: 25px;
}

#topbar-container {
  max-width: 720px;
  height: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto;
}

.topbar-search,
.topbar-filter {
  margin: 5px;
}

.topbar-search p,
.topbar-filter p {
  color: white;
  margin-bottom: 0.3rem;
  font-weight: 400;
}

#searchInput {
  width: 300px;
  height: 2rem;
  padding: 1rem;
}

#areaSelect,
#categorySelect {
  width: 150px;
  height: 2rem;
  /* padding: 1rem; */
}

#searchButton {
  width: 68px;
  height: 33px;
  margin: 5px 0;
}

/* Footer */
footer {
  margin: 2rem 4rem 1rem;
}

footer p {
  font-weight: 400;
  text-align: center;
  color: #999;
  padding-top: 1rem;
  border-top: 1px solid #ccc;
}

/* Contenedor general cuerpo de pagina (main) */
div.container {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-wrap: nowrap;
}

/* Titular en barra separacion */
.dividertxt {
  font-size: 1.3rem;
  font-weight: 400;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  color: black;
  margin-bottom: 30px;
}

.dividertxt::before,
.dividertxt::after,
.recipe-dividertxt::before,
.recipe-dividertxt::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgb(211, 211, 211);
}

.dividertxt::before,
.recipe-dividertxt::before {
  margin-right: 10px;
}

.dividertxt::after,
.recipe-dividertxt::after {
  margin-left: 10px;
}

div.mealcard {
  width: 210px;
  /* margin-bottom: 30px; */
  margin: 0 15px 30px;
  cursor: pointer;
}

/* ///// Estilos para card general ////// */

/* Barra valoracion y favorito (estrellas y corazon)*/
.ratingbar,
.daymeal-ratingbar {
  display: flex;
  justify-content: space-between;
  width: 100%;
  height: 30px;
  background-color: black;
  padding: 0.45rem;
}

.star-container,
.heart-container {
  display: flex;
  flex-direction: row;
  gap: 0.3rem;
}

.star,
.heart {
  width: 15px;
  height: 15px;
  background-size: cover;
  background-repeat: no-repeat;
  cursor: pointer;
}

.star-empty {
  background-image: url(./resources/img/star-empty.png);
}

.star-full {
  background-image: url(./resources/img/star-full.png);
}

.heart-empty {
  background-image: url(./resources/img/heart-empty.png);
}

.heart-full {
  background-image: url(./resources/img/heart-full.png);
}

/* Imagen card */
.imgcontainer {
  height: 287px;
  overflow: hidden;
}

.imgcontainer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mealcard img {
  width: 100%;
}

/* Textos inferior card */
.mealcard-category {
  color: #53800a;
  margin-top: 0.5rem;
  margin-bottom: 0.3rem;
}

.mealcard-name {
  color: black;
  font-size: 1.05rem;
  font-weight: 300;
}

/* Meal of the day */
.daymeal-container {
  display: flex;
  margin-bottom: 1rem;
}

.daymeal-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 50%;
  text-align: center;
  padding: 2rem;
}

.daymeal-title,
.daymeal-name,
.daymeal-text {
  color: black;
}

.daymeal-title {
  font-size: 1rem;
}

.daymeal-name {
  font-size: 2rem;
  font-weight: 700;
  padding: 1rem 0;
}

.daymeal-text {
  font-weight: 400;
}

.daymeal-right {
  width: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.daymeal-right .daymeal-ratingbar {
  width: 100%;
  height: 30px;
  background-color: black;
}

.daymeal-right .daymeal-img {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  overflow: hidden;
}

.daymeal-right .daymeal-img img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Media queries para la receta individual para -600px */
@media screen and (max-width: 600px) {
  .daymeal-container {
    flex-direction: column;
  }

  .daymeal-left {
    width: 100%;
  }

  .daymeal-right {
    width: 90%;
    margin: 0 auto;
  }
}

/* Estilos pagina receta individual */
#recipe-topbar-container {
  /* width: 720px; */
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}

#recipe-topbar-name {
  font-size: 2.5rem;
  font-weight: 500;
  color: white;
  text-align: center;
}

/* Nombre/Titulo para cuando va en home, no en pag receta individual */
#recipe-home-name {
  font-size: 1.5rem;
  font-weight: 300;
  color: black;
  text-align: center;
  margin-bottom: 20px;
}

.recipe-dividertxt {
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  color: black;
  margin-bottom: 30px;
  margin-top: 30px;
}

.daymeal-text,
.recipe-instructions {
  font-weight: 400;
  line-height: 1.2rem;
}

#ingredients-container {
  display: flex;
}

#ingredients-names,
#ingredients-quantities {
  display: flex;
  flex-direction: column;
  width: 50%;
}

#ingredients-names p,
#ingredients-quantities p {
  padding-bottom: 0.4rem;
  font-weight: 300;
}

#ingredients-names {
  justify-content: flex-end;
  align-items: flex-end;
  padding-right: 0.7rem;
}

#ingredients-quantities {
  justify-content: flex-start;
  align-items: flex-start;
  padding-left: 0.7rem;
}

#recipe-video-placeholder {
  position: relative;
  padding-bottom: 56.25%; /* Establece el aspect ratio en 16:9 */
}

#recipe-video-placeholder iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Estilos pag myfrig */
#ingredientsContainer {
  display: flex;
  flex-direction: column;
}

.letter-container {
  flex-wrap: wrap;
}

.letter-title {
  text-align: center;
  font-size: 1.5rem;
  border: 1px solid lightgrey;
  border-radius: 0.5rem;
  padding: 0.5rem;
  margin: 0.2rem;
  cursor: pointer;
}

.checkboxes-container {
  display: none;
  /* display: flex;
  flex-wrap: wrap; */
}

.checkboxes-container-collapsed {
  /* display: none; */
  display: flex;
  flex-wrap: wrap;
}

.ingredient-container {
  padding: 0.3rem;
  border: 1px solid lightgrey;
  border-radius: 0.2rem;
  margin: 5px;
}

input[type='checkbox'] + label {
  margin-left: 3px;
}

input[type='checkbox']:checked + label {
  margin-left: 3px;
  color: #d2691e;
}

.find-recipes-by-ingredients {
  max-width: 50%;
  padding: 1rem;
  background-color: #44250c;
  color: #f7f7f7;
  border-radius: 0.5rem;
  display: block;
  margin: 1rem auto;
}

.card {
  width: 200px;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 10px;
  margin-bottom: 10px;
}

.card img {
  max-width: 100%;
  height: auto;
  display: block;
  margin-bottom: 10px;
}

.results-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
}

#paginationContainer {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

#paginationContainer button {
  margin: 5px;
  padding: 10px;
}
