/* Reset default styles for consistency */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Global typography and body styling with background image */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.7;
  color: #1a1a1a;
  background: url('https://images.unsplash.com/photo-1490818387583-1b2a9a5d8b9f?ixlib=rb-4.0.3&auto=format&fit=crop&w=1350&q=80') no-repeat center center fixed;
  background-size: cover;
  background-attachment: fixed;
  position: relative;
}

/* Overlay to ensure text readability on body background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(248, 249, 250, 0.85);
  z-index: -1;
}

/* Header styling with a complementary food-themed background */
header {
  background: linear-gradient(rgba(44, 62, 80, 0.9), rgba(44, 62, 80, 0.9)), url('https://images.unsplash.com/photo-1543352634-a1c51d9f1fa7?ixlib=rb-4.0.3&auto=format&fit=crop&w=1350&q=80') no-repeat center center;
  background-size: cover;
  color: #ffffff;
  text-align: center;
  padding: 3rem 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

header h1 {
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

header p {
  font-size: 1.2rem;
  font-weight: 300;
  opacity: 0.85;
}

/* Main container with max-width for readability */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 1rem;
}

/* Search section with sleek input design */
#search-section {
  margin-bottom: 3rem;
  display: flex;
  justify-content: center;
}

#search-form {
  width: 100%;
  max-width: 600px;
}

#search-input {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  border: 1px solid #e0e0e0;
  border-radius: 50px;
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

#search-input:focus {
  outline: none;
  border-color: #d35400;
  box-shadow: 0 0 0 4px rgba(211, 84, 0, 0.1);
}

/* Recipe list with modern CSS Grid */
.recipe-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

/* Recipe card with hover animation */
.recipe-card {
  background-color: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.recipe-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.recipe-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-bottom: 1px solid #f0f0f0;
}

.recipe-card h3 {
  font-size: 1.6rem;
  font-weight: 600;
  padding: 1.25rem;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.recipe-card p {
  padding: 0 1.25rem 1.25rem;
  color: #6b7280;
  font-size: 1rem;
  line-height: 1.5;
}

/* Recipe detail section with polished layout */
#recipe-detail {
  background-color: #ffffff;
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  max-width: 800px;
  margin: 0 auto;
}

#recipe-detail h2 {
  font-size: 2.2rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 1.5rem;
}

#recipe-detail img {
  width: 100%;
  max-width: 500px;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#recipe-detail h3 {
  font-size: 1.4rem;
  font-weight: 600;
  color: #2c3e50;
  margin: 1.5rem 0 0.75rem;
}

#recipe-detail ul,
#recipe-detail ol {
  padding-left: 1.75rem;
  margin-bottom: 1.5rem;
}

#recipe-detail li {
  margin-bottom: 0.75rem;
  font-size: 1.05rem;
  color: #4b5563;
}

#recipe-detail button {
  background-color: #d35400;
  color: #ffffff;
  border: none;
  padding: 0.9rem 2rem;
  border-radius: 50px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 500;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

#recipe-detail button:hover {
  background-color: #b74700;
  transform: translateY(-2px);
}

/* Footer with professional polish */
footer {
  text-align: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: #ffffff;
  font-size: 0.95rem;
  margin-top: 3rem;
}

/* Hidden class for toggling visibility */
.hidden {
  display: none;
}

/* Responsive design with media queries */
@media (max-width: 1024px) {
  header h1 {
    font-size: 2.4rem;
  }

  main {
    padding: 2rem 1rem;
  }

  .recipe-list {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }

  header p {
    font-size: 1.1rem;
  }

  #search-input {
    font-size: 1rem;
    padding: 0.8rem;
  }

  .recipe-card img {
    height: 180px;
  }

  .recipe-card h3 {
    font-size: 1.4rem;
  }

  #recipe-detail {
    padding: 1.5rem;
  }

  #recipe-detail h2 {
    font-size: 1.8rem;
  }

  #recipe-detail img {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.6rem;
  }

  header p {
    font-size: 0.95rem;
  }

  #search-input {
    font-size: 0.9rem;
    padding: 0.7rem;
  }

  .recipe-list {
    grid-template-columns: 1fr;
  }

  .recipe-card h3 {
    font-size: 1.3rem;
  }

  .recipe-card p {
    font-size: 0.95rem;
  }

  #recipe-detail h2 {
    font-size: 1.5rem;
  }

  #recipe-detail button {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }
}