:root {
  --arrow-size: 50px;
  --arrow-bg: linear-gradient(135deg, #444, #666);
  --arrow-color: #fff;
}

/* ----------- GALERIE ----------- */
.pdf-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.pdf-item {
  height: 500px;
  width: 100%;
}

.pdf-item img {
  cursor: pointer;
 width: 100%;
 height: 100% !important;
 object-fit: cover;
  border-radius: 20px !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.pdf-item img:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}

#pdfModal .arrowSlide {
  font-size: 2rem !important;
}

.pdf-title {
  text-align: center;
  margin-top: 15px;
  font-weight: 600;
  color: white;
}

/* ----------- MODAL ----------- */
.pdf-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.pdf-modal.show {
  display: flex;
  opacity: 1;
}

.pdf-modal-content {
  background: #fff;
  border-radius: 8px;
  position: relative;
  text-align: center;
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden; /* ✅ empêche le débordement du canvas */
  padding: 20px 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 30px rgba(0,0,0,0.3);
  animation: popupFade 0.4s ease;
}

@keyframes popupFade {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ----------- CANVAS ----------- */
#pdf-canvas {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 80vh;
  display: block;
  border-radius: 6px;
  object-fit: contain;
  transition: opacity 0.3s ease;
  pointer-events: none; /* ✅ ne bloque plus les clics */
}

/* ----------- FERMETURE ----------- */
.pdf-close {
  position: absolute;
  top: 10px; right: 20px;
  border: none;
  background: none;
  font-size: 2.5rem;
  color: #333 !important;
  cursor: pointer;
  transition: color 0.3s ease;
}

.svg-inline--fa {
  height: 1.5em;
}
.pdf-close:hover { color: #000; }

/* ----------- FLÈCHES ----------- */
.arrowSlidepdf {
  background: var(--arrow-bg);
  color: var(--arrow-color);
  width: var(--arrow-size);
  height: var(--arrow-size);
  line-height: var(--arrow-size);
  border-radius: 50%;
  font-size: 2rem !important;
  text-align: center;
  cursor: pointer;
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  margin: auto;
  backdrop-filter: blur(4px);
  transition: transform 0.3s ease, background 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.arrowSlidepdf:hover {
  transform: scale(1.02) !important;
  
}

.arrowSlidepdf.arrowPrev { left: 10px !important; }
.arrowSlidepdf.arrowNext { right: 10px !important; }

/* ----------- CONTROLES ----------- */
.pdf-controls {
  position: absolute;
  width: 100%;
  top: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 10;
}
.pdf-controls > * {
  pointer-events: auto;
  z-index: 20;
}

/* ----------- ZOOM ----------- */
.zoom-controls {
  display: flex;
  gap: 8px;
  background: rgba(255,255,255,0.15);
  padding: 6px 10px;
  border-radius: 30px;
  backdrop-filter: blur(4px);
}

.zoom-controls button {
  border: none;
  background: var(--arrow-bg);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.zoom-controls button:hover {
  transform: scale(1.1);
  background: linear-gradient(135deg, #666, #888);
}

/* ----------- RESPONSIVE ----------- */
@media (max-width: 768px) {
  .pdf-modal-content { padding: 15px 40px; }
  .arrowSlide { width: 40px; height: 40px; font-size: 1.5rem; }
  .zoom-controls { gap: 6px; padding: 4px 8px; }
  .zoom-controls button {
    width: 30px; height: 30px; font-size: 0.9rem;
  }

  .arrowSlidepdf {
    width: 40px !important;
     height: 40px !important;
      
  }

  #pdfModal .arrowSlide {
    font-size: 1.5rem !important;
  }

  .arrowSlidepdf.arrowPrev {
    left: 5px !important;
  }
  .arrowSlidepdf.arrowNext {
    right: 5px !important;
  }
}

/* ----------- Z-INDEX ----------- */
.pdf-modal-content { position: relative; z-index: 1; }
.pdf-controls { z-index: 5; }


.pdf-modal-content {
  background: #fff;
  border-radius: 8px;
  position: relative;
  text-align: center;
  max-width: 90vw;
  max-height: 90vh;
  width: 90vw;        /* ✅ largeur fixe */
  height: 90vh;       /* ✅ hauteur fixe */
  overflow: hidden;   /* ✅ empêche débordement du zoom */
  padding: 20px 60px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.pdf-viewer {
  transition: transform 0.3s ease;
  transform-origin: center center; /* ✅ le zoom reste centré */
}

#pdf-canvas {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
}

/* === Contrôles du zoom === */
.zoom-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  background: rgba(255,255,255,0.12);
  padding: 8px 14px;
  border-radius: 40px;
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  z-index: 30;
}

.zoom-controls button {
  border: none;
  background: var(--arrow-bg);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.zoom-controls button:hover {
  transform: scale(1.1);
  background: linear-gradient(135deg, #666, #888);
}

/* === Bouton de fermeture (croix) === */
.pdf-close {
  position: absolute;
  top: 15px;
  right: 20px;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(6px);
  color: white;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: transform 0.2s ease, background 0.2s ease;
  z-index: 30;
}

.pdf-close:hover {
  transform: scale(1.1);
  background: rgba(255,255,255,0.25);
}

/* === Ajustement pour le modal et le viewer === */
.pdf-modal-content {
  position: relative;
  background: #fff;
  border-radius: 8px;
  max-width: 90vw;
  max-height: 90vh;
  width: 90vw;
  height: 90vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 30px rgba(0,0,0,0.3);
}

.pdf-viewer {
  transition: transform 0.3s ease;
  transform-origin: center center;
}

.pdf-viewer {
  transition: transform 0.25s ease;
  transform-origin: center center;
  cursor: default;
}

.pdf-viewer.grabbing,
.pdf-viewer:active {
  cursor: grabbing !important;
}
