/**
 * ASF PDF Viewer — estilos. Paleta Conecta SalfaCorp.
 * Se encola junto a asf-pdf-viewer.js.
 */

.asfpdf {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 14px;
  overflow: hidden;
}

/* ── Barra de herramientas ── */
.asfpdf-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 11px;
  background: #FCFCFD;
  border-bottom: 1px solid #F0F1F3;
}
.asfpdf-grp { display: flex; align-items: center; gap: 6px; }

.asfpdf-btn {
  appearance: none;
  border: 1px solid #E5E7EB;
  background: #fff;
  color: #302F36;
  cursor: pointer;
  height: 32px;
  min-width: 32px;
  padding: 0 9px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color .12s, opacity .12s;
}
.asfpdf-btn:hover:not(:disabled) { background: #F3F4F6; }
.asfpdf-btn:disabled { opacity: .4; cursor: not-allowed; }
.asfpdf-btn svg { width: 15px; height: 15px; }

.asfpdf-pg {
  font-size: 13px;
  color: #6B7280;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.asfpdf-pg .asfpdf-num {
  width: 44px;
  text-align: center;
  border: 1px solid #E5E7EB;
  border-radius: 7px;
  padding: 5px 4px;
  font-size: 13px;
  color: #302F36;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.asfpdf-pg .asfpdf-num::-webkit-outer-spin-button,
.asfpdf-pg .asfpdf-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.asfpdf-zlbl {
  font-size: 12px;
  color: #6B7280;
  min-width: 44px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ── Badge "Leído" ── */
.asfpdf-done {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #19A04F;
  background: rgba(25, 160, 79, .1);
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.asfpdf-done.on { display: inline-flex; }

/* ── Progreso de lectura ── */
.asfpdf-prog { height: 3px; background: #EEF0F2; }
.asfpdf-prog i {
  display: block;
  height: 100%;
  width: 0;
  background: #0080D7;
  transition: width .25s ease;
}

/* ── Área del documento ── */
.asfpdf-stage {
  position: relative;
  background: #F3F4F6;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  -webkit-overflow-scrolling: touch;

  /* El alto lo manda el canvas: la caja toma la proporción del PDF.
     El max-height evita que un PDF muy vertical desborde la ventana. */
  height: auto !important;
  max-height: 82vh;
}
.asfpdf-canvas {
  box-shadow: 0 2px 12px rgba(0, 0, 0, .10);
  border-radius: 4px;
  background: #fff;
  max-width: 100%;
  height: auto;
}

.asfpdf-load {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F3F4F6;
  color: #9CA3AF;
  font-size: 13px;
  text-align: center;
  padding: 20px;
}
.asfpdf-spin {
  width: 22px;
  height: 22px;
  border: 3px solid #0080D7;
  border-top-color: transparent;
  border-radius: 50%;
  animation: asfpdf-sp .7s linear infinite;
  margin-right: 9px;
  flex-shrink: 0;
}
@keyframes asfpdf-sp { to { transform: rotate(360deg); } }

.asfpdf-err { color: #B2292E; font-size: 13px; line-height: 1.7; }
.asfpdf-err a { color: #0080D7; font-weight: 600; }

/* ── Pantalla completa ── */
.asfpdf:fullscreen,
.asfpdf:-webkit-full-screen {
  border-radius: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}
.asfpdf:fullscreen .asfpdf-stage { height: auto !important; flex: 1; }

/* ── Móvil: barra compacta ── */
@media (max-width: 640px) {
  .asfpdf-bar { gap: 6px; padding: 8px; }
  .asfpdf-fit { display: none; }
  .asfpdf-zlbl { min-width: 38px; font-size: 11px; }
  .asfpdf-stage { padding: 10px; }
}
