@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #e9e5dc;
  font-size: 14px;
}

.page-info {
  text-align: center;
  margin: 10px 0 20px 0;
  font-size: 14px;
  color: #555;
  font-weight: 500;
}

.shelf {
  padding: 40px 20px;
  background: linear-gradient(180deg, #f3efe6 0%, #e9e5dc 100%);
  /* fallback gradient instead of missing image */
  background-size: cover;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 30px;
}

.book {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 15px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.book:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.85);
}

.book img {
  width: 140px;
  height: 200px;
  object-fit: contain;
  background: #fff;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transition: all 0.3s ease;
}

.book:hover img {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.book-title {
  margin-top: 12px;
  font-weight: 600;
  text-align: center;
  color: #2c2c2c;
  line-height: 1.4;
}

.book-year {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
  font-weight: 500;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  right: -400px;
  width: 350px;
  height: 100vh;
  background: #fff;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.3);
  padding: 20px;
  overflow-y: auto;
  transition: .4s ease;
  z-index: 20;
}

.modal.open {
  right: 0;
}

.modal img {
  width: 100%;
  height: auto;
  object-fit: contain;
  margin-bottom: 15px;
}

.close-btn {
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  float: right;
}

.meta-title {
  font-weight: bold;
  margin-top: 10px;
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
}

.modal-btn {
  display: inline-block;
  padding: 12px 20px;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.modal-btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.modal-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.modal-btn-secondary {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
}

.modal-btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(245, 87, 108, 0.5);
}

/* Pagination Styles */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.pagination-btn {
  padding: 8px 16px;
  border: 1px solid #ccc;
  background-color: #fff;
  color: #333;
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
  transition: background-color 0.2s, color 0.2s;
}

.pagination-btn:hover:not(:disabled) {
  background-color: #333;
  color: #fff;
}

.pagination-btn:disabled {
  background-color: #eee;
  color: #aaa;
  cursor: not-allowed;
  border-color: #ddd;
}

.pagination-info {
  font-size: 14px;
  font-weight: bold;
  color: #555;
}

/* Responsive Pagination */
@media (max-width: 600px) {
  .pagination {
    flex-wrap: wrap;
    gap: 5px;
  }

  .pagination-btn {
    padding: 6px 10px;
    font-size: 12px;
    flex: 1 1 auto;
  }

  .pagination-info {
    width: 100%;
    text-align: center;
    order: -1;
    margin-bottom: 5px;
  }
}