/* pdf-modal.css (copie pour static/css) */
.pdf-modal-btn {
  background: #2d6cdf;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.7em 1.5em;
  font-size: 1.1em;
  cursor: pointer;
  transition: background 0.2s;
}
.pdf-modal-btn:hover {
  background: #1a4fa0;
}

.pdf-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pdf-modal-content {
  background: var(--body-background, #fff);
  border-radius: 12px;
  box-shadow: 0 4px 32px var(--shadow-color, #0002);
  max-width: 90%;
  width: 700px;
  max-height: 95%;
  height: 95%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pdf-modal-body {
  padding: 0.5em 1em 0.5em 1em;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  min-height: 0;
  overflow-y: hidden;
}
.pdf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5em 1em 0.5em 1em;
  background: var(--gray-100, #f5f7fa);
  border-bottom: 1px solid var(--gray-200, #e0e0e0);
  font-size: 1.1em;
}
.pdf-modal-title {
  width: 100%;
  text-align: center;
  margin-left: 2em;
  line-height: 1em;
}
.pdf-modal-title h3 {
  margin: 0;
}
.pdf-modal-title a {
  font-size: 0.7em;
}
.pdf-modal-close {
  font-size: 1.7em;
  color: var(--gray-500, #888);
  cursor: pointer;
  padding-left: 1em;
  transition: color 0.2s;
  font-family: inherit;
}
.pdf-modal-close:hover {
  color: #d00;
}
.pdf-modal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1em;
  padding: 0.7em 1.5em;
  background: var(--gray-100, #f5f7fa);
  border-top: 1px solid var(--gray-200, #e0e0e0);
  font-size: 1.1em;
  font-family: inherit;
}
.pdf-modal-footer button {
  background-color: transparent;
  border: 1px solid var(--color-link, #2d6cdf);
  color: var(--color-link, #2d6cdf);
  border-radius: var(--border-radius, 6px);
  padding: 0.2em 0.5em 0.3em 0.5em;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}
.pdf-canvas {
  width: 100%;
  height: auto;
  border: 1px solid var(--gray-200, #e0e0e0);
  border-radius: 6px;
  display: none;
}
.pdf-embed-loadingWrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 350px;
}
.pdf-embed-loading {
  display: inline-block;
  width: 50px;
  height: 50px;
  border: 3px solid var(--gray-200, #e0e0e0);
  border-radius: 50%;
  border-top-color: #383838;
  animation: spin 1s ease-in-out infinite;
  -webkit-animation: spin 1s ease-in-out infinite;
}
@keyframes spin {
  to {
    -webkit-transform: rotate(360deg);
  }
}
@-webkit-keyframes spin {
  to {
    -webkit-transform: rotate(360deg);
  }
}

.pdf-embed-container {
  width: 100%;
  height: auto;
  border: 1px solid var(--gray-500, #888);
  overflow: auto;
  box-sizing: border-box;
}
.pdf-embed-container .pdf-embed-canvas {
  width: 100%;
  height: auto;
  display: block;
  touch-action: pan-x pan-y pinch-zoom;
  -ms-touch-action: pan-x pan-y pinch-zoom;
  overscroll-behavior: contain;
}

p:has(.pdf-btn-inline) {
  display: inline;
  display: inline;
  margin: 0;
}

/* Mobile breakpoint */
@media (max-width: 800px) {
  .pdf-modal-content {
    width: 98%;
    max-width: 98%;
    min-width: 0;
    height: 99%;
    max-height: 99%;
    border-radius: 8px;
    padding: 0;
  }
  .pdf-modal-header,
  .pdf-modal-footer {
    padding: 0.5em 0.5em;
    font-size: 1em;
  }
  .pdf-modal-title {
    word-break: break-all;
  }
  .pdf-modal-body {
    padding: 0.5em 0.2em 0.5em 0.2em;
  }
  .pdf-canvas {
    border-radius: 4px;
  }
  .pdf-modal-btn {
    font-size: 1em;
    padding: 0.6em 1em;
  }
  .pdf-modal-footer button {
    padding: 0.3em 0.8em 0.4em 0.8em;
  }
}