body {
  margin: 0;
  background: #111;
  color: #fff;
  /* font-family: Arial, sans-serif; */
}

/* ===== HEADER ===== */
.header {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: #000;
  align-items: center;
}

.header .search {
  flex: 1;
}

/* altura padronizada */
.header input,
.header select {
  height: 42px;
  padding: 0 12px;
  background: #111;
  border: 1px solid #333;
  color: #fff;
  font-size: 14px;
  box-sizing: border-box;
}

.header input {
  width: 100%;
}

/* ===== GRID ===== */
/* PC / Tablet (capas maiores) */
.library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
  padding: 28px;
  align-items: start;
  /* ✅ evita esticar itens verticalmente */
}

/* MOBILE: mantém como está */
@media (max-width: 600px) {
  .library {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }
}

/* ===== CARD ===== */
.folder {
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  align-self: start;
  /* ✅ garante altura natural do item */
}

.folder.favorite {
  outline: 2px solid gold;
}

/* ✅ REGRA PRINCIPAL:
    O CARD NÃO MUDA DE TAMANHO.
    Mantém a altura fixa pela capa (2/3).
*/
.folder-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
}

/* CAPA E CONTEÚDO */
.folder-cover,
.folder-content {
  position: absolute;
  inset: 0;
}

/* ===== CAPA ===== */
.folder-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* FAVORITO (SOMENTE NA CAPA) */
.folder-cover .favorite-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 20px;
  cursor: pointer;
  z-index: 5;
}

/* esconder estrela quando aberto */
.folder.open .favorite-btn {
  display: none;
}

/* BADGE */
.badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #4caf50;
  color: #000;
  font-size: 13px;
  padding: 4px 7px;
  border-radius: 4px;
  font-weight: bold;
  z-index: 5;
}

/* ===== ANIMAÇÃO ===== */
.folder-cover,
.folder-content {
  transition: opacity .25s ease, transform .25s ease;
}

.folder.open .folder-cover {
  opacity: 0;
  transform: scale(0.96);
  pointer-events: none;
}

/* ===== CONTEÚDO COM CAPA AO FUNDO ===== */
.folder-content {
  position: absolute;
  inset: 0;
  display: none;
  background-size: cover;
  background-position: center;
  padding: 16px;
}

.folder-content::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
      rgba(0, 0, 0, .85),
      rgba(0, 0, 0, .75));
  backdrop-filter: blur(2px);
  z-index: 0;
}

.folder-content>* {
  position: relative;
  z-index: 1;
}

/* wrapper rolável */
.folder-scroll {
  position: relative;
  z-index: 1;
  height: 100%;
  overflow-y: auto;
  padding-right: 4px;
}

/* estado aberto */
.folder.open .folder-content {
  display: block;
}

/* ===== VOLTAR (DIREITA) ===== */
.back-btn {
  position: sticky;
  top: 0;
  margin-left: auto;
  float: right;
  background: #222;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

/* ===== PDF ITEM ===== */
.pdf-item {
  display: flex;
  gap: 12px;
  margin: 12px 0;
  align-items: center;
  cursor: pointer;
}

.pdf-item img {
  width: 48px;
}

.progress {
  font-size: 12px;
  color: #ccc;
}

/* ===== SKELETON ===== */
.skeleton {
  background: linear-gradient(90deg, #222, #333, #222);
  background-size: 200% 100%;
  animation: skeleton 1.2s infinite;
  border-radius: 8px;
  aspect-ratio: 2 / 3;
}

/* ==============================
SCROLLBAR MODERNA (DARK)
APLICA SOMENTE NO CONTEÚDO
============================== */

/* Chrome, Edge, Safari */
.folder-scroll::-webkit-scrollbar {
  width: 8px;
}

.folder-scroll::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
}

.folder-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg,
      #444,
      #222);
  border-radius: 10px;
  border: 2px solid rgba(0, 0, 0, 0.25);
}

.folder-scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg,
      #666,
      #333);
}

/* Firefox */
.folder-scroll {
  scrollbar-width: thin;
  scrollbar-color: #444 rgba(0, 0, 0, 0.25);
}

/* ================= SIDEBAR ================= */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: #000;
  transform: translateX(-100%);
  transition: .25s;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  padding: 10px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #333;
}

.thumbs {
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  overflow-y: auto;
}

.thumb img {
  width: 100%;
  background: #000;
}

/* =====================================================
BLOQUEIO DE INTERAÇÕES NA IMAGEM DO PDF
===================================================== */

.page img {
  pointer-events: none;
  /* não recebe cliques */
  user-select: none;
  /* não seleciona */
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  /* iOS: sem menu */
  -webkit-tap-highlight-color: transparent;
}

/* ================= DESKTOP FULL WIDTH ================= */
@media (min-width: 1025px) {
  .reader {
    max-width: 100%;
    width: 100%;
    margin: 0;
  }
}

@media (min-width: 1025px) {
  .book-container {
    flex: 1;
    height: auto;
  }
}


@keyframes skeleton {
  from {
    background-position: 0%
  }

  to {
    background-position: 200%
  }
}

img {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-touch-callout: none;
}