body {
  background: #f8f9fa;
  font-family: system-ui, -apple-system, sans-serif;
}

.text-purple { color: #6f42c1; }

.book-card {
  transition: all 0.28s ease;
  border: none;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 18px rgba(0,0,0,0.09);
  background: white;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.book-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.18);
}

.book-cover {
  height: 260px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 4.2rem;
  font-weight: bold;
  text-shadow: 0 3px 12px rgba(0,0,0,0.5);
}

.book-title {
  font-size: 1.12rem;
  font-weight: 600;
  margin: 1rem 1.1rem 0.5rem;
  line-height: 1.4;
  height: 3.6em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.book-size {
  font-size: 0.82rem;
  color: #6c757d;
}

.pagination .page-link {
  border-radius: 8px !important;
  margin: 0 5px;
}

.pagination .page-item.active .page-link {
  background-color: #6f42c1;
  border-color: #6f42c1;
}

#books-grid:empty::before {
  content: "A carregar livros...";
  display: block;
  text-align: center;
  padding: 100px 0;
  color: #6c757d;
  font-size: 1.3rem;
}

.modal-fullscreen .modal-dialog {
  margin: 0;
  width: 100vw;
  max-width: none;
  height: 100vh;
}

.modal-fullscreen .modal-content {
  border: 0;
  border-radius: 0;
  height: 100vh;
}

#pdfCanvas {
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 0 30px rgba(0,0,0,0.4);
  transition: transform 0.2s ease;
}

#pdfLoading {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}


/* ═══════════════════════════════════════
    CAPA DO LIVRO
═══════════════════════════════════════ */
.book-card {
    border: none;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 14px rgba(0,0,0,.08);
    cursor: pointer;
    background: #fff;
    transition: transform .25s ease, box-shadow .25s ease;
}
.book-card:hover {
    transform: translateY(-7px) scale(1.015);
    box-shadow: 0 14px 32px rgba(0,0,0,.16);
}
.book-cover {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.1rem 1.2rem;
    transition: filter .2s;
}
.book-card:hover .book-cover { filter: brightness(1.07); }

/* Lombada */
.cover-spine {
    position: absolute;
    inset: 0 auto 0 0;
    width: 13px;
    background: rgba(0,0,0,.22);
    z-index: 1;
}
/* Barra decorativa no topo */
.cover-topbar {
    position: absolute;
    top: 0; left: 13px; right: 0;
    height: 7px;
    background: rgba(255,255,255,.28);
}
/* Padrão diagonal subtil */
.cover-pattern {
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(255,255,255,.055) 0px, rgba(255,255,255,.055) 1px,
        transparent 1px, transparent 10px
    );
    pointer-events: none;
}
/* Título sobre a capa */
.cover-title {
    position: relative;
    z-index: 2;
    font-size: .82rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    text-shadow: 0 1px 5px rgba(0,0,0,.32);
    padding: 0 .35rem;
    max-width: 100%;
}
/* Badge PDF */
.cover-badge {
    position: absolute;
    bottom: .7rem;
    right: .7rem;
    z-index: 2;
    background: rgba(0,0,0,.38);
    color: #fff !important;
    border-radius: 20px;
    padding: .18rem .6rem;
    font-size: .67rem;
    font-weight: 700;
    letter-spacing: .09em;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: .28rem;
}
.book-title {
    font-size: .88rem;
    font-weight: 600;
    color: #2d2d2d;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}
.book-size {
    font-size: .76rem;
    color: #9e9e9e;
}

/* ═══════════════════════════════════════
    PAGINAÇÃO
═══════════════════════════════════════ */
.pagination { gap: 5px; flex-wrap: wrap; }

.pagination .page-link {
    border-radius: 10px !important;
    min-width: 42px;
    height: 42px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: .88rem;
    border: 2px solid #e9ecef;
    color: #6c757d;
    background: #fff;
    padding: 0 .65rem;
    line-height: 1;
    transition: all .2s ease;
}
.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 16px rgba(102,126,234,.45);
    transform: translateY(-2px);
}
.pagination .page-item:not(.disabled):not(.active) .page-link:hover {
    border-color: #764ba2;
    color: #764ba2;
    background: #f3f0ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(118,75,162,.18);
}
.pagination .page-item.disabled .page-link {
    opacity: .3;
    pointer-events: none;
    background: #f8f9fa;
}
#pagination-info {
    font-size: .82rem;
    color: #adb5bd;
}
#pagination-info strong { color: #6c757d; }

/* ═══════════════════════════════════════════════
   BARRA DE PESQUISA  (index.html)
═══════════════════════════════════════════════ */
.search-bar-wrapper { max-width: 640px; }

.search-input-group {
    display: flex;
    align-items: center;
    border: 2px solid #e9ecef;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 2px 14px rgba(0,0,0,.06);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.search-input-group:focus-within {
    border-color: #764ba2;
    box-shadow: 0 4px 22px rgba(118,75,162,.16);
}
.search-icon {
    padding: 0 .75rem 0 1rem;
    color: #adb5bd;
    font-size: 1rem;
    pointer-events: none;
    transition: color .2s;
}
.search-input-group:focus-within .search-icon { color: #764ba2; }

.search-field {
    flex: 1;
    border: none;
    outline: none;
    font-size: .97rem;
    padding: .65rem .4rem;
    background: transparent;
    color: #2d2d2d;
}
.search-field::placeholder { color: #adb5bd; }

.search-clear-btn {
    border: none;
    background: transparent;
    padding: 0 .9rem;
    color: #adb5bd;
    cursor: pointer;
    font-size: .9rem;
    transition: color .15s;
}
.search-clear-btn:hover { color: #764ba2; }

.search-info {
    font-size: .82rem;
    color: #6c757d;
    margin-top: .45rem;
    padding-left: .3rem;
}