@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

.todo-container{
    border: 2px solid white;
    background-color: rgba(106, 133, 255, 0.603);
    border-radius: 20px;
    height: fit-content;
    min-height: min-content;
    display: flex;
    flex-direction: column;
}

.todo-title{
    margin: 0;
    font-size: 30px;
}

.todo-top{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    font-family: "Roboto", sans-serif;
    color: white;
}

.fa-plus{
    font-size: 25px;
    transition: 0.3s;
}

.fa-plus:hover{
  transform: translateY(2px);
  color: rgba(255, 255, 255, 0.596);
}

.todo-modal{
    display: none; /*  Make this flex on js when the button is clicked */
    justify-content: center;
    align-items: center; /* Better centering */
    position: fixed;
    z-index: 1000; /* Higher z-index */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5); /* Darker overlay */
}

.todo-modal-container{
    display: flex;
    flex-direction: column;
    /* justify-content: center; */
    align-items: center;
    padding: 20px;
    background-color: white; /* Match your theme */
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    max-width: 400px;
    width: 90%;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    position: relative;
}

.input-todo{
    border: 2px solid rgb(106, 134, 255);
    border-radius: 10px;
    padding: 12px;
    outline: none;
    width: 100%;
    max-width: 100%;
    font-size: 20px;
    transition: all 0.3 ease;
}

.input-todo:focus{
    box-shadow: 0 4px 12px rgba(106, 134, 255, 0.3);
    border-color: rgb(106, 134, 255);
    transform: translateY(-2px);
}

.buttons{
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding-top: 20px;
}

.button-save, .button-cancel{
    width: 140px;
    height: 40px;
    border-radius: 5px;
    border: 2px solid rgb(106, 134, 255);
}

.button-cancel{
    border: 2px solid rgb(106, 134, 255);
    background-color: transparent;
    color: rgb(106, 134, 255);
    cursor: pointer;
    transition: all 0.3s ease; /* Add smooth transition */
}

.button-cancel:hover{
    border: 2px solid rgba(106, 133, 255, 0.678);
    background-color: rgba(106, 133, 255, 0.1);
    transform: translateY(-3px); /* Move up 3px */
    box-shadow: 0 4px 12px rgba(106, 134, 255, 0.3); /* Add shadow for lift effect */
}

.button-save{
    border: 2px solid rgb(106, 134, 255);
    background-color: rgb(106, 134, 255);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease; /* Add smooth transition */
}

.button-save:hover{
    background-color: rgb(80, 110, 255);
    transform: translateY(-3px); /* Move up 3px */
    box-shadow: 0 4px 12px rgba(106, 134, 255, 0.4); /* Add shadow for lift effect */
}

/* ROUNDED TOGGLE SWITCH */
.switch {
  position: relative;
  display: flex;
  width: 60px;
  height: 34px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:focus + .slider {
  box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.toggles{
    width: 100%;
    display: flex;
    justify-content: left;
    margin: 0;
    padding: 0;
}

.slider-container{
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background-color: rgba(197, 197, 197, 0.438);
    border-radius: 10px;
    width: 100%;
    transition: 0.3s;
}

.slider-container:hover{
  background-color: rgba(197, 197, 197, 0.61);
}

.slider-container p {
    margin: 0;
    padding: 0;
    font-size: 16px;
    color: grey;
    font-weight: 500;
    font-family: "Roboto", sans-serif;
}

/*FOR NOTES*/
.notes{
  display: none;
  width: 300px;
  margin-top: 10px;
  width: 300px;
  height: 0;
  opacity: 0;
  padding: 0 12px;
  margin: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  outline: none;
  resize: none;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scaleY(0);
  transform-origin: top;
  font-family: "Roboto", sans-serif;
  
}

.notes.show {
  height: 150px;
  opacity: 1;
  padding: 12px;
  margin-top: 10px;
  border-color: rgb(106, 134, 255);
  transform: scaleY(1);
}

.notes:focus {
  border-color: rgb(80, 110, 255);
  box-shadow: 0 2px 8px rgba(106, 134, 255, 0.2);
}

.notes-container2{
  width: auto;
  margin-top: 10px;
  padding: 10px;
  display: flex;
  align-items: center;
  background-color: rgb(129, 219, 247);
  border-radius: 5px;
  font-family: "Roboto", sans-serif;
  font-weight: 300;
}


textarea{
  width: 90%;
  height: 150px;
  resize: none;
}

/*FOR ADDED TASKS*/
.display-todo{
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    overflow-y: auto;
    max-height: 30vh; /* Set maximum height before scrolling */
    scroll-behavior: smooth;
}

.active-task{
  width: 100%;
  color: gray;
  font-family: "Roboto", sans-serif;
  font-size: 16px;
  margin: 0;
}

.section-task{
  margin-left: 10px;
  color: white;
  margin: 10px;
}



.added-task{
  width: 100%;
  max-width: 90%;
  padding: 10px;
  border: 1px solid white;
  border-radius: 10px;
  background-color:white;
}

.task-checking {
    animation: checkTask 0.3s ease-in-out;
}

.task-disappearing {
    animation: disappearTask 0.3s ease-out forwards;
}

/* Remove the existing .task-checkb style and add these styles */

.task-checkb, .complete-task-checkb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #2196F3;
  border-radius: 4px;
  margin-right: 10px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
}

/* Style for checked state */
.task-checkb:checked, .complete-task-checkb:checked {
  background-color: #2196F3;
  border-color: #2196F3;
}

/* Create checkmark */
.task-checkb:checked::after, .complete-task-checkb:checked::after {
  content: '✓';
  position: absolute;
  color: white;
  font-size: 14px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Hover effect */
.task-checkb:hover, .complete-task-checkb:hover {
  border-color: #1976D2;
  background-color: rgba(33, 150, 243, 0.1);
}

@keyframes checkTask {
    0% {
        transform: scale(1);
        background-color: white;
    }
    50% {
        transform: scale(0.95);
        background-color: #e0ffe0;
    }
    100% {
        transform: scale(1);
        background-color: rgba(138, 228, 255, 0.596);
    }
}

@keyframes disappearTask {
    0% {
        opacity: 1;
        transform: translateX(0);
        background-color: #ffffff;
    }
    50% {
        background-color: rgba(138, 228, 255, 0.596);
    }
    100% {
        opacity: 0;
        transform: translateX(-100%);
        background-color: rgba(90, 213, 250, 0.596);
        height: 0;
        margin: 0;
        padding: 0;
    }
}

/* CONTAINER FOR THE TASKS AND 3 DOTS */
.tasksonly{
  display: flex;
}

/* CONTAINER FOR THE CHECKBOX AND TASKNAME */
.usertask-container{
  display: flex;
  align-items: center;
  width: 100%;
  font-family: "Roboto", sans-serif;

}

.fa-ellipsis-vertical{
  padding: 5px;
  color: grey;
  transition: 0.3s;
}

.fa-ellipsis-vertical:hover{
  color: black;
}

/* SCROLLBAR FOR COMPLTED TASK */

.task-completed::-webkit-scrollbar {
    width: 4px; /* Thinner scrollbar */
}

.task-completed::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    margin: 5px; /* Add margin to keep it inside borders */
}

.task-completed::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 4px;
}

.task-completed::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.8);
}
.task-checkb, .complete-task-checkb{
  width: 15px;
  height: 15px;
  margin-right: 10px;
}

/* SCROLLBAR FOR ACTIVE TASK */

.display-todo::-webkit-scrollbar {
    width: 4px; /* Thinner scrollbar */
}

.display-todo::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    margin: 5px; /* Add margin to keep it inside borders */
}

.display-todo::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 4px;
}

.display-todo::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.8);
}

.task-checkb, .complete-task-checkb{
  width: 15px;
  height: 15px;
  margin-right: 10px;
}

.input-and-delete{
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
}

#trash{
  padding: 13px;
  border: 2px solid red;
  border-radius: 10px;
  transition: 0.3s;
}

#trash:hover{
  background-color: rgb(224, 3, 3);
  color: white;
}


.delete-button{
  display: none;
  margin-left: 10px;
}

.completed-title{
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.completed-title p {
  margin-left: 10px;
  font-family: "Roboto", sans-serif;
  font-size: 15px;
  color: white;
  margin: 10px;
}

.chevron{
  margin-right: 10px;
  color: white;
  cursor: pointer;
}

/* FOR COMPLETED TASK */
.task-completed{
    padding: 10px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    overflow-y: auto;
    max-height: 20vh;
    transition: 0.8s;
    border-radius: 20px;
    scroll-behavior: smooth;
}

.complete-task{
  width: 100%;
  max-width: 90%;
  padding: 10px;
  border-radius: 10px;
  background-color:rgba(255, 255, 255, 0.452);
}

.complete-only{
  display: flex;
  align-items: center;
}

.complete-task-container{
  display: flex;
  align-items: center;
  width: 100%;
  font-family: "Roboto", sans-serif;
}

.complete-task-container p{
  text-decoration: line-through;
  margin: 0;
}

.complete-notes-container2{
  width: auto;
  margin-top: 10px;
  padding: 10px;
  display: flex;
  align-items: center;
  background-color: rgba(129, 220, 247, 0.596);
  border-radius: 5px;
  text-decoration: line-through;
  font-family: "Roboto", sans-serif;
}

@media (max-width: 900px) {
	.todo-container{
		width: 95%;
		max-width: 95%;
	}
	.display-todo {
		padding: 10px;
		max-height: 28vh;
		overflow-y: auto;
		align-items: stretch; /* left-align/stretch horizontally */
	}
	.added-task, .complete-task {
		width: 100%;
		max-width: 100%;
		padding: 12px;
	}
	.completed-title{
		padding: 8px;
	}
  .task-completed{
    max-height: 22vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 10px;
  }
}

/* Phone-specific adjustments */
@media (max-width: 480px) {

  .todo-top{
    border-radius: 10px;
    border: none;
  }

  .todo-container{
    width: 90%;
  }

	/* Modal becomes near full-screen and easier to use */
	.todo-modal {
		justify-content: center;
    align-items:baseline;
		padding: 0;
	}
	.todo-modal-container {
    margin-top: 100px;
		width: 96%;
		max-width: 80%;
		padding: 14px;
		border-radius: 12px;
	}
	.input-todo{
		font-size: 18px;
	}
	.buttons{
		display: flex;
		flex-direction: column;
		gap: 10px;
	}
	.button-save, .button-cancel{
		width: 100%;
		height: 44px;
	}
	/* Increase hit area for icons */
	.fa-plus, .fa-ellipsis-vertical{
		padding: 8px;
		font-size: 20px;
	}

  #trash{
    padding: 8px;
		font-size: 20px;
  }

	/* List sizing */
	.display-todo {
		padding: 10px 8px;
		gap: 8px;
		max-height: 32vh;
    overflow: hidden;
	}

  .added-task, .complete-task{
    max-width: 95%;
    padding: 10px;
  }
	.usertask-container, .complete-task-container{
		font-size: 16px;
	}
	/* ensure empty messages remain centered and readable */
	.empty-todos, .empty-completed {
		align-self: center;
		max-width: 90%;
		padding: 12px;
	}

  .notes{
    width: 250px;
  }
}

/* CLEAR ALL BUTTON */
.clear-all {
    display: none;
    width: 100%;
    text-align: center;
    margin-top: 10px;
}

.clear-all.show {
    display: block;
}

.clear-all button {
    padding: 8px 16px;
    background-color: #ff6b6b;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: "Roboto", sans-serif;
}

.clear-all button:hover {
    background-color: #ff5252;
}

.counter{
  padding: 1px 5px 1px 5px;
  background-color: rgba(252, 252, 252, 0.582);
  font-size: 16px;
  border-radius: 100%;
  color: rgb(0, 0, 0);
}