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

:root {
  --MAIN_BG: #c0bbbb;
  --TEXT_SUCCESS: hsl(141, 71%, 48%);
  --TEXT_DANGER: hsl(348, 100%, 61%);
  --WHITE: #ffffff;
  --BLACK: #000000;
  --LIGHT_BLACK: #1b1b1b;
}
body,
html {
  background-color: var(--MAIN_BG);
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}
::selection {
  background-color: royalblue;
  color: var(--WHITE);
}
/* width */
body::-webkit-scrollbar {
  width: 8px;
}
/* Track */
body::-webkit-scrollbar-track {
  background: var(--WHITE);
}

/* Handle */
body::-webkit-scrollbar-thumb {
  background-color: royalblue;
  border-radius: 2px;
}

/* Handle on hover */
body::-webkit-scrollbar-thumb:hover {
  background: var(--BLACK);
}
ion-icon {
  pointer-events: none;
}

.container {
  width: 100%;
  max-width: 80vw;
  margin: 0 auto;
}
#dark-mode-switch {
  position: fixed;
  z-index: 11;
  right: 0.25rem;
  width: auto;
  height: auto;
  font-size: smaller;
  background-color: var(--LIGHT_BLACK);
  border-radius: 4px;
  color: var(--WHITE);
  border: none;
  box-shadow: 0.5px 1px 2px rgba(0, 0, 0, 0.5);
}
.today-date {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.25rem;
  font-size: 1rem;
  color: var(--BLACK);
}

.main-header {
  width: 100%;
  position: sticky;
  top: 0;
  background-color: var(--MAIN_BG);
  border-bottom: 1px solid royalblue;
  z-index: 10;
}
.main-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* padding: 0.25rem 0; */
}

#logo-animated {
  display: flex;
  transition: all ease 300ms;
}
#logo-animated > div {
  transition: all ease 300ms;
}
#logo-animated:hover > div {
  animation: wobble 500ms ease-in forwards;
  transition: all ease 300ms;
}
@keyframes wobble {
  0% {
    transform: translateY(0%) scale(1);
    text-decoration: none;
  }
  25% {
    transform: translateY(10%) scale(1.05);
    text-decoration: line-through;
  }
  50% {
    transform: translateY(-10%) scale(1.05);
    text-decoration: line-through;
  }
  75% {
    transform: translateY(10%) scale(1.05);
    text-decoration: line-through;
  }
  100% {
    transform: translateY(0%) scale(1);
    text-decoration: none;
  }
}
#logo-animated:hover > div:nth-child(1) {
  animation-delay: 0s;
}
#logo-animated:hover > div:nth-child(2) {
  animation-delay: 500ms;
}
#logo-animated:hover > div:nth-child(3) {
  animation-delay: 1s;
}

.main-header #open-add-todo {
  position: relative;
  background-color: var(--TEXT_SUCCESS);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  color: var(--WHITE);
  cursor: pointer;
  transition: all ease 300ms;
}
.main-header #open-add-todo::after {
  content: attr(data-title);
  word-wrap: none;
  position: absolute;
  right: 105%;
  top: 50%;
  transform: translateY(-50%) translateX(-50%);
  /* display: none; */
  opacity: 0;
  width: max-content;
  height: auto;
  padding: 0.5rem;
  border-radius: 3px;
  background-color: #1b1b1b;
  color: white;
  pointer-events: none;
  transition: all ease 300ms;
}

.main-header #open-add-todo:hover::after {
  /* display: block; */
  transform: translateY(-50%) translateX(0);
  opacity: 1;
}
.main-header #open-add-todo:hover {
  filter: brightness(90%);
}
.main-header #open-add-todo ion-icon {
  font-size: x-large;
  transition: all ease 300ms;
}
.main-header #open-add-todo:hover > ion-icon {
  transform: rotate(180deg) scale(1.2);
}

.sort-and-info {
  width: auto;
  position: sticky;
  background-color: var(--MAIN_BG);
  z-index: 10;
}
.sort-and-info .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

#sort-dropdown-toggle {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  background-color: var(--WHITE);
  color: var(--BLACK);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all ease 300ms;
}
#sort-dropdown-toggle:active {
  transform: scale(0.95);
}

#sort-dropdown-toggle:focus-visible {
  outline: 1.5px solid royalblue;
  outline-offset: 1.5px;
}
#sort-dropdown-toggle.active {
  color: royalblue;
  outline: 1.5px solid royalblue;
  outline-offset: 1.5px;
}

#sort-dropdown-toggle ion-icon[name="caret-down-outline"] {
  transition: all ease 300ms;
}
#sort-dropdown-toggle.active > ion-icon[name="caret-down-outline"] {
  transform: rotate(180deg);
}

.sort-and-info .sorts {
  position: relative;
}
.sort-and-info .sorts .sort-dropdown {
  list-style-type: none;
  position: absolute;
  top: 100%;
  /* right: 0; */
  width: auto;
  display: flex;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20%);
  flex-direction: column;
  background-color: var(--MAIN_BG);
  outline: 1.25px solid royalblue;
  color: var(--BLACK);
  z-index: 10;
  border-radius: 10px;
  padding: 0 !important;
  pointer-events: none;
  overflow: hidden;
  transition: all ease 300ms;
}
.sort-and-info .sorts .sort-dropdown.active {
  pointer-events: all;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.sort-and-info .sorts .sort-dropdown li {
  display: inline-block;
  list-style-type: none;
  padding: 0.625rem 2.5rem;
  border-bottom: 1px solid royalblue;
  margin: 0;
  cursor: pointer;
  transition: all ease 300ms;
}
.sort-and-info .sorts .sort-dropdown li:last-child {
  border-bottom: none;
}
.sort-and-info .sorts .sort-dropdown li:hover {
  color: var(--WHITE);
  background-color: royalblue;
}

#todo-list {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  background-color: transparent;
  padding: 1.5rem auto;
  margin: 1.5rem auto;
}
.todo-el {
  width: 100%;
  position: relative;
  list-style: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem 0.5rem;
  margin-bottom: 1rem;
  background-color: var(--WHITE);
  color: var(--LIGHT_BLACK);
  border-radius: 10px;
  transition: all 0.3s ease-in-out;
}
.todo-el:hover {
  box-shadow: 0px 0px 10px 0px inherit !important;
}

.todo-el-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.todo-el-priority {
  color: royalblue;
  font-weight: bold;
}
.todo-status {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.125rem;
  font-weight: bold;
}
.todo-status ion-icon {
  font-size: larger;
}

.todo-el-body {
  width: 100%;
}
.todo-el-body .todo-el-title {
  font-weight: bold;
  font-size: 1.625rem;
}

.todo-el-footer {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.todo-el-footer .date-time, .todo-el-body .date-time {
  font-weight: lighter;
  font-size: smaller;
}
.todo-el-footer .cta-buttons {
  width: auto;
  text-align: center;
}
.todo-el-footer .cta-buttons ion-icon {
  transition: all ease 300ms;
}
.todo-el-footer .cta-buttons button:hover > ion-icon {
  transform: scale(1.2);
}

#add-todo {
  width: 100%;
  height: 100%;
  display: flex;
  /* flex-direction: column; */
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  background-color: transparent;
  color: var(--BLACK);
  padding: 1rem 0;
}
#add-todo input:not([type="checkbox"]) {
  min-width: 90%;
  width: auto;
  height: 2.5rem;
  padding-left: 1rem;
  border: none;
  margin-bottom: 1rem;
  border-radius: 10px;
  background-color: var(--WHITE);
  color: var(--LIGHT_BLACK);
  font-size: 1rem;
}
#prio-selection-realtime-view {
  color: var(--BLACK);
}
#add-todo input:focus {
  outline: 2px solid lightseagreen;
  outline-offset: 2px;
}
#add-todo label {
  margin-bottom: 0.5rem;
  text-align: start;
}
#add-todo button {
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  background-color: lightseagreen;
  color: var(--LIGHT_BLACK);
  font-size: 1rem;
  transition: all 0.3s ease-in-out;
}
#add-todo button:hover {
  background-color: var(--LIGHT_BLACK);
  color: #fff;
}
.sec-inps {
  width: 100%;
  position: relative;
  display: flex;
  justify-content: start;
  align-items: center;
  flex-wrap: wrap;
}
#priority-input {
  min-width: 15rem;
}
.checkbox-div {
  display: flex;
  justify-content: start;
  align-items: center;
  width: 100%;
  margin-bottom: 1rem;
}

.sorts {
  display: flex;
  justify-content: center;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}
.sorts h4 {
  margin-block-start: unset !important;
  margin-block-end: unset !important;
}
.info {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.info p {
  width: fit-content;
  margin-block-start: unset !important;
  margin-block-end: unset !important;
  background-color: var(--WHITE);
  color: var(--LIGHT_BLACK);
  padding: 0.25rem 0.35rem;
  border-radius: 4px;
}
.info p span {
  font-size: 1rem;
  font-weight: bold;
}
input {
  accent-color: rebeccaPurple;
}
.info #total-todos {
  color: royalblue;
}
.info .total-todos-p {
  outline: 1.5px solid royalblue;
}
.info #total-completed {
  color: var(--TEXT_SUCCESS);
}
.info .total-completed-p {
  outline: 1.5px solid var(--TEXT_SUCCESS);
}
.info #total-pending {
  color: var(--TEXT_DANGER);
}
.info .total-pending-p {
  outline: 1.5px solid var(--TEXT_DANGER);
}

.delete-todo-btn,
.edit-todo-btn {
  background-color: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}
.delete-todo-btn {
  color: var(--TEXT_DANGER);
}
.edit-todo-btn {
  color: royalblue;
}

/* modal styles start  */
.modal {
  position: relative;
  display: none;
  justify-content: center;
  align-items: flex-start;
  position: fixed;
  inset: 0;
  z-index: 999;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}
.modal::-webkit-scrollbar {
  display: none;
}
.modal.active {
  display: flex;
}
.modal-content {
  position: relative;
  background-color: var(--MAIN_BG);
  padding: 1rem;
  max-width: 80vw;
  margin: 5rem auto;
  width: 60%;
  border-radius: 5px;
  border: 2px solid royalblue;
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
  animation: modalAppear 0.5s ease;
}
@media (max-width: 768px) {
  .modal-content {
    width: 80vw;
  }
  .modal-body {
    height: 70vh;
  }
}
@media (max-width: 550px) {
  .sort-and-info .container {
    padding-top: 1rem;
  }
}
@-webkit-keyframes modalAppear {
  from {
    top: -300px;
    opacity: 0;
  }
  to {
    top: 0;
    opacity: 1;
  }
}
@keyframes modalAppear {
  from {
    top: -300px;
    opacity: 0;
  }
  to {
    top: 0;
    opacity: 1;
  }
}

.modal-header {
  position: relative;
  border-bottom: 1.5px solid var(--LIGHT_BLACK);
  color: royalblue;
}
.modal-header h2 {
  display: flex;
  align-items: center;
  font-size: 2em;
}
.modal-close-btn {
  height: 2.25rem;
  width: 2.25rem;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: -1rem;
  right: -1rem;
  background-color: var(--LIGHT_BLACK);
  color: var(--TEXT_DANGER);
  outline: none;
  border: 1.5px solid var(--WHITE);
  font-size: x-large;
  border-radius: 100%;
  z-index: 9999;
  transform: scale(1.125);
  transition: all ease 300ms;
}
.modal-close-btn:hover {
  background-color: var(--TEXT_DANGER);
  color: var(--WHITE);
}
.modal-close-btn:active {
  transform: scale(0.95);
  box-shadow: 0px 0px 5px var(--TEXT_DANGER);
}
.modal-close-btn > ion-icon {
  transition: all ease 300ms;
}
.modal-close-btn:hover > ion-icon {
  transform: rotate(180deg);
}
.modal-header.to-be-closed {
  opacity: 0.5;
  filter: blur(2px);
}
.modal-body.to-be-closed {
  opacity: 0.5;
  filter: blur(2px);
}
.modal-body {
  height: 50vh;
  overflow-y: scroll;
  overflow-x: hidden;
  color: var(--WHITE);
  padding: 0.75rem;
}
.modal-body::-webkit-scrollbar {
  background-color: transparent;
  width: 5px;
}
.modal-body::-webkit-scrollbar-thumb {
  background-color: var(--LIGHT_BLACK);
  border-radius: 10px;
}
.modal-footer {
  position: relative;
  height: fit-content;
  width: 100%;
  background-color: #5cb85c !important;
  color: white;
}
/* modal styles end  */

#edit-todo {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: start;
  align-items: center;
  flex-wrap: wrap;
  background-color: transparent;
  color: var(--BLACK);
  padding: 1rem 0;
}
#edit-todo input:not([type="checkbox"]) {
  width: 100%;
  flex-wrap: 1;
  padding: 10px 0px 10px 10px;
  border: none;
  margin-bottom: 1.5rem;
  border-radius: 10px;
  background-color: var(--WHITE);
  color: var(--LIGHT_BLACK);
  font-size: 1rem;
}
#edit-todo label {
  margin-bottom: 0.25rem;
}

#edit-todo input:focus {
  outline: 2px solid lightseagreen;
  outline-offset: 2px;
}
#edit-todo button {
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  background-color: lightseagreen;
  color: var(--LIGHT_BLACK);
  font-size: 1rem;
  transition: all 0.3s ease-in-out;
}
#edit-todo button:hover {
  background-color: var(--LIGHT_BLACK);
  color: var(--WHITE);
}
