@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ---------- Global Styles ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  background-color: #fffaf0;
  background-image: url(logo.jpg);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-blend-mode: multiply;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
header {
  color: #ffaa00;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
  text-align: center;
  padding: 20px 10px 30px;
}

h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 15px;
}

/* ---------- Search Bar ---------- */
/* ---------- Search Bar + Favourites (Responsive) ---------- */
.search {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
}

.search input {
  padding: 10px 14px;
  border: 2px solid #ffaa00;
  width: 45%;
  min-width: 220px;
  font-size: 15px;
  border-radius: 10px;
  outline: none;
  transition: 0.3s;
}

.search input:focus {
  border-color: #FF5722;
  box-shadow: 0 0 8px 2px rgba(255, 102, 0, 0.5);
}

.search button {
  padding: 10px 18px;
  background-color: #ffaa00;
  border: none;
  cursor: pointer;
  font-size: 15px;
  color: #fff;
  font-weight: 600;
  border-radius: 10px;
  transition: 0.3s ease;
}

.search button:hover {
  background-color: #e91e63;
}

/* ---------- Favourites Button ---------- */
.favourites-btn {
  background: linear-gradient(135deg, #ffb703, #ff9100);
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  color: #fff;
  margin: 15px auto;
  display: block;
  text-align: center;
  font-size: 16px;
  box-shadow: 0 3px 8px rgba(255, 183, 3, 0.4);
  transition: all 0.3s ease;
}

.favourites-btn:hover {
  background: linear-gradient(135deg, #ffa600, #ff7300);
  transform: scale(1.05);
}

/* ---------- Responsive - Tablet ---------- */
@media screen and (max-width: 980px) {
  .search input {
    width: 60%;
  }
  .search button {
    font-size: 14px;
    padding: 9px 16px;
  }
  .favourites-btn {
    width: 60%;
    font-size: 15px;
  }
}

/* ---------- Responsive - Mobile ---------- */
@media screen and (max-width: 600px) {
  .search {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .search input {
    width: 90%;
    font-size: 14px;
  }

  .search button {
    width: 70%;
    font-size: 14px;
    border-radius: 8px;
  }

  .favourites-btn {
    width: 80%;
    font-size: 14px;
    padding: 10px;
  }
}

/*--*/
/* ---------- Meal Cards ---------- */
.meal-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin: 20px;
}

.meal-item {
  flex-basis: calc(25% - 20px);
  max-width: calc(25% - 20px);
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(149, 157, 165, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.meal-item:hover {
  transform: scale(1.05);
}

.meal-item img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 10px;
}

.meal-item h3 {
  text-align: center;
  margin-top: 10px;
  font-size: 17px;
  font-weight: 600;
}

/* ---------- Favourites Button ---------- */
.favourites-btn {
  background: linear-gradient(135deg, #ffb703, #ff9100);
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  color: #fff;
  margin: 10px auto;
  display: block;
  transition: all 0.3s ease;
  text-align: center;
  font-size: 16px;
  box-shadow: 0 3px 8px rgba(255, 183, 3, 0.4);
}

.favourites-btn:hover {
  background: linear-gradient(135deg, #ffa600, #ff7300);
  transform: scale(1.05);
}

/* ---------- Add/Remove Favourite Buttons (Meal Cards) ---------- */
.fav-btn {
  margin-top: 8px;
  padding: 8px 14px;
  background: #ff4d6d;
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 200px;
  text-align: center;
}

.fav-btn:hover {
  background: #ff1e4d;
  transform: scale(1.03);
}

/* ---------- Modal Popup ---------- */
.modal-container {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  padding: 20px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
  z-index: 1000;
 
  flex-direction: column;
  gap: 15px;
  animation: fadeIn 0.3s ease;
}

.close-button {
  font-size: 36px;
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
  align-self: flex-end;
  transition: all 0.3s ease;
}

.close-button:hover {
  color: #ff4081;
}

.meal-details-content h2 {
  font-size: 24px;
  text-align: center;
  margin-bottom: 5px;
}

.meal-details-content img {
  width: 100%;
  max-height: 300px;
  border-radius: 10px;
  object-fit: cover;
}

.meal-details-content p, 
.meal-details-content ul {
  font-size: 16px;
  line-height: 1.6;
  color: #444;
}

.meal-details-content ul {
  list-style: disc;
  padding-left: 20px;
  margin-bottom: 10px;
}

.meal-details-content a {
  display: inline-block;
  text-decoration: none;
  padding: 10px 20px;
  background-color: #ff4081;
  border-radius: 10px;
  color: #fff;
  font-weight: 600;
  transition: 0.3s ease;
  margin-top: 10px;
}

.meal-details-content a:hover {
  background-color: #e91e63;
}

/* ---------- Fade-in Animation ---------- */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- Responsive - Tablet ---------- */
@media screen and (max-width: 980px) {
  .meal-item {
    flex-basis: calc(50% - 20px);
    max-width: calc(50% - 20px);
  }

  .search input {
    width: 60%;
  }

  h1 {
    font-size: 28px;
  }

  .modal-container {
    max-width: 500px;
    padding: 18px;
  }

  .meal-details-content h2 {
    font-size: 22px;
  }

  .meal-details-content p, 
  .meal-details-content ul {
    font-size: 15px;
  }
}

/* ---------- Responsive - Mobile ---------- */
@media screen and (max-width: 600px) {
  body {
    background-position: top;
  }

  header {
    padding: 15px;
  }

  h1 {
    font-size: 24px;
  }

  .search {
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 10px;
  }

  .search input {
    width: 90%;
    font-size: 14px;
    padding: 10px;
    min-width: unset;
  }

  .search button {
    width: 70%;
    font-size: 14px;
    border-radius: 8px;
  }

  .meal-item {
    flex-basis: 100%;
    max-width: 100%;
    padding: 10px;
  }

  .meal-item img {
    max-height: 200px;
  }

  .modal-container {
    width: 95%;
    max-width: unset;
    padding: 12px;
  }

  .meal-details-content h2 {
    font-size: 18px;
  }

  .meal-details-content p, 
  .meal-details-content ul {
    font-size: 14px;
  }

  .meal-details-content img {
    max-height: 200px;
  }

  .meal-details-content a {
    font-size: 13px;
    padding: 8px 15px;
  }
}

