/* ==================================================
   RESET GENERAL Y CONFIGURACIÓN BASE
   ================================================== */
* {
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  background: #1e1e1e;
  color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* ==================================================
   CONTENEDOR PRINCIPAL DE LA APP
   ================================================== */
.app {
  background: #2b2b2b;
  padding: 20px;
  width: 100%;
  max-width: 360px;
  border-radius: 10px;
}

/* ==================================================
   TÍTULO
   ================================================== */
.app h1 {
  text-align: center;
  font-size: 22px;
  margin-bottom: 5px;
}

.app h1::after {
  content: "Organizá tu día de forma simple";
  display: block;
  font-size: 13px;
  color: #9e9e9e;
  margin-top: 4px;
}

/* ==================================================
   INPUT + BOTÓN AGREGAR
   ================================================== */
.input-container {
  display: flex;
  gap: 6px;
  margin-top: 15px;
}

input {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 5px;
}

button {
  padding: 8px 12px;
  border: none;
  background: #4caf50;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

button:hover {
  background: #43a047;
  transform: scale(1.05);
}

/* ==================================================
   BOTONES DE ACCIONES (LIMPIAR)
   ================================================== */
.actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.actions button {
  flex: 1;
  font-size: 13px;
}

#clearCompleted {
  background: #4caf50;
}

#clearCompleted:hover {
  background: #388e3c;
}

#clearPending {
  background: #ff9800;
}

#clearPending:hover {
  background: #f57c00;
}

/* ==================================================
   CONTADOR DE TAREAS
   ================================================== */
#counter {
  margin-top: 10px;
  font-size: 14px;
  text-align: center;
  color: #cfd8dc;
}

/* ==================================================
   LISTA DE TAREAS
   ================================================== */
ul {
  list-style: none;
  padding: 0;
  margin-top: 15px;
}

/* ==================================================
   TAREA INDIVIDUAL
   ================================================== */
li {
  background: #3a3a3a;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: fadeInUp 0.3s ease;
  transition: background 0.3s ease, opacity 0.3s ease;
}

/* Texto e icono de la tarea */
.task-text {
  display: flex;
  align-items: center;
}

.task-text i {
  margin-right: 8px;
  color: #4caf50;
}

/* ==================================================
   ESTADO: TAREA COMPLETADA
   ================================================== */
li.completed {
  background: #1f3d2b;
  opacity: 0.75;
  box-shadow: inset 0 0 0 1px #81c784;
}

li.completed .task-text {
  text-decoration: line-through;
  color: #b0bec5;
}

li.completed i {
  color: #81c784;
}

/* ==================================================
   BOTONES DE CADA TAREA
   ================================================== */
li button {
  margin-left: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

li button:hover {
  transform: scale(1.1);
  opacity: 0.9;
}

/* Botón completar */
.complete-btn {
  background: #4caf50;
  color: white;
}

.complete-btn:hover {
  background: #43a047;
}

/* Botón eliminar */
li button:last-child {
  background: #e53935;
  color: white;
}

li button:last-child:hover {
  background: #d32f2f;
}

/* ==================================================
   MENSAJE LISTA VACÍA
   ================================================== */
#emptyMessage {
  text-align: center;
  font-size: 14px;
  color: #81c784;
  margin-top: 10px;
  display: none;
}

/* ==================================================
   ANIMACIÓN
   ================================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================================================
   RESPONSIVE (CELULARES)
   ================================================== */
@media (max-width: 480px) {
  body {
    align-items: flex-start;
    padding-top: 20px;
  }

  .app {
    width: 95%;
  }

  .input-container {
    flex-direction: column;
  }

  .input-container input,
  .input-container button {
    width: 100%;
  }

  .actions {
    flex-direction: column;
  }

  .actions button {
    width: 100%;
  }
}

