/* ==============================
   Reset
============================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  min-height: 100vh;
  background: teal;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem;
}

/* ==============================
   Container
============================== */
.container {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  width: 450px;
  max-width: 100%;
}

/* ==============================
   Header
============================== */
header {
  text-align: center;
  margin-bottom: 1.5rem;
}

header h1 {
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.input-section {
  display: flex;
  justify-content: center;
  align-items: center;
}

.input-section input {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  outline: none;
  font-size: 1rem;
}

.input-section input:focus {
  border-color: #3b82f6;
}

.input-section button {
  margin-left: 0.5rem;
}

/* ==============================
   Todo list
============================== */
.todos-list {
  list-style: none;
  margin-top: 1rem;
}

.todo-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff; /* même fond que input */
  padding: 0.6rem 0.8rem;
  border: 2px solid #ddd; /* même bordure */
  border-radius: 8px; /* même arrondi */
  margin-bottom: 0.6rem;
  transition: border-color 0.2s ease-in-out, background 0.2s ease-in-out;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); /* légère ombre */
}

.todo-item:hover {
  border-color: #3b82f6; /* comme l'input au focus */
  background: #f9fafb;
}

.todo-item p {
  flex: 1;
  margin-right: 0.5rem;
  font-size: 1rem;
}

.line {
  text-decoration: line-through;
  color: #999;
}

/* ==============================
   Actions buttons
============================== */
.todo-actions {
  display: flex;
  gap: 0.3rem;
}

/* Base style */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
}

/* Add button */
.btn-add {
  background-color: #3b82f6;
  color: #fff;
}
.btn-add:hover {
  background-color: #2563eb;
}

/* Complete button */
.btn-success {
  background-color: #22c55e;
  color: #fff;
}
.btn-success:hover {
  background-color: #16a34a;
}

/* Delete button */
.btn-error {
  background-color: #ef4444;
  color: #fff;
}
.btn-error:hover {
  background-color: #dc2626;
}

/* Edit button */
.btn-edit {
  background-color: #facc15;
  color: #000;
}
.btn-edit:hover {
  background-color: #eab308;
  color: #111;
}

/* ==============================
   Filter buttons
============================== */
.todos-filter {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
}

.todos-filter .btn-ghost {
  background: transparent;
  color: #555;
  padding: 0.4rem 0.6rem;
}

.todos-filter .btn-ghost:hover {
  background: #f1f5f9;
  border-radius: 6px;
}
