/* General layout */

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

h1 {
  text-align: center;
  margin-bottom: 18px;
}

/* Controls */

form {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

form input {
  padding: 8px;
  min-width: 220px;
}

form button {
  padding: 8px 10px;
  cursor: pointer;
}

/* Filters */

#filters {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 12px 0;
  flex-wrap: wrap;
}

#filters select {
  padding: 6px;
  border-radius: 4px;
}

/* Alphabet navigation */

#alphabet {
  text-align: center;
  margin-bottom: 16px;
}

#alphabet button {
  margin: 2px;
  padding: 6px 8px;
  border-radius: 4px;
  border: none;
  background: #e6e6e6;
  cursor: pointer;
}

#alphabet button:hover {
  background: #d1d1d1;
}

/* Recipe grid (side-by-side) */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
}

.card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 6px;
}

.card h3 {
  font-size: 1.05rem;
  margin: 10px 0 6px;
}

/* Buttons inside cards */

.card button {
  margin: 4px 6px;
  padding: 6px 8px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: #f0f0f0;
}

.card .fav-btn.saved {
  background: #ffd86a;
}

/* Pagination */

#pagination {
  text-align: center;
  margin-top: 10px;
}

/* Modal */

.modal {
  display: none;
  position: fixed;
  z-index: 10;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: white;
  padding: 18px;
  border-radius: 8px;
  max-width: 760px;
  width: 94%;
  max-height: 90%;
  overflow-y: auto;
}

.close {
  float: right;
  font-size: 1.4em;
  cursor: pointer;
}

/* Lifetime stats */

#lifetimeStats {
  margin: 14px auto;
  padding: 12px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  max-width: 720px;
}

#lifetimeStats h2 {
  margin-top: 0;
}

#lifetimeStats ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#lifetimeStats li {
  margin: 6px 0;
}

