@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;400&display=swap');

* {
  box-sizing: border-box;
}

body {
  background-color: #C24641;
  color: black;
  font-family: 'Arial', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  margin: 0;
}

h1 {
  color: white;
  font-size: 5rem;
  text-align: center;
  opacity: 0.8;
}

form {
  box-shadow: 0 4px 8px black;
  opacity: 80%;
  max-width: 100%;
  width: 800px;
  padding: 2rem;
  background-color: black;
  border-radius: 30px;
}

.input {
  border: 2px solid #444;
  color: #444;
  font-size: 2rem;
  padding: 1rem 2rem;
  display: block;
  width: 100%;
  border-radius: 5px;
  margin-bottom: 1rem;
}

.input::placeholder {
  color:grey;
}

.input:focus {
  outline-color: rgb(179, 131, 226);
}

#add-button {
  background-color: #C24641;
  color: white;
  font-size: 1rem;
  padding: 1rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: block;
  width: 20%;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  transition: background-position 0.5s, box-shadow 0.5s;
}

/* Responsive button size and font-size adjustments for mobile devices */
@media screen and (max-width: 768px) {
  #add-button {
    width: 60%; /* Button width will take up 60% of the screen width */
    font-size: 0.9rem; /* Slightly smaller font for mobile */
    padding: 0.8rem 1rem; /* Adjust padding for smaller screens */
    left: 50%;
    transform: translateX(-50%); /* Center the button horizontally */
  }
}

@media screen and (max-width: 480px) {
  #add-button {
    width: 80%; /* Button width will take up 80% of the screen width */
    font-size: 0.8rem; /* Even smaller font size for very small screens */
    padding: 0.6rem 1rem; /* Reduce padding for extra small screens */
    left: 50%;
    transform: translateX(-50%); /* Keep button centered */
  }
}

#add-button:hover {
  background: linear-gradient(45deg, #ff6b6b, #ff8e53, #ffca28, #39d57f, #33b5e5);
  background-size: 400%;
  background-position: right;
  box-shadow: 0 0 20px rgba(255, 107, 107, 0.5),
              0 0 40px rgba(255, 142, 83, 0.5),
              0 0 60px rgba(255, 202, 40, 0.5),
              0 0 80px rgba(57, 213, 127, 0.5),
              0 0 100px rgba(51, 181, 229, 0.5);
}

.todos {
  background-color: #fff;
  padding: 2;
  margin: 5;
  list-style-type: none;
}

.todos li {
  border-top: 1px solid #e5e5e5;
  cursor: pointer;
  font-size: 1.5rem;
  padding: 1rem 2rem;
  list-style-type:disc;
}

.todos li.completed {
  color: #b6b6b6;
  text-decoration: line-through;
  text-decoration-color: #C24641;
}

small {
  color: white;
  margin-top: 3rem;
  text-align: center;
}

.footer {
  position: fixed;
  bottom: 10px;
  right: 10px;
  font-size: 12px;
  color: white;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

.todos li {
  animation: fadeIn 0.5s ease-in-out;
}

.todos li.removed {
  animation: fadeOut 0.5s ease-in-out;
  animation-fill-mode: forwards;
}

body {
  background: linear-gradient(45deg, #C24641, #ffca28, #33b5e5);
  background-size: 400% 400%;
  animation: gradientBG 10s ease infinite;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.theme-switch {
  position: fixed;
  top: 20px;
  right: 20px;
  color:white;
  font-size: 1rem;
  font-family: 'Arial';
}

body.light-mode {
  background-color: #fff;
  color: black;
}

body.light-mode h1 {
  color:black;
}

body.light-mode form {
  background-color: #f4f4f4;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

body.light-mode .input {
  border-color: #ddd;
  color: #444;
}

body.light-mode #add-button {
  background-color: #C24641;
  color: white;
}

body.light-mode .todos li.completed {
  color: #C24641;
  text-decoration-color: black;
}

.todos li:hover {
  background-color: #f4f4f4;
  cursor: pointer;
  transform: scale(1.02);
}

::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.input:hover {
  border-color: #C24641;
}

#priority:hover {
  background-color: #FF6F61;
}

.input:focus {
  border-color: #FF6F61;
  box-shadow: 0 0 10px rgba(255, 111, 97, 0.5);
}

.todos li {
  transition: transform 0.3s, box-shadow 0.3s;
}

.todos li:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

input[type="checkbox"] {
  opacity: 0;
  position:relative;
}

/* Custom checkbox appearance */
input[type="checkbox"] + label {
  position: relative;
  padding-left: 25px;
  cursor: pointer;
  display: inline-block;
}

input[type="checkbox"] + label:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  background: #C24641;
  border-radius: 5px;
  transition: background 0.3s;
}

input[type="checkbox"]:checked + label:before {
  background: #FF6F61;
}
