/* General Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Lato', sans-serif;
}

body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

.app {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-actions {
  display: flex;
  gap: 8px;
}

/* Button Styles */
button, .icon-btn {
  cursor: pointer;
  padding: 8px;
  border: none;
  border-radius: 5px;
  background-color: #4d4d4d;
  color: #f2f2f2;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button:hover, .icon-btn:hover {
  background-color: #2b2b2b;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.icon-btn i {
  font-size: 18px;
}

/* Task Input */
#new-task, #edit-task-input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.task-input {
  display: flex;
  gap: 8px;
  margin: 20px 0;
}

/* Task List */
ul#task-list {
  list-style: none;
  margin-top: 20px;
}

li.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 5px;
  background-color: #f2f2f2;
  color: #333;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

li.task-item.completed {
  text-decoration: line-through;
  opacity: 0.6;
}

li.task-item.completed:not(.new-task) {
  transform: translateX(20px);
}

li.task-item.new-task {
  transform: translateX(-20px);
  opacity: 0;
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 5px;
  text-align: center;
  width: 80%;
  max-width: 400px;
  transform: scale(0.8);
  transition: transform 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.modal.show .modal-content {
  transform: scale(1);
}

/* Light Theme */
body.light {
  background-color: #f2f2f2;
  color: #333;
}

body.light .icon-btn, body.light button {
  background-color: #4d4d4d;
  color: #f2f2f2;
}

/* Dark Theme */
body.dark {
  background-color: #1a1a1a;
  color: #f2f2f2;
}

body.dark li.task-item {
  background-color: #333;
  color: #f2f2f2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

body.dark button, body.dark .icon-btn {
  background-color: #4d4d4d;
  color: #f2f2f2;
}

body.dark button:hover, body.dark .icon-btn:hover {
  background-color: #2b2b2b;
}

body.dark .modal-content {
  background-color: #333;
  color: #f2f2f2;
  border: 1px solid #4d4d4d;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}