@import url("https://fonts.googleapis.com/css2?family=Lily+Script+One&family=Luckiest+Guy&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
  background-color: #6495ed;
  color: #111;
}

/* Scrollbar */
body::-webkit-scrollbar {
  width: 12px;
}
body::-webkit-scrollbar-thumb {
  background: #a52a2a;
  border-radius: 10px;
}

/* Spacer for fixed header/footer */
body::before,
body::after {
  content: "";
  display: block;
  height: 80px;
}

/* Header */
header {
  z-index: 10;
  position: fixed;
  width: 100%;
  top: 0;
}
header nav {
  background-color: #ffe4c4;
  padding: 1rem 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}
header h1 {
  font-size: 1.6rem;
  font-weight: bold;
  text-transform: uppercase;
}
nav form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
form input[type="text"] {
  flex: 1;
  padding: 10px 15px;
  border-radius: 20px;
  border: none;
}
form button[type="submit"] {
  background-color: #a52a2a;
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
}
form button:hover {
  background-color: #a52a2af1;
}

/* Recipe Grid */
.recipe-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  padding: 120px 30px 140px;
  place-items: center;
}
.recipe {
  background-color: antiquewhite;
  border-radius: 8px;
  overflow: hidden;
  max-width: 350px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.recipe:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 16px rgba(34, 34, 34, 0.3);
}
.recipe img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}
.recipe h3 {
  font-size: 1.4rem;
  margin: 10px 0;
}
.recipe p {
  font-size: 1rem;
  color: #4a4a4a;
}
.recipe span {
  font-weight: bold;
}
.recipe button {
  background: #a52a2a;
  color: #fff;
  padding: 10px 20px;
  margin: 15px 0;
  border: none;
  border-radius: 5px;
  font-size: 1.1rem;
  cursor: pointer;
}
.recipe button:hover {
  background-color: #a52a2af1;
}

/* Modal Details */
.recipe-details {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 90%;
  max-width: 600px;
  height: 70%;
  padding: 20px;
  background: #c5a969f5;
  border-radius: 12px;
  transform: translate(-50%, -50%);
  z-index: 999;
  display: none;
  overflow-y: auto;
}
.recipe-details-content {
  padding: 20px;
}
.recipeName {
  text-align: center;
  text-transform: uppercase;
  text-decoration: underline;
}
.recipe-details h2,
.recipe-details h3 {
  margin-bottom: 10px;
}
.ingredientsList li {
  margin-bottom: 10px;
}
p.recipeInstructions {
  line-height: 1.6;
  white-space: pre-line;
}
.recipe-details li {
  list-style: circle;
  margin-left: 1rem;
}
.recipe-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: red;
  color: #fff;
  border: none;
  font-size: 20px;
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
}

/* Recipe Scrollbar */
.recipe-details::-webkit-scrollbar {
  width: 10px;
}
.recipe-details::-webkit-scrollbar-thumb {
  background: bisque;
  border-radius: 10px;
}

/* Footer */
footer {
  background: beige;
  text-align: center;
  padding: 20px;
  position: fixed;
  bottom: 0;
  width: 100%;
}
footer p {
  font-size: 1rem;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.footer-links a {
  background: #a52a2a;
  color: beige;
  padding: 10px 16px;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s ease;
}
.footer-links a:hover {
  background: beige;
  color: #a52a2a;
  border: 1px solid #a52a2a;
}

/* Home Section */
.home-card {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #4f83f1;
  border-radius: 40px;
  padding: 2rem;
  gap: 2rem;
  margin: 30px 0;
  flex-wrap: wrap;
}

.text-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 250px;
}

.home-title {
  font-size: 2.5rem;
  font-family: "Lily Script One", cursive;
  margin-bottom: 1rem;
  color: #fff;
}

.home-quote {
  background: #a72828;
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  font-family: "Luckiest Guy", cursive;
  font-size: 1rem;
  max-width: fit-content;
}

.image-section {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
}

.home-image {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fcd9b8;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* RESPONSIVE DESIGN */
/* max-width: 768px */
@media screen and (max-width: 768px) {
  .home-card {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }

  .home-title {
    font-size: 2rem;
  }

  .home-quote {
    align-self: center;
    margin-top: 1rem;
    font-size: 0.9rem;
  }

  .image-section {
    justify-content: center;
    margin-top: 1rem;
  }

  .home-image {
    width: 280px;
    height: 280px;
  }

  header nav {
    flex-direction: column;
    gap: 10px;
  }

  nav form {
    width: 100%;
    flex-direction: column;
  }

  .recipe-container {
    grid-template-columns: 1fr;
    padding-top: 120px;
  }

  footer {
    position: static;
    margin-top: 40px;
  }
}

/* max-width: 480px */
@media screen and (max-width: 480px) {
  .home-title {
    font-size: 1.8rem;
  }

  .home-quote {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .home-image {
    width: 230px;
    height: 230px;
  }

  form input,
  form button {
    font-size: 0.9rem;
  }

  .footer-links a {
    font-size: 0.9rem;
    padding: 8px 12px;
  }

  .recipe-details {
    font-size: 0.9rem;
  }

  .recipe button {
    font-size: 1rem;
  }
}
