/* styles.css */
:root {
  --bg: #181a1b;
  --fg: #f1f3f4;
  --accent: #00bfae;
  --border: #2a2d2e;
  --checked: #00897b;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Segoe UI', 'Arial', sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.container {
  margin-top: 5vh;
  background: #222426;
  border-radius: 12px;
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  box-shadow: 0 2px 16px #000a;
  width: 100%;
  max-width: 400px;
}

h1 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  letter-spacing: 1px;
}

form#addForm {
  display: flex;
  gap: 0.5em;
  margin-bottom: 1.2em;
}

#itemInput {
  flex: 1 1 auto;
  padding: 0.6em 0.9em;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #181a1b;
  color: var(--fg);
  font-size: 1rem;
  outline: none;
  transition: border 0.2s;
}

#itemInput:focus {
  border-color: var(--accent);
}

#addBtn {
  padding: 0.6em 1.1em;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 7px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

#addBtn:hover, #addBtn:focus {
  background: var(--checked);
  outline: none;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
}

.checklist li {
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s;
}

.checklist li:last-child {
  border-bottom: none;
}

.checklist label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 1.08rem;
  flex: 1 1 auto;
}

.checklist input[type="checkbox"] {
  accent-color: var(--accent);
  width: 1.25em;
  height: 1.25em;
  margin-right: 1em;
  transition: accent-color 0.2s;
}

.checklist .delete-btn,
.checklist .edit-btn,
.checklist .save-btn,
.checklist .cancel-btn {
  background: none;
  border: none;
  color: #f55;
  font-size: 1.2em;
  margin-left: 0.5em;
  cursor: pointer;
  border-radius: 4px;
  padding: 0.2em 0.4em;
  transition: background 0.2s, color 0.2s;
}

.checklist .edit-btn {
  color: var(--accent);
  font-size: 1em;
}

.checklist .save-btn {
  color: #6fcf97;
  font-size: 1em;
}

.checklist .cancel-btn {
  color: #f1c40f;
  font-size: 1em;
}

.checklist .delete-btn:hover, .checklist .delete-btn:focus {
  background: #3a1a1a;
  outline: none;
}

.checklist .edit-btn:hover, .checklist .edit-btn:focus {
  background: #163c39;
  outline: none;
}

.checklist .save-btn:hover, .checklist .save-btn:focus {
  background: #193e2e;
  outline: none;
}

.checklist .cancel-btn:hover, .checklist .cancel-btn:focus {
  background: #3a2a1a;
  outline: none;
}

.checklist input[type="checkbox"]:checked + span,
.checklist input[type="checkbox"]:checked ~ span {
  color: var(--checked);
  text-decoration: line-through;
}

.checklist .edit-input {
  flex: 1 1 auto;
  padding: 0.4em 0.7em;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #181a1b;
  color: var(--fg);
  font-size: 1rem;
  margin-right: 0.5em;
}

.clear-btn {
  display: block;
  width: 100%;
  padding: 0.7em 0;
  background: none;
  border: 2px solid var(--accent);
  color: var(--accent);
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.clear-btn:hover, .clear-btn:focus {
  background: var(--accent);
  color: var(--bg);
  outline: none;
}

@media (max-width: 500px) {
  .container {
    padding: 1.2rem 0.5rem 1rem 0.5rem;
    max-width: 98vw;
  }
  h1 {
    font-size: 1.3rem;
  }
}
