* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Georgia, "Times New Roman", Times, serif;
}

body {
  background-color: #ffdb58;
  color: #fff;
  background-image: url('images/food\ recipe.jpg'); /* Update the path to your image file */
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}


/* Add margin-right to the search input */
.searchBox {
  outline: none;
  border: none;
  border-radius: 30px;
  padding: 10px 20px;
  font-size: 18px;
  background-color: #fff;
  width: 70%;
  margin-right: 10px; 
  color: #000;
}

.searchBtn {
  border: none;
  border-radius: 30px;
  padding: 10px 20px;
  font-size: 18px;
  background-color: #f44336;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}

.searchBtn:hover {
  background-color: #da4d11;
}

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;
}

form input[type="text"],
button[type="submit"] {
  border: none;
  font-size: 18px;
  padding: 10px;
  border-radius: 4px;
}

form button[type="submit"] {
  background-color: #a13549;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}
form button[type="submit"]:hover , .recipe button:hover , .recipe-close-btn:hover {
  background-color: #da4d11;
}

/* 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: 10px; 
  box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.2); 
  cursor: pointer;
  max-width: 350px;
  transition: transform 0.3s ease-in-out;
}

.recipe:hover{
  transform: scale(1.08);
}
.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{
  border: none;
  font-size: 20px;
  font-weight: 600;
  padding: 10px;
  border-radius: 5px;
  bottom: none;
  cursor: pointer;
  margin: 18px auto;
  background-color: #f0788e;
  color: #fff;
}

.recipe button:active {
  transform: scale(0.95);
}

/* 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;
}

/* Adding scrollbar to recipe details popup */

.recipe-details::-webkit-scrollbar{
  width: 10px;
}

.recipe-details::-webkit-scrollbar-thumb{
  background-color: #6e6c6c;
 
}

body::-webkit-scrollbar{
  width: 10px;
}

body::-webkit-scrollbar-thumb{
  background-color: #b5b5ba;
  border-radius: 16px;
  --webkit-border-radius: 16px;
}
body::-webkit-scrollbar-track{
  background-color: #ebebeb;
}

.recipe-details-content{
  padding: 30px;
  color: #fff;      /* new */
}

.recipeName{
  text-align: center;
  text-transform: uppercase;
  text-decoration: underline;
  font-size: 28px;    /* new */
  margin-bottom: 10px;   /* new */
}

.ingredientList li{
  margin-top: 10px;
  margin-left: 20px;
  font-size: 18px;      /* new */
}

.recipeInstructions p {
  line-height: 30px;
  font-size: 18px;      /* new */
  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: #d5645bbf;
  color: #fff;
  position: absolute;
  top: 20px;
  right: 20px;
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Responsiveness */
@media screen and (max-width: 600px) {
  header nav {
    flex-direction: column;
  }
  header nav form {
    width: 80%;
    margin-top: 20px;
  }
}
