/* Print styles for both single message and full chat printing */
@media print {
  /* Hide unnecessary elements */
  header,
  nav,
  .navbar,
  #navigation,
  footer:not(.print-only .footer-content),
  .chat-user-actions,
  #get-started-div,
  .share-chat-bubble,
  button[data-id="send-message"],
  .send-widget-button,
  textarea[data-id="user-input"],
  .agree-terms,
  .ehr-nav-mobile,
  .ehr-nav-desktop,
  .dctr-button:not(.print-only .dctr-button),
  button:not(.print-only button),
  .modal,
  .shareon,
  .popover,
  .feedback-button,
  #feedback-wrapper,
  .how-did-we-do,
  [class*="feedback"],
  [id*="feedback"],
  .security-note,
  .status-labels,
  [class*="security"],
  [class*="hipaa"],
  .safety-message,
  .ai-badge,
  .dctr-header,
  iframe {
    display: none !important;
  }

  /* Basic page setup */
  @page {
    margin: 1.5cm;
  }

  body {
    font-family: var(--font-body), "SF Pro", system-ui, sans-serif !important;
    font-size: 12pt;
    background: #fff !important;
    color: #000 !important;
  }

  /* Container styling */
  .container,
  .container-fluid,
  .dctr-body-limited {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Message styling */
  .dctr-message {
    border: 1px solid #ccc !important;
    border-radius: 0.625rem !important;
    box-shadow: none !important;
    padding: 1rem !important;
    page-break-inside: avoid !important;
    margin-bottom: 1rem !important;
    width: auto !important;
    max-width: 100% !important;
    background-color: #f9f9f9 !important;
    color: #000 !important;
  }

  /* Message label styling */
  .chat-label {
    font-size: 1.2rem !important;
    font-weight: 600 !important;
    margin-bottom: 0.5rem !important;
    color: #000 !important;
  }

  /* Message direction styling */
  .dctr-message-left {
    border-left: 3px solid #5588ff !important;
  }

  .dctr-message-right {
    border-left: 3px solid #00eca1 !important;
    background-color: #f0f9f6 !important;
  }

  /* Links in printed content */
  a {
    -webkit-text-decoration: underline !important;
    text-decoration: underline !important;
    color: #000 !important;
  }

  /* Footer styling for timestamp */
  .footer-content {
    margin-top: 2rem !important;
    padding-top: 1rem !important;
    border-top: 1px solid #ccc !important;
    font-size: 0.75rem !important;
    color: #666 !important;
    text-align: center !important;
  }

  /* Main content area */
  #main-content {
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Print-only container styles */
  .print-only {
    display: block !important;
    margin: 0 auto !important;
    max-width: 100% !important;
    padding-top: 3rem !important; /* Add more spacing at the top */
  }

  /* Add more space before the first message */
  .print-title {
    margin-bottom: 2rem !important;
  }

  /* Ensure first chat message has space above it */
  .print-only .chat-label:first-of-type {
    margin-top: 1.5rem !important;
  }

  /* Page break control */
  .page-break {
    page-break-before: always !important;
  }

  /* Visibility for print content */
  .d-none.print-only {
    display: block !important;
  }

  /* Ensure all text is visible */
  * {
    overflow: visible !important;
  }
}
