/* Redmine PDF Preview - Styles */

.pdf-preview-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.3s ease-in;
  overflow: hidden;
}

.pdf-preview-modal.active {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pdf-preview-content {
  position: relative;
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  width: 90vw;
  height: 90vh;
  max-width: 1400px;
  max-height: 900px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pdf-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background-color: #f5f5f5;
  border-bottom: 1px solid #ddd;
  flex-shrink: 0;
}

.pdf-preview-title {
  font-weight: bold;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.pdf-preview-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #333;
  padding: 0;
  margin-left: 20px;
  line-height: 1;
}

.pdf-preview-close:hover {
  color: #000;
}

.pdf-preview-fullscreen {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #333;
  padding: 0;
  margin-left: 15px;
  line-height: 1;
  transition: color 0.2s ease;
}

.pdf-preview-fullscreen:hover {
  color: #000;
}

/* Fullscreen mode styles */
.pdf-preview-content:fullscreen {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  border-radius: 0;
  box-shadow: none;
}

.pdf-preview-content:fullscreen .pdf-preview-header {
  display: none;
}

/* Webkit fullscreen (Safari) */
.pdf-preview-content:-webkit-full-screen {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  border-radius: 0;
  box-shadow: none;
}

.pdf-preview-content:-webkit-full-screen .pdf-preview-header {
  display: none;
}

/* IE 11 fullscreen */
.pdf-preview-content:-ms-fullscreen {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  border-radius: 0;
  box-shadow: none;
}

.pdf-preview-content:-ms-fullscreen .pdf-preview-header {
  display: none;
}

.pdf-preview-body {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fafafa;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.pdf-preview-canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.pdf-preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  flex: 1;
}

.pdf-preview-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Make attachment links clickable for preview */
a[data-previewable="true"] {
  cursor: pointer;
  text-decoration: underline dotted;
}

a[data-previewable="true"]:hover {
  text-decoration: underline solid;
}

/* PDF.js page container */
.pdf-page {
  display: flex;
  justify-content: center;
  margin: 20px auto;
}

.pdf-page canvas {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
