 :root {
  --bg-color: #f4f4f4;
  --text-color: #141526;
  --accent-color: #f8c470;
  --border-color: rgba(0, 0, 0, 0.1);
  --input-border-color: rgb(212, 212, 212);
}

/* Dark Mode */
body.dark-mode {
  --bg-color: #141526;
  --text-color: #fff;
  --accent-color: #f8c470;
  --border-color: rgba(143, 143, 143, 0.1);
  --input-border-color: rgb(80, 80, 80);
}


.spinner{
 width: 50px;
 height: 50px;
 border-radius: 50%;
 border: 6px solid #ccc;
 border-top: 6px solid var(--accent-color);
  position: fixed;
  top: 50%;
  left: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}


.books {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 2rem;
  gap: 1.5rem;
  max-width: 1300px;
  margin: 0 auto;
  background-color: var(--bg-color);
  color: var(--text-color);
}



.book-card {
  max-width: 100%;
  height: auto;
  background-color: var(--bg-color);
  color: var(--text-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  text-align: center;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.book-card:hover {
  transform: translateY(-5px);
}

.book-card img {
  width: 100%;
  height: 17rem;
  border-radius: 5px;
  object-fit: cover;
}

.book-title {
  font-size: 1.1rem;
  margin: 12px 0 4px;
  font-weight: 600;
  color: var(--text-color);
}

.book-author {
  font-size: 0.9rem;
  color: var(--text-color);
  margin-bottom: 12px;
  font-weight: 200;
}

.book-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-color);
}

.rate i {
  color: #f0c040;
  font-size: 1rem;
}

.book-price {
  font-weight: bold;
  color: #2a9d8f;
}

.book-info i.ri-heart-line {
  color: #888;
  cursor: pointer;
  transition: color 0.3s ease;
}

.book-info i.ri-heart-line:hover {
  color: #e63946;
}

.book-info i.ri-heart-fill {
  color: #e63946;
  cursor: pointer;
  transition: color 0.3s ease;
}


.btn{
  background-color: #ffc118;
  color: #141526;
  border: none;
  border-radius: 5px;
  padding: 0.5rem 1rem;
  width: auto;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn:hover {
  background-color: #ddb23b;
}


@media (max-width: 900px) {

.books {
  place-items: center;
  grid-template-columns: 1fr 1fr;
}
}


@media (max-width: 600px) {

.books {
  place-items: center;
  grid-template-columns: 1fr;
}
  .book-card {
    width: 100%;
    max-width: 20rem;
  }

  .book-card img {
    height: 20rem;
  }
}
