/* Print View Styles */

.print-view {
  max-width: 800px;
  margin: 0 auto;
  padding: 10px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.print-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 1rem;
}

.print-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.print-loading-content {
  text-align: center;
}

.print-header {
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 0.5rem;
}

.print-header h1 {
  font-size: 18px;
  margin-bottom: 0.25rem;
  color: #212529;
}

.print-address {
  color: #6c757d;
  font-size: 11px;
  margin-bottom: 0.125rem;
}

.print-meta {
  color: #6c757d;
  font-size: 10px;
  margin: 0;
}

.print-messages {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.print-message {
  display: flex;
  margin-bottom: 2px;
}

.print-message.sent {
  justify-content: flex-end;
}

.print-message.received {
  justify-content: flex-start;
}

.print-message-bubble {
  max-width: 70%;
  padding: 6px 10px;
  border-radius: 8px;
  word-wrap: break-word;
  overflow: hidden;
  box-sizing: border-box;
}

.print-message.sent .print-message-bubble {
  background-color: #f8f9fa;
  border: 1px solid #333;
}

.print-message.received .print-message-bubble {
  background-color: #fff;
  border: 1px solid #ccc;
}

.print-message-body {
  margin-bottom: 3px;
  white-space: pre-wrap;
  font-size: 11px;
  line-height: 1.3;
  color: #212529;
}

.print-message-media {
  margin-bottom: 3px;
}

.print-message-media img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.print-gif-container {
  position: relative;
  display: inline-block;
  width: 100%;
}

.print-gif-overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  pointer-events: none;
}

.print-gif-label {
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.print-message-media video {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  background: #000;
}

.print-video-container {
  position: relative;
  display: inline-block;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
}

.print-video-overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  pointer-events: none;
}

.print-video-label {
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.print-media-placeholder {
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  text-align: center;
  color: #6c757d;
}

.print-message-time {
  font-size: 9px;
  color: #6c757d;
  margin-top: 2px;
  text-align: right;
}

/* Call-specific styles */
.print-call {
  justify-content: center;
}

.print-call .print-message-bubble {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  text-align: center;
}

.print-call-info {
  font-size: 14px;
  font-weight: 500;
  color: #495057;
  margin-bottom: 4px;
}

.print-call-icon {
  font-size: 16px;
  margin-right: 4px;
}

.print-call-label {
  font-weight: 600;
}

.print-call-duration {
  color: #6c757d;
  font-weight: normal;
}

/* Print-specific styles */
@media print {
  .print-loading-overlay {
    display: none !important;
  }

  .print-view {
    max-width: none;
    padding: 0 0.1in;
  }

  .print-header {
    page-break-after: avoid;
  }

  .print-message {
    page-break-inside: avoid;
  }

  .print-message-bubble {
    page-break-inside: avoid;
  }

  .print-message.sent {
    padding-right: 0.05in;
  }

  @page {
    margin: 0.4in;
  }

  .print-messages {
    gap: 0.1rem;
  }

  .print-message {
    margin-bottom: 0px;
  }

  /* Ensure good contrast for printing */
  .print-message.sent .print-message-bubble {
    background-color: #f0f0f0;
    border: 1px solid #000;
  }

  .print-message.received .print-message-bubble {
    background-color: #fff;
    border: 1px solid #666;
  }

  .print-message-body {
    color: #000;
  }
}

/* Screen-only: hide scrollbars during loading */
@media screen {
  body:has(.print-loading-overlay) {
    overflow: hidden;
  }
}
