/* RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
}

body {
  background: #111;
  color: #fff;
  display: flex;
  justify-content: center;
  padding: 20px;
}

/* CONTAINER */
.container {
  width: 100%;
  max-width: 500px;
  background: #1b1b1b;
  padding: 25px;
  border-radius: 16px;
}

/* FORM */
#todo-form {
  display: flex;
  gap: 10px;
}

#todo-input {
  flex: 1;
  min-width: 0;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: #2b2b2b;
  color: white;
}

#todo-input::placeholder {
  color: #bbb;
}

#todo-form button {
  padding: 14px 18px;
  border: none;
  border-radius: 12px;
  background: #567df4;
  color: white;
  font-weight: bold;
  flex-shrink: 0;
}

/* LIST */
.todo-list {
  list-style: none;
  margin-top: 22px;
}

/* EACH TODO ITEM */
.todo-list li {
  background: #262626;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;

  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;

  word-break: break-all; /* ← FIX #1 (WRAPS ANY TEXT) */
}

/* VIEW MODE TEXT */
.todo-text {
  font-size: 16px;
  line-height: 1.4;
  overflow-wrap: anywhere; /* ← FIX #2 */
}

/* EDIT MODE INPUT */
.todo-edit-input {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border-radius: 10px;
  border: none;
  outline: 2px solid #4a9eff;
  background: #333;
  color: white;

  word-break: break-all;
  overflow-wrap: anywhere; /* ← FIX #3 */
}

/* ACTION BUTTONS */
.todo-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;            /* ← FIX #4 */
  width: 48px;               /* ← FIX #5 (FIXED BUTTON COLUMN) */
}

.todo-actions button {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 12px;
  font-size: 20px;
  cursor: pointer;
  color: white;
}

/* COLORS */
button.edit { background: #f4a261; }
button.delete { background: #e63946; }
button.save { background: #2a9d8f; }
button.cancel { background: #b91c1c; }


html, body {
  height: 100%;
  display: flex;
  flex-direction: column;
}

footer {
  margin-top: auto;
  text-align: center;
  padding: 28px;
  opacity: 0.6;
  font-size: 0.95rem;
}
.container {
  width: 100%;
  max-width: 500px;
  margin: 0 auto; /* Centers the todo list */
  flex: 1;        /* Pushes footer to bottom */
}
footer {
  margin-top: auto;
  text-align: center;
  padding: 28px;
  opacity: 0.6;
  font-size: 0.95rem;
}

a{
  color: white;
}