/* Visibility helpers */
.idalo-pdf-hidden { display: none !important; }

/* Prevent body scroll when modal is open */
.idalo-pdf-no-scroll { overflow: hidden; }

/* Overlay */
.idalo-pdf-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99998;
  opacity: 1;
  transition: opacity 150ms ease-in-out;
}

/* Modal container */
.idalo-pdf-modal {
  position: fixed;
  z-index: 99999;
  left: 50%;
  top: 5vh;
  transform: translateX(-50%);
  width: min(96vw, 1100px);
  height: 90vh;
  background: #fff;
  color: #111;
  border-radius: 10px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.idalo-pdf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e5e5;
  background: #f7f7f7;
}

.idalo-pdf-title {
  font-weight: 600;
  font-size: 16px;
  margin: 0;
}

/* Actions (download + close) */
.idalo-pdf-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.idalo-pdf-download {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 4px;
  background: #0a66c2;
  color: #fff !important;
  text-decoration: none;
  font-weight: 600;
  line-height: 1.2;
}
.idalo-pdf-download:hover,
.idalo-pdf-download:focus {
  background: #084d94;
  text-decoration: none;
}

.idalo-pdf-close {
  border: 0;
  background: transparent;
  color: #333;
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
}
.idalo-pdf-close:hover,
.idalo-pdf-close:focus {
  color: #000;
}

/* Body + iframe */
.idalo-pdf-body {
  flex: 1;
  min-height: 0; /* allows iframe to size within flex container */
  background: #f9f9f9;
}

.idalo-pdf-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

/* Reduce modal size on small screens */
@media (max-width: 768px) {
  .idalo-pdf-modal {
    top: 2vh;
    width: 96vw;
    height: 96vh;
    border-radius: 8px;
  }

  .idalo-pdf-title {
    font-size: 15px;
  }

  .idalo-pdf-download {
    padding: 6px 10px;
    font-size: 14px;
  }

  .idalo-pdf-close {
    font-size: 20px;
  }
}

/* High-contrast focus for accessibility */
.idalo-pdf-download:focus,
.idalo-pdf-close:focus {
  outline: 2px solid #0a66c2;
  outline-offset: 2px;
}

/* Optional fade-in animation */
@keyframes idaloPdfModalIn {
  from { transform: translateX(-50%) translateY(10px); opacity: 0.96; }
  to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}
.idalo-pdf-modal {
  animation: idaloPdfModalIn 160ms ease-out;
}