/* ==========================================================================
   JESS' BOOKS - CATÁLOGO DE LIVROS & FILTROS INTELIGENTES
   ========================================================================== */

/* BARRA DE BUSCA E FILTROS PRINCIPAIS */
.books-filter-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 1.15rem;
}

.search-input {
  width: 100%;
  height: 52px;
  padding: 0 48px 0 50px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-gold-subtle);
}

.search-clear-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  display: none;
}

/* FILTRO DE STATUS EM ABAS HORIZONTAIS */
.status-pills-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.status-pills-bar::-webkit-scrollbar {
  display: none;
}

.status-pill {
  white-space: nowrap;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.status-pill:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.status-pill.active {
  background: var(--accent-gold);
  color: #fff;
  border-color: var(--accent-gold);
}

/* FILTROS SECUNDÁRIOS (GÊNERO, LOCALIZAÇÃO, ORDENAÇÃO) */
.secondary-filters-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (min-width: 640px) {
  .secondary-filters-bar {
    grid-template-columns: repeat(3, 1fr);
  }
}

.filter-select {
  height: 44px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  padding: 0 12px;
  outline: none;
  cursor: pointer;
  width: 100%;
}

.filter-select:focus {
  border-color: var(--border-focus);
}

/* BARRA DE SALTO ALFABÉTICO (A-Z) */
.alphabet-scroller {
  display: flex;
  justify-content: space-between;
  gap: 2px;
  overflow-x: auto;
  padding: 6px 0;
  margin-bottom: 18px;
  scrollbar-width: none;
}

.alphabet-scroller::-webkit-scrollbar {
  display: none;
}

.alpha-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.alpha-btn:hover, .alpha-btn.active {
  background: var(--accent-gold-subtle);
  color: var(--accent-gold);
}

/* CONTADOR DE LIVROS */
.catalog-stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.catalog-stats-header strong {
  color: var(--accent-gold);
  font-weight: 700;
}

/* GRID DE LIVROS */
.books-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 480px) {
  .books-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 820px) {
  .books-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1100px) {
  .books-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* CARD DE LIVRO */
.book-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-bounce), box-shadow var(--transition-fast);
  cursor: pointer;
  position: relative;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  background: var(--bg-card-hover);
}

.book-cover-container {
  width: 100%;
  aspect-ratio: 2 / 3;
  background: var(--bg-surface-elevated);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.book-card:hover .book-cover-img {
  transform: scale(1.04);
}

.book-cover-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  gap: 8px;
  color: var(--text-muted);
}

.book-cover-fallback span {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* BADGES SOBRE A CAPA */
.card-badge-status {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(8px);
}

.badge-lido { background: var(--badge-read-bg); color: var(--badge-read-text); }
.badge-lendo { background: var(--badge-reading-bg); color: var(--badge-reading-text); }
.badge-quero_ler { background: var(--badge-want-bg); color: var(--badge-want-text); }

.card-badge-lent {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--badge-lent-bg);
  color: var(--badge-lent-text);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* CONTEÚDO DO CARD */
.book-card-info {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.book-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-author {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 10px;
}

.meta-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.location-chip {
  color: var(--accent-gold);
  background: var(--accent-gold-subtle);
}

.rating-stars {
  color: #fbbf24;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

/* ESTADO VAZIO (NENHUM LIVRO ENCONTRADO) */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.empty-icon {
  font-size: 3.5rem;
  color: var(--text-muted);
}

.empty-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
}

.empty-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  max-width: 360px;
}
