/* Basic reset so spacing looks the same in every browser */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  background: #f4f5f7;
  color: #1f2933;
  line-height: 1.5;
  padding: 2rem 1rem;
}

/* The centered card that holds the whole app */
.app {
  max-width: 480px;
  margin: 0 auto;
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* The "add a note" form: input + button side by side */
.add-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.add-form input {
  flex: 1; /* take up the remaining space */
  padding: 0.6rem 0.75rem;
  border: 1px solid #cbd2d9;
  border-radius: 8px;
  font-size: 1rem;
}

.add-form input:focus {
  outline: none;
  border-color: #3b82f6;
}

/* Buttons (shared look) */
button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  padding: 0.6rem 1rem;
  background: #3b82f6;
  color: #ffffff;
}

button:hover {
  background: #2f6fd6;
}

/* The list of notes */
.notes-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* One note row */
.note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e4e7eb;
  border-radius: 8px;
}

.note .text {
  flex: 1; /* push the buttons to the right */
  word-break: break-word;
}

/* Smaller, softer buttons for edit/delete */
.note .actions button {
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  margin-left: 0.35rem;
}

.note .edit-btn {
  background: #e4e7eb;
  color: #1f2933;
}

.note .edit-btn:hover {
  background: #d3d8de;
}

.note .delete-btn {
  background: #ef4444;
}

.note .delete-btn:hover {
  background: #dc2626;
}

/* Status / error message under the list */
.status {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #6b7280;
  min-height: 1.2em; /* reserve space so layout doesn't jump */
}

.status.error {
  color: #dc2626;
}
