/* css styling for to-do list table */

/* delete all modal stylying */
#delete-all-modal-container {
  background-color: rgba(0, 0, 0, 0.3);
  display: none;
  align-items: center;
  justify-content: center;
  position: fixed;
  z-index: 4;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
}

.delete-all-modal {
  background-color: #fff;
  width: 600px;
  max-width: 75%;
  padding: 30px 50px;
}

.delete-all-modal h1 {
  color: black;
}

#buttonContainers {
  display: flex;
  flex-direction: row-reverse;
  gap: 10px;
}

.confirm-delete-all {
  background-color: white;
  font-weight: bold;
  color: black;
  border: 0;
  border-radius: 5px;
  padding: 10px 25px;
}

.cancel-delete-all {
  background-color: white;
  border: 0;
  border-radius: 5px;
  font-weight: bold;
  padding: 10px 25px;
}

#cancel-delete-all:hover {
  background-color: grey;
  color: white;
  transition-duration: 0.25s;
}

#confirm-delete-all:hover {
  background-color: red;
  color: white;
  transition-duration: 0.25s;
}

/* container for table */
#tasklist {
  position: relative;
  margin: 1% auto;
  height: 43vh;
  width: 50%;
  overflow-y: auto;
  border-radius: var(--td-border-radius);
  transition-duration: 2s;
}

.btn-floating:hover {
  background-color: var(--btn-icon-hover-color);
}

/* table itself + header, cells, rows, then columns styling */
table {
  display: block;
  border-collapse: separate;
  border-spacing: 0 var(--table-border);
  table-layout: fixed; /* allows for word-wrap */
  min-height: 43vh;
  margin-top: -20px;
  background-color: var(--table-bg-color);
  transition-duration: var(--theme-transi-dura);
}

th,
td {
  padding: 10px;
  word-wrap: break-word; /* so that long tasks don't extend the table */
}

th {
  background-color: var(--header-color);
  color: var(--font-color);
  text-align: left;
  padding: 20px 10px;
  font-size: 100%;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  transition-duration: var(--theme-transi-dura);
}

td {
  transition-duration: var(--theme-transi-dura);
  word-break: break-word;
}

tr {
  margin-top: 20px;
  transition-duration: var(--theme-transi-dura);

  /* width: 100%; */
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

tbody ~ tr {
  animation: fade-in 0.25s linear;
}

#tasklist tr {
  transition: background-color var(--theme-transi-dura);
}

tr:nth-child(even) td {
  background-color: var(--even-color);
  color: var(--font-color);
}

tr:nth-child(odd) td {
  background-color: var(--odd-color);
  color: var(--font-color);
}

tr:hover td {
  background-color: var(--tr-hover-color);
  transition-duration: 0.05s;
}

tr td:first-child,
tr th:first-child {
  border-top-left-radius: var(--td-border-radius);

  /* border-bottom-left-radius: var(--td-border-radius); */
}

tr td:last-child,
tr th:last-child {
  /* border-top-right-radius: var(--td-border-radius); */
  border-bottom-right-radius: var(--td-border-radius);

  /* padding-right: 15px; */
}

td button {
  display: block;
  margin: auto;
  background-color: transparent;
  outline: none;
  border: none;
  text-align: center;
  color: white;
  transition-duration: 0.1s;
}

.triple-dots-touch button,
.double-buttons button {
  color: var(--font-color);
}

td button:hover {
  color: var(--header-color);
  cursor: pointer;
}

td button:active {
  background-color: transparent;
}

/* .col1-checkbox {
  display: none;
  width: 10vw;
} */

.col3-pomos {
  width: 10vw;
}

.col4-delete {
  width: 10vw;
  text-align: center;

  /* margin: auto; */
}

.col2-task {
  width: 100vw;
}

/* input form (add task) */
#form-container { /* div */
  position: -webkit-sticky;
  position: sticky;
  bottom: 0;
  width: 100%;
  background-color: var(--page-bg-color);
  border-bottom-left-radius: var(--td-border-radius);
  border-bottom-right-radius: var(--td-border-radius);
}

#add-todo { /* form */
  position: -webkit-sticky;
  position: sticky;
  bottom: 0;
  background-color: var(--header-color);
  padding-top: 10px;
  padding-bottom: 10px;
  border-bottom-left-radius: var(--td-border-radius);
  border-bottom-right-radius: var(--td-border-radius);
  transition-duration: var(--theme-transi-dura);
}

#todo {
  transition-duration: var(--theme-transi-dura);
}

#taskListHeader {
  transition-duration: var(--theme-transi-dura);
}

/* checkbox and delete button styling */
.task-name,
.task-length {
  font-size: 100%;
  background-color: white;
  border-style: none;
  border-radius: 2.5px;
  border-color: var(--header-color);
  height: 2.5em;
  padding-left: 1vw;
  color: black;
  top: 49vh;
  outline: none;
}

.task-name {
  width: 40%;
  margin-left: 5%;
}

.task-length {
  width: 2em;
  margin-right: 2vw; /* so that when a user enters a long task it doesn't go past the input bar */
  margin-right: 4vw;
}

::placeholder {
  color: gray;
}

/* other table features: checkbox, delete button, scrollbar */

/* larger checkbox */
input[type='checkbox'] {
  display: none;
}

label {
  transition-duration: 0.25s;
  position: relative;
  top: 3px;
}

.uncheckedTask label {
  visibility: hidden;
}

.completedTask label {
  visibility: visible;
}

.completedTask label:hover {
  color: var(--font-color);
}

/* different color row for checked off tasks */
tr.completedTask td {
  background-color: var(--completed-task-color);
}

/* Give current task a different bg color to make it stand out */
tr.uncheckedTask:nth-child(2) td,
.short-break tr.uncheckedTask:nth-child(2) td,
.long-break tr.uncheckedTask:nth-child(2) td {
  background-color: rgb(179, 179, 141);
}

/* rounded scrollbar */
#tasklist::-webkit-scrollbar-thumb {
  background-color: var(--scroll-color);
  border: 2px solid transparent;
  border-radius: 8px;
  background-clip: padding-box;
  transition-duration: 2s;
}

#tasklist::-webkit-scrollbar {
  width: 8px;
}

/* flex display for triple dot container for alignment purposes */
.triple-dots-touch {
  display: flex;
}

/* Styling for the div that holds both the focus and delete button */
.double-buttons {
  max-height: 100%;
  display: flex;
  flex-direction: column;
}

#add-button {
  float: right;
  margin-right: 4%;
}

/* Tooltip container */
.tooltip {
  position: relative;
  display: inline-block;
}

/* Tooltip text */
.tooltip .tooltiptext {
  visibility: hidden;
  background-color: white;
  color: grey;
  text-align: center;
  padding: 5px 5px;
  border-radius: 6px;

  /* Position the tooltip text */
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: -50%;
  margin-left: 0;

  /* Fade in tooltip */
  opacity: 0;
  transition: opacity 0.3s !important;
}

/* Tooltip arrow */
.tooltip .tooltiptext::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: white transparent transparent transparent;
}

/* Show the tooltip text when you mouse over the tooltip container */
.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

@media screen and (min-width: 1300px) {
  #tasklist {
    height: 39vh;
    overflow-y: auto;
  }

  .tooltip .tooltiptext {
    left: -55%;
  }
}

@media screen and (min-width: 992px) {
  #tasklist {
    height: 39vh;
    overflow-y: auto;
  }

  .tooltip .tooltiptext {
    left: -55%;
  }
}

@media screen and (max-width: 992px) {
  #tasklist {
    height: 40vh;
    width: 80%;
  }

  .tooltip .tooltiptext {
    left: -50%;
  }
}

@media screen and (max-width: 600px) {
  #tasklist {
    width: 97%;
  }

  .tooltip .tooltiptext {
    left: -35%;
  }
}

#taskListHeader th {
  z-index: 1;
}
