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

body {
  font-family: Arial, Helvetica, sans-serif;
  min-width: 280px;
  background-color: #080101;
}

#main-container {
  background-color: #080101;
  min-height: 100dvh;
  padding: clamp(1rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  row-gap: 1rem;
}

#title {
  color: #eceaea;
  font-family: "geist pixel", sans-serif;
  font-size: clamp(3rem,4rem,5rem);
  font-weight: 700;
  padding: 2rem 0;
}

#description {
  color: #ccc;
  font-family: "roboto", sans-serif;
  font-size: clamp(0.9rem, 1.2rem, 1.5rem);
  font-weight: 600;
  text-align: center;
}

#add-task-btn {
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 2rem;
  display: flex;
  justify-content: space-between;
  min-width: 100px;
  transition: box-shadow 0.2s ease;
  cursor: pointer;
}

.menu-container {
  margin: 2.5rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  width: min(100%, 980px);
  background: rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 0.8rem 1.2rem;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.secondary-tasks {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-width: 110px;
  min-height: 3.2rem;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  line-height: 1.5em;
  padding: 0.2rem 0.6rem;
}

.count-tasks,
.secondary-count {
  color: #e0e0e0;
  font-weight: 600;
  font-family: "lato", sans-serif;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease,
    color 0.3s ease;
}

.count-tasks {
  transform: translateY(0);
  opacity: 1;
}

.secondary-count {
  position: absolute;
  transform: translateY(120%);
  opacity: 0;
}

.secondary-tasks.is-active .count-tasks,
.secondary-tasks:focus-visible .count-tasks {
  transform: translateY(-120%);
  opacity: 0;
  color: #888;
}

.secondary-tasks.is-active .secondary-count,
.secondary-tasks:focus-visible .secondary-count {
  transform: translateY(0);
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .secondary-tasks:hover .count-tasks {
    transform: translateY(-120%);
    opacity: 0;
    color: #888;
  }

  .secondary-tasks:hover .secondary-count {
    transform: translateY(0);
    opacity: 1;
  }
}

#add-symbol {
  background-color: #080101;
  color: #fff;
  border: none;
  border-radius: 50%;
  padding: 0.1rem 0.3rem;
}

#add-text {
  font-family: "lato", sans-serif;
  font-size: 1rem;
  font-weight: 600;
}

#add-task-btn:hover {
  background-color: #dbdada;
  box-shadow: 0 5px 10px grey;
}

#add-task-btn:active {
  background-color: #b4b0b0;
}

.clear-container {
  position: relative;
  display: inline-block;
}

#clear-btn {
  background: #c9c9c9;
  color: rgb(184, 22, 22);
  padding: 0.7rem 1.7rem;
  position: relative;
  transition: background-color 0.3s ease 50ms;
}

.tooltip {
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);

  padding: 0.5rem 1rem;
  background: #333333;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-family: "lato", sans-serif;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  color: rgb(211, 211, 211);
  transition:
    opacity 0.2s ease,
    box-shadow 0.2s ease;

  z-index: 100;
}

.clear-container:hover .tooltip {
  opacity: 1;
  visibility: visible;
}

#clear-btn:hover {
  background-color: #ebebeb;
  box-shadow: 
    0 5px 10px grey,
    0 2px 6px red;
}
#clear-btn:active {
  background-color: #808080;
}

/* Style the backdrop behind the modal */
#myModal::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.3s ease-in-out forwards;
}

/* Style the modal box itself */
#myModal {
  border: none;
  border-radius: 8px;
  padding: 1.25rem;
  margin: 2rem auto;
  width: min(92vw, 34rem);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.modal {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: baseline;
  gap: 2rem;
  animation: fadeIn 0.3s ease-out forwards;
}
#myModal .label-title {
  font-size: 2rem;
  font-family: "roboto", sans-serif;
  font-weight: 600;
  padding-right: 1rem;
}

#myModal #task-title {
  width: 100%;
  resize: vertical;
  font-family: "lato", sans-serif;
  font-weight: 600;
  padding: 0.5rem 1rem;
  align-self: center;
  min-height: 80px; /* 5. Set controlled boundaries */
  max-height: 200px;
}

#myModal #task-title[placeholder] {
  font-size: 1rem;
}
#saveBtn {
  align-self: flex-end;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 1rem;
  font-family: "lato", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  background-color: #0a0901;
  color: #fff;
  transition: background-color 200ms ease-in-out;
}

@media (max-width: 700px) {
  #title {
    padding: 1.25rem 0;
  }

  #description {
    max-width: 40rem;
    padding: 0 0.5rem;
  }

  .menu-container {
    padding: 1rem;
  }

  .secondary-tasks {
    min-width: 90px;
  }
}

@media (max-width: 520px) {
  #main-container {
    padding: 1rem 0.75rem;
  }

  .menu-container {
    margin: 1.25rem 0;
    justify-content: center;
  }

  #add-task-btn,
  .secondary-btn,
  #clear-btn {
    width: 100%;
    justify-content: center;
  }

  .clear-container {
    width: 100%;
  }

  .tooltip {
    max-width: calc(100vw - 2rem);
    white-space: normal;
    text-align: center;
  }

  #myModal {
    padding: 1rem;
  }

  #myModal .label-title {
    font-size: 1.3rem;
  }

  .due-date-container {
    width: 100%;
  }
}

.due-date-container {
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

#due-date {
  padding: 0.5rem 1rem;
  font-family: "roboto", sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
}
#saveBtn:hover {
  background-color: #363636;
}

#saveBtn:active {
  background-color: #a5a5a5;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}


.appearAnimation {
  /* animation:fadeIn 1.3s ease-in-out; */
  animation: fadeInUp 0.8s ease-out forwards;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}


/* 
.fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
} */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px); /* starts slightly below */
  }
  to {
    opacity: 1;
    transform: translateY(0);    /* slides up to original position */
  }
}

.floating-card {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px); /* moves upward smoothly */
  }
}