body {
  font-family: Arial, sans-serif;
  background-color: #f0f0f0; /* Light background */
  color: #333; /* Dark text color for readability */
  margin: 0;
  padding: 0;
}

header {
  text-align: center;
  background-color: #f4e1d2;
  color: white;
  padding: 1rem;
}

header h1 {
  margin: 0;
}

.flex-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
}

.card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  width: 250px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease-in-out;
}

.card:hover {
  transform: scale(1.05);
}

.card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.card-body {
  padding: 1rem;
}

.card h3 {
  margin: 0.5rem 0;
  font-size: 1.2rem;
}

button {
  background-color: #007BFF;
  color: white;
  border: none;
  padding: 10px 15px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 5px;
}

button:hover {
  background-color: #0056b3;
}

.back-button {
  display: block;
  margin: 1rem auto;
  padding: 0.5rem 1rem;
  background: #007BFF;
  color: white;
  border: none;
  cursor: pointer;
}

.back-button:hover {
  background: #0056b3;
}

.modal {
  display: none;
  position: fixed;
  z-index: 10;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
}

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 2rem;
  border: 1px solid #888;
  width: 80%;
  max-width: 600px;
  border-radius: 8px;
}

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

.close:hover {
  color: black;
}

#modal-ingredients {
  list-style-type: disc;
  padding-left: 1.5rem;
}

#print-button {
  top: 10px;
  right: 50px;
  background-color: #007BFF;
  color: white;
  border: none;
  padding: 10px 15px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 5px;
}

#print-button:hover {
  background-color: #0056b3;
}

#ingredient-list {
  margin-top: 10px;
}

#ingredient-list div {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

#ingredient-list input[type="text"],
#ingredient-list input[type="number"] {
  flex: 1;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#ingredient-list button {
  background-color: #ff4d4d;
  color: #333;
  border: none;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 4px;
}

#ingredient-list button:hover {
  background-color: #cc0000;
}

input[type="text"],
input[type="number"],
textarea {
  width: 100%;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

input[type="number"] {
  width: calc(100% - 20px);
}

.hidden {
  display: none;
}

#preview-pane {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  padding: 1.5rem;
  margin-top: 1rem;
  min-height: 400px;
  position: sticky;
  top: 1.5rem; /* Adjust as needed for your header */
  align-self: flex-start; /* Ensures sticky works in flex layouts */
  z-index: 2;
}

.preview-card {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.preview-card img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.preview-card h3 {
  margin: 0.5rem 0 0.25rem 0;
}

.preview-card ul {
  padding-left: 1.2rem;
  margin: 0.5rem 0;
}

.preview-card pre {
  background: #f4f4f4;
  padding: 0.5rem;
  border-radius: 4px;
  white-space: pre-wrap;
}

details summary {
  cursor: pointer;
  font-weight: bold;
  font-size: 1.1em;
  margin-bottom: 0.5em;
}

details > div {
  margin-left: 1em;
  margin-bottom: 1em;
}

/* Notes Section */
#notes-section {
  margin-top: 10px;
}

#notes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.note-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.note-item input[type="text"],
.note-item textarea {
  flex: 1;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.note-item button {
  background-color: #ff4d4d;
  color: white;
  border: none;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 4px;
}

.note-item button:hover {
  background-color: #cc0000;
}

#authors-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.author-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.author-item input[type="text"] {
  flex: 1;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.author-item button {
  background-color: #ff4d4d;
  color: white;
  border: none;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 4px;
}

.author-item button:hover {
  background-color: #cc0000;
}

#modal-instructions {
  white-space: pre-wrap;
  word-break: break-word;
}