@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");

:root {
  --próza: oklch(87% 0.065 274.039);
  --poezie: oklch(89.9% 0.061 343.231);
  --drama: oklch(90.5% 0.093 164.15);

  --satisfied: oklch(52.7% 0.154 150.069);
  --unsatisfied: oklch(63.7% 0.237 25.331);
}

body {
  background-color: #fafafa;
  font-family: Inter, system-ui, sans-serif;
  margin: 0;
}

.outer {
  height: calc(100vh - 2rem);
  padding: 1rem;
  display: grid;

  grid-template-rows: auto 1fr;

  grid-template-areas:
    "nav books"
    "main books";
  gap: 2rem;
}

nav {
  grid-area: nav;

  h1 {
    text-align: center;
    font-weight: 500;
  }
}

main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  gap: 3rem;
}

form {
  display: flex;
  gap: 0.75rem;

  input[type="text"] {
    font-size: 1.5rem;
    padding: 0.75rem;
    flex: 1;
    border: none;
    background-color: inherit;
    border-bottom: 1px solid black;
  }

  input[type="submit"] {
    font-size: 1.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 4px;
    border: 1px solid black;
    background-color: inherit;
    width: fit-content;
    transition: all 100ms;

    &:hover {
      background-color: black;
      color: white;
    }
  }
}

.criteria {
  display: flex;
  flex-direction: column;
  border-collapse: collapse;
  border-bottom: 1px solid oklch(0 0 0 / 0.25);

  div {
    padding: 0.5rem;
    border-top: 1px solid oklch(0 0 0 / 0.25);

    &.satisfied {
      color: var(--satisfied);
    }

    &.unsatisfied {
      color: var(--unsatisfied);
      font-weight: bold;

      &::before {
        content: "Nesplěno! ";
      }
    }

    &.all-done {
      color: var(--satisfied);
      text-align: center;
      font-weight: bold;
      font-size: 1.5rem;
      padding-top: 2rem;
    }
  }

  button.all-done-help {
    color: var(--satisfied);
    padding: 0.5rem;
    width: fit-content;
    margin: 1rem auto 2rem;
    font-size: 2rem;
    text-align: center;

    font-size: 1.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 4px;
    border: 1px solid black;
    background-color: inherit;
    transition: all 100ms;

    &:hover {
      background-color: var(--satisfied);
      border-color: var(--satisfied);
      color: white;
    }
  }
}

aside {
  overflow-y: auto;
  padding-right: 0.5rem;
  grid-area: books;
}

table.books {
  min-width: 500px;
  width: 100%;
  border-collapse: collapse;

  tr.book {
    font-size: 1.25rem;
    user-select: none;

    &:hover:not(.empty) td:not(.remove-button) {
      cursor: ns-resize;
    }

    &.sortable-ghost {
      opacity: 0.25;
    }

    &.próza td:not(.remove-button) {
      background-color: var(--próza);
    }
    &.poezie td:not(.remove-button) {
      background-color: var(--poezie);
    }
    &.drama td:not(.remove-button) {
      background-color: var(--drama);
    }

    td {
      padding: 6px 12px;

      &.index,
      &.id {
        text-align: center;
        max-width: 2rem;
      }

      &.remove-button {
        opacity: 0;
      }
    }

    &:hover .remove-button {
      opacity: 1;
    }

    &:has(.remove-button:hover) {
      text-decoration: line-through;
      color: red;
    }
  }
}

.kind-bg {
  padding: 4px;
  border-radius: 4px;
  color: black;

  &.próza {
    background-color: var(--próza);
  }
  &.poezie {
    background-color: var(--poezie);
  }
  &.drama {
    background-color: var(--drama);
  }
}

.print-form {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  font-size: 1.25rem;
  padding: 1rem 0 2rem;
  justify-content: center;
}

.print-signature {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  font-size: 1.25rem;
  padding-top: 2rem;
  justify-content: end;
}

@media not print {
  .print-only {
    display: none;
  }
}

@media print {
  .outer {
    display: flex;
    flex-direction: column;
    gap: 0rem;
    margin: 0;
  }

  form,
  .satisfied,
  .remove-button,
  .all-done-help {
    display: none !important;
  }

  .criteria,
  .criteria *:not(.satisfied) {
    display: inline;
    border: none;
    margin-bottom: 2rem;
  }

  .all-done {
    font-size: 1rem !important;
    margin: 0;

    .criteria:has(&) {
      margin-bottom: 1rem;
    }
  }

  tr.book {
    border-bottom: 1px solid black;
  }
  tr.book:last-of-type {
    border: none;
  }

  aside {
    overflow-y: unset;
    padding: 0;
  }
}
