/* ═══════════════════════ Bouton d'ouverture ═══════════════════════ */
.sepdf-open-btn {
  background: #1c1c1e; color: #fff; border: none;
  padding: 12px 24px; border-radius: 6px; font-size: 15px; cursor: pointer;
}
.sepdf-open-btn:hover { background: #3a3a3d; }

/* ═══════════════════════ Modal plein écran ═══════════════════════ */
.sepdf-modal {
  display: none; position: fixed; inset: 0;
  background: #1f1f21; z-index: 99999; flex-direction: column;
  overscroll-behavior: contain;
}
.sepdf-modal.open { display: flex; }

/* ── Barre d'outils ── */
.sepdf-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  padding: 8px 12px; background: #111;
  flex-shrink: 0; position: relative; z-index: 10;
}
.sepdf-bar-group { display: flex; align-items: center; gap: 6px; }

.sepdf-btn {
  background: #3a3a3d; color: #fff; border: none; border-radius: 6px;
  min-width: 42px; height: 42px; padding: 0 12px;
  font-size: 18px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: background .15s ease;
}
.sepdf-btn:hover  { background: #54545a; }
.sepdf-btn:active { background: #6a6a72; }
.sepdf-close { background: #8a2c2c; font-size: 16px; }
.sepdf-close:hover { background: #a93a3a; }

.sepdf-pageinfo, .sepdf-zoominfo {
  color: #fff; font-size: 14px; text-align: center;
  min-width: 64px; user-select: none;
}

/* ── Scène (zone de zoom / déplacement) ── */
.sepdf-stage {
  flex: 1; position: relative; overflow: hidden;
  background: #1f1f21;
  touch-action: none;                 /* gestes gérés en JS */
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
}
.sepdf-stage.sepdf-grabbing { cursor: grabbing; }

.sepdf-canvas {
  position: absolute; top: 0; left: 0;
  transform-origin: 0 0;
  background: #fff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .5);
  pointer-events: none;               /* clics captés par le stage */
  user-select: none;
  will-change: transform;
}

/* ── Spinner de chargement ── */
.sepdf-spinner {
  position: absolute; top: 50%; left: 50%;
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border: 4px solid rgba(255, 255, 255, .25);
  border-top-color: #fff; border-radius: 50%;
  animation: sepdf-spin .8s linear infinite;
  pointer-events: none; z-index: 5;
}
@keyframes sepdf-spin { to { transform: rotate(360deg); } }

/* ── Indice tactile ── */
.sepdf-hint {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  background: rgba(0, 0, 0, .6); color: #fff;
  font-size: 13px; padding: 7px 14px; border-radius: 20px;
  pointer-events: none; z-index: 6;
  animation: sepdf-fade 4s ease forwards;
}
.sepdf-hint.sepdf-hide { display: none; }
@media (hover: hover) and (pointer: fine) { .sepdf-hint { display: none; } }
@keyframes sepdf-fade {
  0%, 70% { opacity: 1; } 100% { opacity: 0; visibility: hidden; }
}

/* ═══════════════════════ Carte de couverture ═══════════════════════ */
.sepdf-cover-card {
  display: inline-flex; flex-direction: column; align-items: center;
  gap: 12px; max-width: 260px;
}
.sepdf-cover-img-wrap {
  position: relative; width: 220px; min-height: 300px;
  background: #e8e8ed; border-radius: 6px; overflow: hidden; cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .18);
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.sepdf-cover-img {
  display: block; width: 100%; height: auto; position: relative; z-index: 1;
  user-select: none; pointer-events: none; -webkit-user-drag: none;
}
.sepdf-cover-canvas {
  display: block; width: 100% !important; height: auto !important;
  position: relative; z-index: 1; user-select: none; pointer-events: none;
}
.sepdf-cover-placeholder {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; z-index: 0;
}
.sepdf-pdf-icon { font-size: 64px; opacity: .35; }
.sepdf-cover-img-wrap.sepdf-loaded .sepdf-cover-placeholder { display: none; }

.sepdf-cover-overlay {
  position: absolute; inset: 0; background: rgba(0, 0, 0, .55);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s ease; z-index: 2;
  color: #fff; font-size: 18px; font-weight: 600; letter-spacing: .04em;
  pointer-events: none;
}
.sepdf-cover-img-wrap:hover .sepdf-cover-overlay { opacity: 1; }

.sepdf-cover-title {
  margin: 0; font-size: 14px; font-weight: 600; color: #1c1c1e;
  text-align: center; max-width: 220px; line-height: 1.3;
}

/* ═══════════════════════ Mobile ═══════════════════════ */
@media (max-width: 480px) {
  .sepdf-bar { gap: 6px; padding: 6px 8px; }
  .sepdf-btn { min-width: 38px; height: 38px; padding: 0 9px; font-size: 16px; }
  .sepdf-pageinfo, .sepdf-zoominfo { font-size: 13px; min-width: 52px; }
  .sepdf-close { font-size: 14px; }
}

/* ═══════════════════════ Galerie [secure_pdf_library] ═══════════════════════ */
.sepdf-library {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: flex-start;
}
.sepdf-library .sepdf-wrapper { display: inline-block; }
