/* Document Content Display Styles */
/* Styling for embedded PDF/DOC content */
.document-content {
  margin: 20px 0;
  font-family: 'Roboto', Arial, sans-serif;
}

/* DOCX content specific styles */
.docx-content {
  line-height: 1.6;
  font-size: 15px;
}

.docx-content h1 {
  font-size: 28px;
  margin-top: 30px;
  margin-bottom: 20px;
  color: #333;
}

.docx-content h2 {
  font-size: 24px;
  margin-top: 25px;
  margin-bottom: 15px;
  color: #333;
}

.docx-content .document-title {
  font-size: 32px;
  text-align: center;
  margin-bottom: 30px;
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
}

.table-responsive {
  overflow-x: auto;
  margin: 20px 0;
}

/* PDF specific styling */
.pdf-content {
  line-height: 1.6;
}

.pdf-page {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px dashed #ddd;
  position: relative;
}

.pdf-page:last-child {
  border-bottom: none;
}

.pdf-page-header {
  background-color: #f5f5f5;
  padding: 5px 10px;
  margin-bottom: 10px;
  border-radius: 3px;
  font-size: 14px;
  color: #666;
  text-align: center;
}

.pdf-text-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  opacity: 0.2;
  line-height: 1.0;
}

.pdf-text-layer > span {
  color: transparent;
  position: absolute;
  white-space: pre;
  cursor: text;
  transform-origin: 0% 0%;
}

.pdf-more-pages {
  background-color: #f9f9f9;
  padding: 15px;
  border-radius: 4px;
  text-align: center;
  margin-top: 20px;
}

/* Document styling for headings and content */
.document-content h1,
.document-content h2,
.document-content .document-heading {
  color: #333;
  margin: 24px 0 16px;
  font-weight: 600;
  line-height: 1.3;
}

.document-content h1 {
  font-size: 28px;
  border-bottom: 1px solid #eaecef;
  padding-bottom: 10px;
}

.document-content h2 {
  font-size: 24px;
}

.document-content h3 {
  font-size: 20px;
  margin: 20px 0 12px;
}

.document-content p {
  margin: 12px 0;
  line-height: 1.6;
}

/* Table styling */
.document-table-wrapper {
  overflow-x: auto;
  margin: 20px 0;
}

.document-content table,
.document-table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0;
}

.document-content table th,
.document-content table td,
.document-table th,
.document-table td {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: left;
}

.document-content table th,
.document-table th {
  background-color: #f5f5f5;
}

/* Lists styling */
.document-content ul,
.document-content ol {
  padding-left: 24px;
  margin: 16px 0;
}

.document-content li {
  margin-bottom: 8px;
}

/* Images in documents */
.document-image {
  max-width: 100%;
  height: auto;
  margin: 16px 0;
  display: block;
}

/* Loading state */
.document-loading {
  padding: 30px;
  text-align: center;
  background-color: #f9f9f9;
  border: 1px dashed #ddd;
  border-radius: 4px;
  color: #666;
  margin: 20px 0;
}

.loading-spinner {
  margin: 20px auto;
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #0066cc;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Error state */
.document-error {
  padding: 20px;
  text-align: center;
  background-color: #fff6f6;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  color: #721c24;
  margin: 20px 0;
}

.document-error h3 {
  margin-top: 0;
  color: #721c24;
}

.document-error a {
  color: #0066cc;
  text-decoration: underline;
  font-weight: 500;
}

/* Document header styling */
.document-header {
  background-color: #f5f5f5;
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 4px;
  border-left: 4px solid #0066cc;
}

.document-type {
  background-color: #0066cc;
  color: white;
  padding: 3px 8px;
  border-radius: 3px;
  margin-right: 10px;
  font-size: 14px;
  font-weight: bold;
}

.document-filename {
  font-style: italic;
  color: #666;
  font-size: 14px;
  word-break: break-all;
}

/* Image error in documents */
.image-error {
  display: inline-block;
  background-color: #f5f5f5;
  color: #666;
  padding: 5px 10px;
  font-style: italic;
  font-size: 14px;
  border: 1px dashed #ddd;
}

.download-btn {
  display: inline-block;
  padding: 8px 16px;
  background-color: #0066cc;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.download-btn:hover {
  background-color: #0052a3;
  text-decoration: none;
}

.doc-viewer-fallback {
  padding: 30px;
  text-align: center;
  background-color: #f5f5f5;
  border: 1px dashed #ccc;
}

.doc-viewer-fallback p {
  margin-bottom: 20px;
  color: #666;
}

/* Make sure iframe is responsive */
@media (max-width: 768px) {
  .doc-viewer-container iframe {
    height: 400px;
  }
}
