:root {
  --color-primary: #8f94ce;
  --color-secondary: #478be2;
  --color-success: #32bd55;
  --color-danger: #cf4d3b;
}

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

body {
  background: rgb(76, 90, 94);
  background:
    linear-gradient(
      90deg,
      rgba(76, 90, 94, 1) 11%,
      rgba(29, 89, 218, 1) 35%,
      rgba(26, 81, 154, 1) 69%,
      rgba(35, 6, 52, 0.3223039215686274) 88%
    );
  color: #000;
  font-family: "Roboto", sans-serif;
}

table {
  width: 750px;
  border-collapse: collapse;
  margin: 50px auto;
}

/* Zebra striping */

tr:nth-of-type(odd) {
  background: #eee;
}

th {
  background: #3498db;
  color: white;
  font-weight: bold;
}

td,
th {
  padding: 10px;
  border: 1px solid #ccc;
  text-align: left;
  font-size: 18px;
}

header {
  background:
    linear-gradient(
      90deg,
      rgba(76, 90, 94, 1) 3%,
      rgba(29, 89, 218, 1) 44%,
      rgba(42, 89, 184, 1) 52%,
      rgba(26, 81, 154, 1) 67%,
      rgba(26, 77, 149, 1) 85%,
      rgba(35, 6, 52, 0.3223039215686274) 94%
    );
  margin: 2rem auto 1rem;
  padding: 1rem;
  text-align: center;
  font-weight: 600;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

img {
  width: 10%;
}

form {
  margin: auto;
  width: 90%;
  justify-content: center;
  display: flex;
  flex-direction: column;
}

input {
  padding: 0.6rem 0.8rem;
  margin-bottom: 1rem;
  font-size: 1.4rem;
}

label {
  margin-bottom: 0.5rem;
  font-size: 1.4rem;
  font-weight: 600;
}

button {
  padding: 0.6rem 0.8rem;
  font-weight: bold;
  font-size: 1.4rem;
  background: linear-gradient(120deg, #242ea0, #478be2);
  color: #fff;
}

.container {
  margin: 0 auto;
  max-width: 1120px;
}

.m-1 {
  margin: 1rem;
}

.btn-show-form {
  width: 80px;
  height: 80px;
  border: none;
  outline: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}

.book-catalog {
  background: rgb(76, 78, 94);
  background:
    linear-gradient(
      90deg,
      rgba(76, 78, 94, 1) 31%,
      rgba(21, 49, 107, 0.8769257703081232) 53%,
      rgba(42, 89, 184, 1) 67%,
      rgba(26, 81, 154, 1) 76%,
      rgba(26, 77, 149, 1) 84%,
      rgba(35, 6, 52, 0.3223039215686274) 97%
    );
  display: flex;
  flex-direction: column;
  text-align: left;
  border: 2px solid #fff;
  border-radius: 15px;
  color: #eee;
  position: absolute;
  z-index: 1;
  margin-right: 1rem;
  padding: 0.5rem;
  right: -10px;
  top: 80px;
  clip-path:
    polygon(
      0% 0%,
      100% 0%,
      99% 87%,
      74% 87%,
      75% 100%,
      50% 90%,
      0 90%
    );
}

.book-catalog-title,
.total,
.completed,
.to-read {
  padding: 0.5rem;
  font-weight: 600;
  border-bottom: 1px dotted #fff;
}

.total,
.completed,
.to-read {
  color: rgb(111, 168, 184);
}

.form-popup {
  justify-content: center;
  align-items: center;
  width: 58%;
  background: rgb(76, 90, 94);
  background:
    linear-gradient(
      90deg,
      rgba(76, 90, 94, 1) 5%,
      rgba(87, 105, 129, 1) 53%,
      rgba(35, 6, 52, 0.3223039215686274) 76%
    );
  margin: -4rem auto 1rem;
  padding: 1rem;
  border-radius: 15px;
}

.hidden {
  display: none;
}

.empty-text {
  margin-top: 3em;
  font-weight: bold;
  color: rgb(111, 168, 184);
  text-align: center;
}

.trash-btn,
.edit-btn {
  background: var(--color-danger);
  border: none;
  border-radius: 50%;
  padding: 1rem;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
}

.edit-btn {
  background: var(--color-success);
  margin-left: 0.5rem;
}

.fa-trash,
.fa-edit,
.min-max-icon {
  pointer-events: none;
}

.book {
  transition: all 0.3s ease;
}

.fall {
  transform: translateY(8rem) rotateZ(25deg);
  opacity: 0;
}

.actions {
  width: 130px;
}

.switch {
  position: relative;
  display: inline-block;
  align-self: start;
  margin-bottom: 1rem;
}

.switch-input {
  display: none;
}

.switch-label {
  display: block;
  width: 48px;
  height: 24px;
  text-indent: -150%;
  clip: rect(0 0 0 0);
  color: transparent;
  user-select: none;
}

.clear-all {
  margin-left: auto;
  margin-top: -1rem;
}

.switch-label::before,
.switch-label::after {
  content: "";
  display: block;
  position: absolute;
  cursor: pointer;
}

.switch-label::before {
  width: 100%;
  height: 100%;
  background-color: #dedede;
  border-radius: 9999em;
  -webkit-transition: background-color 0.25s ease;
  transition: background-color 0.25s ease;
}

.switch-label::after {
  top: 0;
  left: 0;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background-color: #fff;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.45);
  -webkit-transition: left 0.25s ease;
  transition: left 0.25s ease;
}

.switch-input:checked + .switch-label::before {
  background-color: #89c12d;
}

.switch-input:checked + .switch-label::after {
  left: 24px;
}

.btn-show-form:hover {
  transform: scale(2.1);
}

@media only screen and (max-width: 760px),
  (min-device-width: 768px) and (max-device-width: 1024px) {
  table {
    width: 100%;
  }

  /* Force table to not be like tables anymore */
  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  tr {
    border: 1px solid #ccc;
  }

  td {
    /* Behave  like a "row" */
    border: none;
    border-bottom: 1px solid #eee;
    position: relative;
    padding-left: 50%;
  }

  /* Hide table headers (but not display: none;, for accessibility) */
  thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  td::before {
    /* Now like a table header */
    position: absolute;

    /* Top/left values mimic padding */
    top: 6px;
    left: 6px;
    width: 45%;
    padding-right: 10px;
    white-space: nowrap;

    /* Label the data */
    content: attr(data-column);
    color: #000;
    font-weight: bold;
  }

  .form-popup {
    width: 90%;
    margin-top: 1rem;
  }
}
