*{
  margin: 0px;
  padding: 0px;
  box-sizing: border-box;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
}

body{
  background-color: #2b1d0f;
  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: 26px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

header nav form{
  display: flex;
  justify-content: center;
}

ul.menu {
  list-style-type: none;
}
nav ul.menu li{
  display: inline-block;
  margin-left: 30px;
}
form input[type="text"]{
  flex-grow: 1;
  margin-left: 10px;
}

form input[type="text"],
button[type="submit"]{
  border: none;
  font-size: 18px;
  padding: 10px;
  border-radius: 4px;
}

form button[type="submit"]{
  background-color: #f44336;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
  margin-left: 10px;
}
form button[type="submit"]:hover, 
.recipe button:hover{
  background-color: #ff5c5c;
}

/* Main Section */

.recipe-container {
  text-align: center;
  margin-top: 20px;
  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: 6px;
  box-shadow: 0px 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.03);
}
.recipe img{
  height: 300px;
}
.recipe h3{
  font-size: 24px;
  margin-block: 5px;
}
.recipe p{
  font-size: 20px;
  color: #4a4a4a;
  margin: 5px 0;
}

.recipe span{
  font-weight: 600;
}
.recipe button{
  font-size: 17px;
  font-weight: 600;
  padding: 8px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  margin: 18px auto;
  background-color: #f44336;
  color: #fff;
}
 /* Recipe details */
.recipe-details{
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
  background-color: #694c2f;
  border-radius: 12px;
  width: 40%;
  height: 60%;
  font-size: 20px;
  transition: all 0.5s ease-in-out;
  overflow-y: scroll;
}
.recipe-details-content{
  padding: 30px;
}

.recipeName{
  text-align: center;
  text-transform: uppercase;
  text-decoration: line;

}

.ingredientList{
  margin-top: 10px;
  margin-left: 20px;
}

.Recipeinstructions p{
  line-height: 30px;
  white-space: pre-line;
}
.recipeName, .ingredientList, .Recipeinstructions{
  margin-bottom: 20px;
}
.recipe-close-btn{
  border: none;
  font-size: 18px;
  padding: 8px;
  border-radius: 4px;
  background-color: #f44336;
  color: #fff;
  position: absolute;
  top: 20px;
  right: 20px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.recipe-close-btn:hover{
  background-color: #f55e53;
  cursor: pointer;
  transform: scale(0.95);  
}

/* adding scroll bar to recipe details Popup */
.recipe-details::-webkit-scrollbar {
  width: 8px;
}
.recipe-details::-webkit-scrollbar-thumb {
  background: #a1a1a1;
  border-radius: 16px;
  --webkit-border-radius: 16px;
}

body::-webkit-scrollbar {
  width: 16px; 
}
body::-webkit-scrollbar-thumb {
  background: #a1a1a1;
  border-radius: 10px;
}
body::-webkit-scrollbar-track{
  background: #ebebeb;
}

/* Responsive code */
@media screen and (max-width:600px){
  header nav{
    flex-direction: column;
  }

  header nav form{
    width: 80%;
    margin-top: 20px;
  }
}