@import url("https://fonts.googleapis.com/css2?family=K2D:wght@100;200;300;400;500;600;700;800&display=swap");

.group {
  display: flex;
  line-height: 28px;
  align-items: center;
  position: relative;
  max-width: 100%;
}

h1 {
  display: flex;
}

h1,
summary {
  color: #1f5ca9;
  font-family: "K2D", sans-serif;
}

summary {
  color: #00afef;
}

.input {
  width: 100%;
  height: 50px;
  line-height: 28px;
  padding: 0 1rem;
  padding-left: 2.5rem;
  border: 2px solid transparent;
  border-radius: 8px;
  outline: none;
  background-color: #f3f3f4;
  color: #0d0c22;
  transition: 0.3s ease;
}

.input::placeholder {
  color: #9e9ea7;
}

.input:focus,
.input:hover {
  outline: none;
  border-color: rgba(31, 92, 169, 0.4);
  background-color: #fff;
  box-shadow: 0 0 0 4px rgb(31 92 169 / 10%);
}

.icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  fill: #9e9ea7;
  width: 1rem;
  height: 1rem;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-box .icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.section {
  margin: 10px 0;
  border-radius: 10px;
  padding: 10px;
  transition: all 0.3s ease;
}

.section summary {
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  outline: none;
}

.sections-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.section {
  flex: 1;
  margin: 0;
  width: 100%;
}

ul {
  list-style: none;
  padding: 0;
  margin-top: 10px;
}

/* From Uiverse.io by david-mohseni */ 
.loader {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  flex-direction: row-reverse;
  transform: translateY(30%);
  padding-left: 5px;
}

.hidden {
  display: none;
}

.loader div {
  width: 8%;
  height: 24%;
  background: #1f5ca9;
  position: absolute;
  left: 50%;
  top: 30%;
  opacity: 0;
  border-radius: 50px;
  box-shadow: 0 0 3px rgba(0,0,0,0.2);
  animation: fade458 1s linear infinite;
}

@keyframes fade458 {
  from {
    opacity: 1;
  }

  to {
    opacity: 0.25;
  }
}

.loader .bar1 {
  transform: rotate(0deg) translate(0, -130%);
  animation-delay: 0s;
}

.loader .bar2 {
  transform: rotate(30deg) translate(0, -130%);
  animation-delay: -1.1s;
}

.loader .bar3 {
  transform: rotate(60deg) translate(0, -130%);
  animation-delay: -1s;
}

.loader .bar4 {
  transform: rotate(90deg) translate(0, -130%);
  animation-delay: -0.9s;
}

.loader .bar5 {
  transform: rotate(120deg) translate(0, -130%);
  animation-delay: -0.8s;
}

.loader .bar6 {
  transform: rotate(150deg) translate(0, -130%);
  animation-delay: -0.7s;
}

.loader .bar7 {
  transform: rotate(180deg) translate(0, -130%);
  animation-delay: -0.6s;
}

.loader .bar8 {
  transform: rotate(210deg) translate(0, -130%);
  animation-delay: -0.5s;
}

.loader .bar9 {
  transform: rotate(240deg) translate(0, -130%);
  animation-delay: -0.4s;
}

.loader .bar10 {
  transform: rotate(270deg) translate(0, -130%);
  animation-delay: -0.3s;
}

.loader .bar11 {
  transform: rotate(300deg) translate(0, -130%);
  animation-delay: -0.2s;
}

.loader .bar12 {
  transform: rotate(330deg) translate(0, -130%);
  animation-delay: -0.1s;
}

@keyframes pulse {
  0% {
    transform: scale(0.8);
    background-color: #b3d4fc;
    box-shadow: 0 0 0 0 rgba(178, 212, 252, 0.7);
  }

  50% {
    transform: scale(1.2);
    background-color: #6793fb;
    box-shadow: 0 0 0 10px rgba(178, 212, 252, 0);
  }

  100% {
    transform: scale(0.8);
    background-color: #b3d4fc;
    box-shadow: 0 0 0 0 rgba(178, 212, 252, 0.7);
  }
}

/* Card */
.book-card {
  display: flex;
  gap: 12px;
  background: #ffffff;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.2s ease;
}

.book-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

/* Cover */
.book-cover {
  width: 80px;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
}

/* Info */
.book-info {
  flex: 1;
  font-family: "K2D", sans-serif;
}

.book-title {
  margin: 0 0 5px 0;
  color: #1f5ca9;
  font-size: 16px;
}

.book-info p {
  margin: 2px 0;
  font-size: 13px;
  color: #444;
}

a {
    text-decoration: none;
}

/* From Uiverse.io by Na3ar-17 */ 
.radio-input {
  display: flex;
  flex-direction: row;
  gap: 10px;
  padding-left: 10px;
}

.radio-input * {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

.radio-input label {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0px 20px;
  width: 220px;
  cursor: pointer;
  height: 50px;
  position: relative;
}

.radio-input label::before {
  position: absolute;
  content: "";
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 220px;
  height: 45px;
  z-index: -1;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  border-radius: 10px;
  border: 2px solid transparent;
}

.radio-input .label:has(input:checked)::before {
  border-color: #00afef;
  height: 50px;
}
.radio-input .label .text {
  color: #00afef;
}

.radio-input .label input[type="radio"] {
  background-color: #00afef;
  appearance: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.radio-input .label input[type="radio"]:checked {
  background-color: #00afef;
  -webkit-animation: puls 0.7s forwards;
  animation: pulse 0.7s forwards;
}

.radio-input .label input[type="radio"]:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  transition: all 0.1s cubic-bezier(0.165, 0.84, 0.44, 1);
  background-color: #fff;
  transform: scale(0);
}

.radio-input .label input[type="radio"]:checked::before {
  transform: scale(1);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

/* ===== Responsive cho mobile ===== */
@media (max-width: 768px) {
  /* Nhóm search + radio */
  .group {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .icon {
    top: 25px;
    transform: translateY(-50%);
  }

  .input {
    width: 100%;
    padding-left: 2.5rem;
  }

  /* Radio xuống dưới */
  .radio-input {
    padding-left: 0;
  }

  .radio-input label {
    width: 100%;
    justify-content: flex-start;
  }

  .radio-input label::before {
    width: 100%;
  }

  /* Sections chuyển thành column */
  .sections-container {
    flex-direction: column;
    gap: 10px;
  }

  .section {
    width: 100%;
  }

  /* Card sách gọn hơn trên mobile */
  .book-card {
    flex-direction: row;
    gap: 10px;
  }

  .book-cover {
    width: 60px;
    height: 90px;
  }

  .book-title {
    font-size: 14px;
  }

  .book-info p {
    font-size: 12px;
  }
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
}

button {
  margin: 5px;
  padding: 5px 10px;
  border-radius: 10px;
  background-color: white;
  border: #1f5ca9;
}

button.active {
    background-color: #1f5ca9;
    color: white;
    font-weight: bold;
}