/* search.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
 
:root {
  --red:        #F05454;
  --red-dark:   #d94444;
  --offwhite:   #f7f7f7;
  --white:      #ffffff;
  --text:       #111111;
  --muted:      #888888;
  --border:     #e4e4e4;
  --card-bg:    #ffffff;
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.07);
  --shadow-md:  0 6px 20px rgba(0,0,0,0.10);
}
 
body {
  font-family: 'Poppins', sans-serif;
  background: var(--offwhite);
  color: var(--text);
  min-height: 100vh;
}
 
.page-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}
 
/* search bar */
.search-header { margin-bottom: 28px; }
 
.search-page-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 14px;
}
 
.search-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border-radius: 8px;
  padding: 0 16px;
  height: 48px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
 
.sb-icon { color: #bbb; flex-shrink: 0; }
 
.search-bar-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  color: var(--text);
}
 
.search-bar-input::placeholder { color: #bbb; }
 
.content-row {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
 
/* ==SIDEBAR== */
.filters {
  width: 220px;
  flex-shrink: 0;
  background: var(--white);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 16px;
  position: sticky;
  top: 80px;        
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: none;
}
 
.filters::-webkit-scrollbar { display: none; }
 
.filter-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
 
.filter-label {
  font-size: 13px;
  font-weight: 700;
}
 
.reset-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--red);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
 
.reset-btn:hover { text-decoration: underline; }
 
/* filter group section */
.filter-group {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
 
.filter-group:last-of-type { border-bottom: none; }
 
.filter-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 8px;
  border-radius: 5px;
  margin-bottom: 10px;
}
 
.filter-group-header.red {
  background: var(--red);
  color: #fff;
}
 
/* selection / checkbox rows */
.radio-row,
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #333;
  margin-bottom: 7px;
  cursor: pointer;
  user-select: none;
}
 
.radio-row input[type="radio"],
.check-row input[type="checkbox"] {
  accent-color: var(--red);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
 
/* author input */
.author-input {
  width: 100%;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  color: var(--text);
  margin-bottom: 8px;
  outline: none;
}
 
.author-input:focus { border-color: var(--red); }
 
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
 
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f0f0f0;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}
 
.chip-x {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: #888;
  padding: 0;
  line-height: 1;
}
 
.chip-x:hover { color: var(--red); }
 
/* apply filters button */
.apply-btn {
  width: 100%;
  height: 36px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.15s;
}
 
.apply-btn:hover { background: var(--red-dark); }
 
/* ==RESULTS AREA== */
.results-area { flex: 1; min-width: 0; }
 
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
 
.results-label { font-size: 16px; font-weight: 700; }
 
.results-count { font-size: 13px; color: var(--muted); }
 
/* book grid (max 4 columns) */
.book-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
 
/* book card */
.book-card {
  background: var(--white);
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
 
.book-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
 
.book-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
  background: #eee;
}
 
.book-info {
  padding: 10px 10px 12px;
}
 
.book-name {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
 
.book-author {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
 
/* star rating */
.star-row {
  display: flex;
  align-items: center;
  gap: 1px;
  margin-bottom: 5px;
}
 
.star { font-size: 11px; }
.star.filled  { color: #F05454; }
.star.empty   { color: #ddd; }
 
.book-reads {
  font-size: 10px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
 
/* placeholder loading cards */
.book-card.skeleton {
  cursor: default;
  pointer-events: none;
  animation: pulse 1.4s ease-in-out infinite;
}
 
.book-card.skeleton::before {
  content: '';
  display: block;
  aspect-ratio: 2 / 3;
  background: #e8e8e8;
}
 
.book-card.skeleton::after {
  content: '';
  display: block;
  height: 56px;
  background: #f0f0f0;
  margin: 10px;
  border-radius: 4px;
}
 
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}
 
/* empty state (no books found) */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}
 
.empty-state p { margin-top: 14px; font-size: 14px; }
 
/* ==PAGINATION== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 32px;
  flex-wrap: wrap;
}
 
.page-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
 
.page-btn:hover { background: #f0f0f0; }
 
.page-btn.active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
 
.page-btn.arrow { font-size: 16px; color: #888; }
.page-btn.arrow:disabled { opacity: 0.35; cursor: default; }
.page-btn.ellipsis { border: none; background: transparent; cursor: default; color: #888; }
 

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .book-grid { grid-template-columns: repeat(3, 1fr); }
}
 
@media (max-width: 720px) {
  .content-row { flex-direction: column; }
  .filters { width: 100%; position: static; max-height: none; }
  .book-grid { grid-template-columns: repeat(2, 1fr); }
}
 
@media (max-width: 480px) {
  .book-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}