/* === Reset & Layout Dasar === */
body {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background-color: #f7f9fc;
  margin: 0;
  padding: 0;
  color: #333;
}

/* === Header === */
header {
  background-color: #0077cc;
  color: white;
  padding: 1.5rem;
  text-align: center;
}

header h1 {
  margin: 0;
  font-size: 1.8rem;
}

/* === Daftar Buku === */
main.book-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem;
}

.book-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* ?? pastikan tombol di bawah */
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  padding: 12px;
  height: 100%; /* ?? biar grid auto-fill rapi */
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* === Cover Buku === */
.book-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

/* === Konten Buku === */
.book-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* === Judul Buku === */
.book-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  min-height: 2.6em; /* ?? jaga tinggi area judul agar rata */
  line-height: 1.3;
}

/* === Harga Buku === */
.book-price {
  color: #0077cc;
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 0.8rem;
}

/* === Tombol Aksi === */
.book-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: stretch;
}

button {
  flex: 1 1 48%;
  padding: 0.6rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease;
  min-width: 48%;
}


button.desc {
  background-color: #f0f0f0;
}
button.desc:hover {
  background-color: #e0e0e0;
}

button.review {
  background-color: #f8f9fa;
}
button.review:hover {
  background-color: #e7e9eb;
}

button.buy {
  background-color: #0077cc;
  color: white;
}
button.buy:hover {
  background-color: #005fa3;
}

button.read {
  background-color: #00b386;
  color: white;
}
button.read:hover {
  background-color: #009970;
}

/* === Popup Deskripsi (Elegan & Fade-in) === */
#desc-popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  animation: fadeIn 0.4s ease forwards;
}

#desc-popup.active {
  display: flex;
  animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

#popup-box {
  background: white;
  padding: 24px;
  border-radius: 12px;
  max-width: 520px;
  width: 90%;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  animation: scaleUp 0.3s ease;
}

@keyframes scaleUp {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

#popup-title {
  margin-top: 0;
  font-size: 1.3rem;
  color: #0077cc;
}

#popup-desc {
  margin: 1rem 0;
  line-height: 1.5;
}

#popup-close {
  background-color: #0077cc;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s ease;
}

#popup-close:hover {
  background-color: #005fa3;
}

/* === Footer === */
footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
  color: #666;
  background-color: #eaeaea;
}

/* === Responsif === */
@media (max-width: 600px) {
  header h1 {
    font-size: 1.5rem;
  }
  .book-card {
    padding: 10px;
  }
  .book-title {
    font-size: 0.95rem;
  }
  .book-price {
    font-size: 1rem;
  }
}
