
/* global styling */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* style for all first headers */
h1 {
  color: white;
  letter-spacing: 10px;
  text-transform: uppercase; /*change case to uper*/
}

/* hovering effect for btns */
button:hover, #clear-completed:hover {
  color: hsl(220, 98%, 61%);
}

/*dark theme, default */
body {
  background-color: black;
  color: white;
}

/* light theme */
body.light {
  background-color: white;
  color: black;
}

body.light header {
  background: url('images/bg-desktop-light.jpg') no-repeat center/cover;
}

body.light form {
  background-color: #f4f4f4;
  color: black;
}

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

body.light .todo-list li {
  border-bottom: 1px solid #ddd;
}

body.light .todo-text {
  color: #000;
}

/* styling header */
header {
  background: url('images/bg-desktop-dark.jpg') no-repeat center/cover;
  height: 200px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  
}

/* style for toggle button, switches fromlight-dark mode */
#switch {
  background: none;
  border: none;
  cursor: pointer;
}

#switch img {
  width: 30px;
  height: 30px;
}

/* styling for to do form */
form {
  display: flex;
  align-items: center;
  background-color: #25273c;
  padding: 16px;
  border-radius: 5px;
  margin: -50px auto 16px auto; 
  max-width: 500px;
}

form input {
  background: transparent;
  border: none;
  flex: 1;
  font-size: 16px;
  outline: none;
}

form button {
  background: #1e90ff;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
}

/* to do list style */
.todo-list {
  background-color: #25273c;
  border-radius: 5px;
  margin: 0 auto;
  max-width: 500px;
}

.todo-list ul {
  list-style: none;
}

.todo-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #333;
  position: relative;
}

/*circular checkbox */
.todo-list input {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #ccc;
  margin-right: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.todo-list input:checked {
  background: linear-gradient(to right, hsl(220, 98%, 61%), hsl(280, 87%, 65%));
  border: none;
}

.todo-list input:checked::after {
  content: "✔";
  color: white;
  font-size: 12px;
}

/* Task text */
.todo-text {
  flex: 1;
  font-size: 16px;
  color: #fff;
}

.todo-list li.completed .todo-text {
  text-decoration: line-through;
  color: #777;
}



/* Delete button */
.delete-btn {
  background: none;      /* remove default button bg */
  border: none;          /* remove border */
  cursor: pointer;       /* show hand cursor */
  padding: 2px;
  font-size: 18px;       /* make the icon larger */
  color: white;            /* set icon color (affects <i> inside) */
}

.delete-btn:hover {
  color: darkred;        /* change color when hovered */
}



/* filters and clear button styling */
.todo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  font-size: 0.9rem;
  color: #708090;
}

.filters {
  display: flex;
  gap: 8px;
}

.filters button {
  background: none;
  border: none;
  color: #708090;
  cursor: pointer;
}



#clear-completed {
  background: none;
  border: none;
  color: #708090;
  cursor: pointer;
}

/* style for success and error message */
.alert {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #25273c;
  color: white;
  padding: 10px 15px;
  border-radius: 5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  z-index: 9999;
  font-size: 14px;
  animation: fadeInOut 2s ease forwards;
}

.alert.success {
  background: #28a745; /* green for success */
}

.alert.error {
  background: #dc3545; /* red for errors */
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(-10px); }
  10% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-10px); }
}


.hint {
  text-align: center;
  color: hsl(233, 14%, 35%);
  margin: 1.5rem 0;
}

/* attribution styling */
.attribution {
  font-size: 11px;
  text-align: center;
  margin-top: 40px;
  color: white;
}
.attribution a {
  color: white;
}
