/*== Global Styles ==*/

*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root{
  --primary-color: #62007a;
  --primary-light: #6e0000;
  --dark-color: #180000;
  --light-color: #ffffff;
  --grey-color: #a0a0a0;
  --danger-color: #ff0202;
  --success-color: #0faf00cb;
  --border-color: #bdbdbd;
}

body{
  font-family: "Montserrat";
  background-color: #dfdfdf;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--dark-color);
}

.app{
  width: 100%;
  max-width: 500px;
  background-color: var(--light-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 15px #18181831;
}

header{
background-color: var(--primary-color);
color: white;
padding:  20px 25px;
}

header h1{
  font-size: 24px;
  margin-bottom: 5px;
  font-weight: 600;
}

header p{
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 5px;
  font-weight: 600;
}

.todo-input{
  padding:  20px 25px;
  display: flex;
  gap: 10px;
  background-color: #dfdfdf;
  border-bottom: 1px solid var(--border-color);
}

.todo-input input{
  flex: 1;
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  font-size: 1rem;
  transition: all 0.2s ease;
  border-radius: 6px;
}

.todo-input input:focus{
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 10px 15px #18181813;
}

.todo-input button{
  background-color: var(--primary-color);
  color: white;
  width: 40px;
  height: 43px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.todo-input button:hover{
  background-color: #22002b;
}

.filters{
  display: flex;
  gap: 15px;
  border-bottom: 1px solid #dfdfdf;
  padding: 15px 25px;
}

.filter{
  padding: 5px 3px;
  cursor: pointer;
  color: var(--grey-color);
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.filter:hover{
  color: var(--primary-color);
}

.filter.active{
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
  font-weight: 600;
}

.todo-containter{
  padding: 15px 0;
  min-height: 300px;
  overflow-y: auto;
}

#todo-list{
  list-style-type: none;
}

.todo-item{
  padding: 12px 15px;
  display: flex;
  align-items: center;
  transition: background-color 0.2s;
}

.todo-item:hover{
  background-color: #ececec;
}

.checkbox-container{
  margin-right: 15px;
}

.todo-checkbox{
  opacity: 0;
  position: absolute;
}

.checkmark{
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #a0a0a0;
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.todo-checkbox:checked + .checkmark{
  background-color: var(--success-color);
  border: var(--success-color);
}

.todo-checkbox:checked + .checkmark::after{
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.todo-item-text{
  flex:1;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.todo-item.completed .todo-item-text{
  text-decoration: line-through;
  color: var(--grey-color);
}

.delete-btn{
  background: none;
  border: none;
  color: var(--grey-color);
  cursor: pointer;
  font-size: 16px;
  opacity: 0;
  transition: all 0.2s ease;
}

.todo-item:hover .delete-btn{
  opacity: 1;
}

.delete-btn:hover{
  color: var(--danger-color);
}

.empty-state{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  color: var(--grey-color);
}

.empty-state i{
  font-size: 40px;
  margin-bottom: 10px;
  opacity: 0.7;
}

.hidden{
  display: none;
}

footer{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  border-top: 1px solid var(--border-color);
  background-color: #dfdfdf;
  font-size: 14px;
}

#items-left{
  color: var(--grey-color);
}

#clear-completed{
  background: none;
  border: none;
  color: #525252;
  cursor: pointer;
  transition: all 0.2s ease;
}

#clear-completed:hover{
  color: var(--danger-color);
}

/* TODO LIST */
.todo-container {
  margin-bottom: 15px;
  overflow-x: auto;
}


/* TODO ITEM */
.todo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  transition: 0.2s ease;
  gap: 10px;
}

.todo-item:hover {
  background: #f1f5f9;
}

/* COMPLETED */
.todo-item.completed .todo-text {
  text-decoration: line-through;
  color: #999;
}

/* CHECKBOX */
.todo-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.todo-checkbox input {
  display: none;
}

.checkmark {
  width: 25px !important;
  height: 25px !important;
  border: 2px solid #4f46e5;
  border-radius: 4px;
  margin-right: 10px;
  position: relative;
}

.todo-checkbox input:checked + .checkmark {
  background: #4f46e5;
}

.todo-checkbox input:checked + .checkmark::after {
  content: "✓";
  color: white;
  font-size: 12px;
  position: absolute;
  left: 3px;
  top: -1px;
}

/* TEXT */
.todo-text {
  flex: 1;
  font-size: 0.95rem;
}

/* DELETE */
.todo-delete {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 1rem;
  cursor: pointer;
}

.todo-delete:hover {
  color: #dc2626;
  background-color: rgba(255, 0, 0, 0.247);
}
