body {
  font-family: Arial, sans-serif;
  background-color: #fafafa;
  margin: 0;
  padding: 20px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background-color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  margin: -20px -20px 20px -20px;
}

h1 {
  margin: 0;
  color: #333;
}

#favorites-filter {
  padding: 10px 20px;
  background-color: #008000;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}

#favorites-filter:hover {
  background-color: #006600;
}

#search {
  width: 100%;
  max-width: 400px;
  padding: 10px;
  font-size: 16px;
  margin: 20px auto;
  display: block;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#recipes {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-top: 20px;
}

.recipe-card {
  background-color: white;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  width: 260px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.recipe-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  transform: translateY(-5px);
}

.recipe-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.recipe-image:hover {
  transform: scale(1.05);
}

.recipe-content {
  padding: 15px;
  flex-grow: 1;
}

.recipe-title {
  font-size: 20px;
  margin: 0 0 10px 0;
  color: #222;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.view-recipe-btn {
  padding: 8px 12px;
  background-color: #008000;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  margin-right: 10px;
}

.view-recipe-btn:hover {
  background-color: #006600;
}

.favorite-btn {
  background-color: transparent;
  border: none;
  cursor: pointer;
  font-size: 24px;
  color: #ccc;
  transition: color 0.3s ease;
}

.favorite-btn.favorited {
  color: #e74c3c;
}

.favorite-btn:focus {
  outline: none;
}

.recipe-description {
  font-size: 14px;
  color: #555;
  margin-bottom: 15px;
}

.no-results {
  font-size: 18px;
  color: #999;
  text-align: center;
  width: 100%;
  margin-top: 40px;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 20px;
  border-radius: 15px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideIn 0.3s ease;
}

.close {
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #aaa;
}

.close:hover {
  color: #000;
}

#modal-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 15px;
}

#modal-ingredients {
  list-style-type: disc;
  padding-left: 20px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { transform: translateY(-50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  header {
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    margin: -10px -10px 10px -10px;
  }
  #search {
    max-width: 100%;
  }
  #recipes {
    gap: 10px;
  }
  .recipe-card {
    width: 100%;
  }
  .modal-content {
    width: 95%;
    margin: 10% auto;
  }
}
