/* Shared styles for document preview across all views */

/* Preview wrapper to contain document */
#preview-wrapper {
  overflow: auto;
  max-height: 700px;
}

.document-page {
  background: white;
  padding: 72px;
  min-height: 11in;
  width: 100%;
  max-width: 8.5in;
  margin: 0 auto;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  font-family: 'Times New Roman', Times, Georgia, serif;
  font-size: 12px;
  line-height: 1.5;
  color: #000;
  box-sizing: border-box;
}

@media (max-width: 992px) {
  .document-page {
    padding: 40px;
  }
}

/* Document typography - unified styles for all document previews */
.document-page h1,
.document-content h1 {
  font-size: 14px;
  font-weight: bold;
  margin: 20px 0 10px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.document-page h2,
.document-content h2 {
  font-size: 13px;
  font-weight: bold;
  margin: 18px 0 10px;
}

.document-page h3,
.document-content h3 {
  font-size: 12px;
  font-weight: bold;
  margin: 16px 0 8px;
}

.document-page h4,
.document-content h4 {
  font-size: 12px;
  font-style: italic;
  font-weight: normal;
  margin: 14px 0 8px;
}

.document-page h5,
.document-content h5 {
  font-size: 11px;
  font-weight: bold;
  margin: 12px 0 6px;
}

.document-page h6,
.document-content h6 {
  font-size: 11px;
  font-style: italic;
  font-weight: normal;
  margin: 10px 0 6px;
}

.document-page p,
.document-content p {
  margin: 10px 0;
  line-height: 1.5;
}

.document-page ul,
.document-page ol,
.document-content ul,
.document-content ol {
  margin: 10px 0;
  padding-left: 30px;
}

.document-page li,
.document-content li {
  margin: 5px 0;
}

.document-page blockquote,
.document-content blockquote {
  margin: 15px 0;
  padding: 10px 20px;
  border-left: 4px solid #ddd;
  background: #f9f9f9;
  color: #666;
}

.document-page code,
.document-content code {
  background: #f5f5f5;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
}

.document-page pre,
.document-content pre {
  background: #f5f5f5;
  padding: 10px;
  border-radius: 5px;
  overflow-x: auto;
}

.document-page pre code,
.document-content pre code {
  background: none;
  padding: 0;
}

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

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

.document-page th,
.document-content th {
  background: #f5f5f5;
  font-weight: bold;
}

.document-page hr,
.document-content hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 20px 0;
}

.document-page strong,
.document-content strong {
  font-weight: bold;
}

.document-page em,
.document-content em {
  font-style: italic;
}

.document-page del,
.document-content del {
  text-decoration: line-through;
}

/* Template field highlighting */
.template-field {
  background: rgba(0, 123, 255, 0.1);
  padding: 2px 4px;
  border-radius: 3px;
  border-bottom: 2px solid transparent;
  transition: all 0.3s;
  position: relative;
  font-weight: 600;
  color: #0056b3;
}

.template-field:hover {
  background: rgba(0, 123, 255, 0.2);
  border-bottom: 2px solid #007bff;
  cursor: pointer;
}

.template-field.no-highlight {
  background: transparent;
  border-bottom: none;
  padding: 0;
  font-weight: normal;
  color: inherit;
}

.template-field.highlight {
  background: rgba(255, 193, 7, 0.3);
  border-bottom: 2px solid #ffc107;
}

/* Signature line style */
.signature-line {
  border-bottom: 1px solid #000;
  display: inline-block;
  min-width: 200px;
  text-align: center;
  margin: 0 4px;
}

/* Field list interaction styles */
.field-list-item {
  cursor: pointer;
  transition: background 0.2s;
}

.field-list-item:hover {
  background: #f8f9fa;
}

.field-list-item.active {
  background: #fff3cd;
  border-left: 3px solid #ffc107;
}

/* SimpleMDE editor preview overrides */
.editor-preview,
.editor-preview-side,
.editor-preview-active {
  background: white !important;
  font-family: Helvetica, Arial, sans-serif !important;
  color: #000 !important;
}

.editor-preview pre,
.editor-preview-side pre,
.editor-preview-active pre {
  background: #f5f5f5 !important;
  padding: 10px !important;
  border-radius: 5px !important;
}

.editor-preview code,
.editor-preview-side code,
.editor-preview-active code {
  background: #f5f5f5 !important;
  padding: 2px 4px !important;
  border-radius: 3px !important;
  font-family: 'Courier New', monospace !important;
  font-size: 11px !important;
}

/* Print styles */
@media print {
  .document-page {
    padding: 72px;
    width: 8.5in;
    height: 11in;
    box-shadow: none;
    page-break-after: always;
  }
  
  .template-field {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    font-weight: normal !important;
    color: inherit !important;
  }
}
