* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
}

body {
  background: linear-gradient(135deg, #03940f, #036546);
  color: #fff;
}

header nav {
  background-color: #212121;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1;
}

header nav h1 {
  font-size: 28px;
  font-weight: 800px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

header nav form {
  display: flex;
  justify-content: center;
}

form input[type="text"] {
  flex-grow: 1;
  margin-right: 10px;
}
form input[type="text"],
button[type="submit"] {
  border: none;
  font-size: 18px;
  padding: 10px;
  border-radius: 5px;
}
form button[type="submit"] {
  background-color: #fa3b3b;
  color: #fff;
  cursor: pointer;
}
form button[type="submit"]:hover,
.recipe button:hover {
  background-color: #c13333;
}

/*Main container.............*/

.recipe-container {
  text-align: center;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  grid-gap: 40px;
  width: 80%;
  margin: 10px auto;
  padding: 20px;
  place-items: center;
}

.recipe {
  background-color: #fff;
  display: flex;
  flex-direction: column;
  color: #000;
  border-radius: 8px;
  box-shadow: 0 5px 10px rgba(78, 73, 73, 0.1),
    -5px -5px 10px rgba(34, 34, 34, 0.5);
  cursor: pointer;
  max-width: 350px;
  transition: transform 0.3s ease-in-out;
}
.recipe:hover {
  transform: scale(1.02);
}

.recipe img {
  height: 350px;
  width: 350px;
  object-fit: cover;
}

.recipe h3 {
  font-size: 24px;
  margin: 5px;
}

.recipe p {
  font-size: 20px;
  color: #4a4a4a;
  margin: 5px 0;
}
.recipe span {
  font-weight: 600;
}

.recipe button {
  font-size: 20px;
  font-weight: 600;
  padding: 10px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  margin: 18px auto;
  background-color: #fa3b3b;
  color: #fff;
}
.recipe-detail {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
  background-color: #05802c;
  border-radius: 12px;
  width: 40%;
  height: 60%;
  font-size: 20px;
  transition: all 0.5 ease-in-out;
  overflow-y: scroll;
}

.recipe-detail {
  padding: 30px;
}
.recipeName {
  text-align: center;
  text-transform: uppercase;
  text-decoration: underline;
  margin-bottom: 20px;
}

.ingredientsList li {
  margin-top: 10px;
  margin-left: 20px;
  margin-bottom: 20px;
}
.instructions h3 {
  margin-bottom: 20px;
}

.instructions p {
  line-height: 30px;
  white-space: pre-line;
}

.recipe-closebtn {
  border: none;
  font-size: 18px;
  padding: 10px;
  border-radius: 4px;
  background-color: #fa3b3b;
  color: white;
  position: absolute;
  top: 20px;
  right: 20px;
  height: 30px;
  width: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}
.recipe-closebtn:hover {
  background-color: #c13333;
}

.recipe-detail {
  width: 50%;
}

/* Adding scroll bar to recipe detail popup */
.recipe-detail::-webkit-scrollbar {
  width: 10px;
}

.recipe-detail::-webkit-scrollbar-thumb {
  background-color: #02a034;
  border-radius: 15px;
  --webkit-border-radius: 15px;
}
.recipe-detail::-webkit-scrollbar-track {
  background-color: #4a4a4a;
}
/* Adding scrollbar to body ..... */
body::-webkit-scrollbar {
  width: 10px;
}

body::-webkit-scrollbar-thumb {
  background-color: #026020;
}
body ::-webkit-scrollbar-track {
  background-color: #4a4a4a;
}

/* Responsive code  */

@media screen and (max-width: 600px) {
  header nav {
    flex-direction: column;
  }
  header nav form {
    width: 80%;
    margin-top: 20px;
  }

  .recipe-container {
    text-align: center;
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    grid-gap: 20px;
    width: 90%;
    margin: 10px auto;
    padding: 20px;
    place-items: center;
  }

  .recipe {
    max-width: 100%;
  }

  .recipe img {
    width: 100%;
    height: auto;
    object-fit: cover;
  }

  .recipe h3 {
    font-size: 18px;
    margin: 3px;
  }

  .recipe p {
    font-size: 14px;
    margin: 3px 0;
  }
  .recipe span {
    font-weight: 400;
  }

  .recipe-detail {
    width: 80%;
  }
}
