/* =========================================================
   Edition999 — Lecteur PDF UX 2026
   ========================================================= */

.e999-pdf-reader{
  background:#f7f7f7;
  color:#222;
}

/* Header lecteur */
.e999-pdf-reader__hero{
  max-width:1200px;
  margin:18px auto 0;
  padding:0;
}

.e999-pdf-reader__inner{
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:16px;
  align-items:center;
  background:#fff;
  border:1px solid rgba(0,0,0,.08);
  border-radius:18px;
  padding:10px 14px;
  box-shadow:0 10px 30px rgba(0,0,0,.07);
}

.e999-pdf-reader__back{
  font-weight:700;
  color:#C75300;
  text-decoration:none;
}

.e999-pdf-reader__back:hover{
  text-decoration:underline;
}

.e999-pdf-reader__title h1{
  margin:0;
  font-size:1.35rem;
  line-height:1.2;
}

.e999-pdf-reader__title p{
  margin:3px 0 0;
  font-size:.92rem;
  color:rgba(0,0,0,.62);
}

.e999-pdf-reader__actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.e999-reader-btn{
  border:1px solid rgba(0,0,0,.12);
  background:#fff;
  color:#222;
  border-radius:999px;
  padding:8px 12px;
  font-weight:700;
  cursor:pointer;
  text-decoration:none;
  box-shadow:0 4px 14px rgba(0,0,0,.06);
}

.e999-reader-btn:hover,
.e999-reader-btn:focus-visible{
  text-decoration:none;
  outline:2px solid rgba(250,163,7,.65);
  outline-offset:2px;
}

/* Zoom Edition999 */
.e999-reader-zoom{
  display:flex;
  align-items:center;
  gap:8px;
}

#e999ZoomValue{
  min-width:60px;
  text-align:center;
  font-weight:700;
}

/* Navigation + jauge */
.e999-pdf-progress-nav{
  max-width:1200px;
  margin:10px auto 12px;
  display:grid;
  grid-template-columns:44px 1fr 44px;
  gap:10px;
  align-items:center;
}

.e999-pdf-nav-btn{
  width:44px;
  height:44px;
  border:none;
  border-radius:999px;
  background:#faa307;
  color:#fff;
  font-size:1.2rem;
  font-weight:800;
  cursor:pointer;
  flex-shrink:0;
}

.e999-pdf-nav-btn:hover,
.e999-pdf-nav-btn:focus-visible{
  background:#c75300;
  outline:2px solid rgba(250,163,7,.65);
  outline-offset:2px;
}

.e999-pdf-progress{
  margin:0;
  height:34px;
  width:100%;
  border-radius:999px;
  background:rgba(0,0,0,.07);
  overflow:hidden;
  position:relative;
}

.e999-pdf-progress__bar{
  display:block;
  height:100%;
  width:0%;
  background:linear-gradient(90deg, rgba(250,163,7,.9), rgba(199,83,0,.9));
  transition:width .2s ease;
}

.e999-pdf-progress__label{
  position:absolute;
  inset:0;
  z-index:2;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:.88rem;
  font-weight:800;
  color:#222;
}

/* Viewer PDF */
#outerContainer{
  position:relative !important;
  max-width:1200px;
  width:calc(100% - 32px);
  height:calc(100vh - 310px);
  min-height:620px;
  margin:6px auto 24px !important;
  border-radius:16px;
  overflow:hidden;
  box-shadow:0 12px 34px rgba(0,0,0,.10);
  background:#e9e9e9;
}

#mainContainer{
  position:absolute !important;
  inset:0 !important;
}

#viewerContainer{
  position:absolute !important;
  top:0 !important;
  right:0 !important;
  bottom:0 !important;
  left:0 !important;
  overflow:auto !important;
}

/* Suppression barre PDF.js native */
#toolbarContainer,
.toolbar{
  display:none !important;
}

/* Masquage éléments PDF.js inutiles */
#openFile,
#secondaryOpenFile,
#print,
#secondaryPrint,
#presentationMode,
#download,
#secondaryToolbarToggle,
#secondaryToolbar,
#viewAttachments,
#viewLayers,
#documentProperties,
#pageRotateCw,
#pageRotateCcw,
#cursorSelectTool,
#cursorHandTool,
#spreadOdd,
#spreadEven,
#spreadNone,
#viewBookmark,
#secondaryViewBookmark{
  display:none !important;
}

/* Mode nuit */
body.e999-pdf-night{
  background:#101010;
  color:#eee;
}

body.e999-pdf-night .e999-pdf-reader{
  background:#101010;
}

body.e999-pdf-night .e999-pdf-reader__inner{
  background:#181818;
  border-color:rgba(255,255,255,.12);
  color:#eee;
}

body.e999-pdf-night .e999-pdf-reader__title p{
  color:rgba(255,255,255,.68);
}

body.e999-pdf-night .e999-reader-btn{
  background:#222;
  color:#eee;
  border-color:rgba(255,255,255,.16);
}

body.e999-pdf-night .e999-pdf-progress{
  background:rgba(255,255,255,.13);
}

body.e999-pdf-night .e999-pdf-progress__label{
  color:#fff;
}

body.e999-pdf-night #outerContainer{
  box-shadow:0 12px 34px rgba(0,0,0,.45);
}

/* Mobile */
@media (max-width:768px){

  .e999-pdf-reader__hero{
    margin-top:10px;
  }

  .e999-pdf-reader__inner{
    grid-template-columns:1fr;
    gap:10px;
  }

  .e999-pdf-reader__actions{
    display:grid;
    grid-template-columns:1fr;
    width:100%;
    justify-content:stretch;
  }

  .e999-reader-btn{
    width:100%;
    text-align:center;
    padding:8px 10px;
    font-size:.92rem;
  }

  .e999-pdf-reader__title h1{
    font-size:1.15rem;
  }

  .e999-pdf-progress-nav{
    grid-template-columns:42px 1fr 42px;
    gap:8px;
    margin:8px 8px 10px;
  }

  .e999-pdf-nav-btn{
    width:42px;
    height:42px;
  }

  .e999-pdf-progress{
    height:34px;
  }

  #outerContainer{
    width:100%;
    height:calc(100vh - 260px);
    min-height:520px;
    border-radius:0;
    margin:6px 0 14px !important;
  }
}
@media (max-width:768px){
  #viewerContainer{
    overflow:auto !important;
  }

  #viewer{
    margin:0 auto !important;
  }

  .pdfViewer .page{
    margin:0 auto 10px !important;
  }
}
/* =========================================================
   iPhone / iPad : Mode confort
   ========================================================= */

body.e999-reading-mode header,
body.e999-reading-mode nav,
body.e999-reading-mode footer,
body.e999-reading-mode .e999-header,
body.e999-reading-mode .e999-menu,
body.e999-reading-mode .e999-footer{
  display:none !important;
}

body.e999-reading-mode .e999-pdf-reader{
  padding-top:0 !important;
}

body.e999-reading-mode #outerContainer{
  width:100% !important;
  height:100vh !important;
  margin:0 !important;
  border-radius:0 !important;
}