/* TelaMeusLivros.css */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #13151a;
  color: #e8e4de;
  font-family: "DM Sans", sans-serif;
}

/* ── Layout com sidebar ── */
.page-wrapper {
  display: flex;
  min-height: 100vh;
  padding-top: 70px;
}

.nav-sidebar {
  width: 230px;
  flex-shrink: 0;
  background: linear-gradient(
    180deg,
    rgba(27, 38, 136, 0.55) 0%,
    rgba(6, 11, 48, 0.7) 100%
  ) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid rgba(112, 163, 240, 0.18) !important;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 125px 0 36px;
  position: fixed;
  top: 0px;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
}

.nav-sidebar .admin-only { display: none; }
.nav-sidebar .dev-only   { display: none; }

.nav-sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 24px;
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(232, 236, 244, 0.5) !important;
  text-decoration: none;
  margin-right: 12px;
  border-radius: 0 6px 6px 0;
  border-left: 2px solid transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.nav-sidebar-item:hover {
  background: rgba(112, 163, 240, 0.12) !important;
  color: rgba(232, 236, 244, 0.9) !important;
  border-left-color: rgba(112, 163, 240, 0.3) !important;
}
.nav-sidebar-item.active {
  background: rgba(112, 163, 240, 0.15) !important;
  border-left-color: #70a3f0 !important;
  color: #e8ecf4 !important;
}
.nav-sidebar-item i {
  width: 16px;
  text-align: center;
  font-size: 14px;
  color: #70a3f0 !important;
  opacity: 0.75;
  transition: opacity 0.2s;
}
.nav-sidebar-item:hover i,
.nav-sidebar-item.active i { opacity: 1; }

/* ── Container principal ── */
.container {
  margin-left: 230px;
  padding: 56px 48px 100px;
  flex: 1;
  min-width: 0;
}

/* ── Cabeçalho da página ── */
.page-header {
  margin-bottom: 40px;
}
.page-sup {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #7aadff;
  margin-bottom: 8px;
}
.page-header h1 {
  font-family: "Playfair Display", serif;
  font-size: 38px;
  font-weight: 400;
  color: #fff;
  margin-bottom: 6px;
}
.page-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 300;
}

/* ── Loading ── */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  gap: 14px;
  color: rgba(255, 255, 255, 0.2);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.loading-state i { font-size: 28px; color: rgba(112, 163, 240, 0.4); }

/* ── Estado vazio ── */
.estado-vazio {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  gap: 18px;
}
.estado-vazio-icone {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(112, 163, 240, 0.07);
  border: 1px solid rgba(112, 163, 240, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}
.estado-vazio-icone i {
  font-size: 30px;
  color: rgba(112, 163, 240, 0.4);
}
.estado-vazio h2 {
  font-family: "Playfair Display", serif;
  font-size: 24px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
}
.estado-vazio p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.25);
  max-width: 360px;
  line-height: 1.7;
}
.btn-catalogo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: rgba(112, 163, 240, 0.1);
  border: 1px solid rgba(112, 163, 240, 0.25);
  border-radius: 4px;
  color: #70a3f0;
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  margin-top: 8px;
}
.btn-catalogo:hover {
  background: rgba(112, 163, 240, 0.18);
  border-color: rgba(112, 163, 240, 0.45);
}

/* ── Grid de cards ── */
.livros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

/* ── Card do livro ── */
.card-livro {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.card-livro:hover {
  border-color: rgba(112, 163, 240, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.card-capa-wrap {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}
.card-capa {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.card-livro:hover .card-capa { transform: scale(1.04); }

.card-status-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  backdrop-filter: blur(8px);
}
.badge-nao-iniciado {
  background: rgba(30, 30, 50, 0.8);
  color: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.badge-em-leitura {
  background: rgba(62, 91, 219, 0.85);
  color: #c8d5ff;
  border: 1px solid rgba(112, 163, 240, 0.3);
}
.badge-concluido {
  background: rgba(29, 158, 117, 0.85);
  color: #b6f0dc;
  border: 1px solid rgba(29, 158, 117, 0.4);
}

.card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.card-titulo {
  font-family: "Playfair Display", serif;
  font-size: 16px;
  font-weight: 400;
  color: #fff;
  line-height: 1.3;
}
.card-autor {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
}
.card-locacao {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.22);
  letter-spacing: 0.3px;
}

/* Barra de progresso */
.progresso-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.progresso-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.5px;
}
.progresso-pct {
  font-weight: 600;
  color: #70a3f0;
}
.progresso-barra-bg {
  height: 4px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 2px;
  overflow: hidden;
}
.progresso-barra-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #3e5bdb, #70a3f0);
  transition: width 0.6s ease;
}
.progresso-barra-fill.concluido {
  background: linear-gradient(90deg, #1d9e75, #5dcaa5);
}

.card-pagina {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.25);
}

/* Botão de leitura */
.btn-ler {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 0;
  border-radius: 5px;
  border: none;
  font-family: "DM Sans", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.2s, transform 0.15s;
}
.btn-ler-primario {
  background: linear-gradient(135deg, #3e5bdb, #5c78f0);
  color: #fff;
}
.btn-ler-primario:hover {
  background: linear-gradient(135deg, #2e48c4, #4a64e0);
  transform: translateY(-1px);
}
.btn-ler-concluido {
  background: rgba(29, 158, 117, 0.12);
  color: #5dcaa5;
  border: 1px solid rgba(29, 158, 117, 0.25);
}
.btn-ler-concluido:hover {
  background: rgba(29, 158, 117, 0.2);
}

/* ── Toast ── */
.toast-ml {
  position: fixed;
  bottom: 36px;
  right: 36px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: #111316;
  border: 1px solid rgba(29, 158, 117, 0.4);
  border-radius: 4px;
  padding: 18px 24px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  z-index: 9999;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  min-width: 280px;
}
.toast-ml.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.toast-ml.erro {
  border-color: rgba(226, 75, 74, 0.4);
}
.tm-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(29, 158, 117, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.toast-ml.erro .tm-icon { background: rgba(226, 75, 74, 0.12); }
.tm-icon i { color: #1d9e75; font-size: 13px; }
.toast-ml.erro .tm-icon i { color: #e24b4a; }
.tm-msg { font-size: 13px; color: #e8e4de; }

/* ── Responsividade ── */
@media (max-width: 900px) {
  .nav-sidebar {
    width: 64px;
    padding: 24px 0;
  }
  .nav-sidebar-item span { display: none; }
  .nav-sidebar-item { padding: 13px 0; justify-content: center; margin-right: 0; }
  .container { margin-left: 64px; padding: 40px 24px 80px; }
}
@media (max-width: 600px) {
  .livros-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .container { padding: 32px 16px 80px; }
  .page-header h1 { font-size: 28px; }
}
@media (max-width: 420px) {
  .livros-grid { grid-template-columns: 1fr; }
}
