/**
 * WID LegacyGuard - Print Stylesheet
 * Version: 4.0.5
 * 
 * Styles for printing custodian cards, emergency cards, and other documents.
 */

@media print {
  /* Reset for print */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
  
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
    line-height: 1.4;
    margin: 0;
    padding: 0;
  }
  
  /* Hide non-printable elements */
  .no-print,
  button,
  .btn,
  nav,
  .tabs,
  #modeBanner,
  .modal,
  .banner:not(.print-banner) {
    display: none !important;
  }
  
  /* Card styling */
  .card {
    background: #fff !important;
    border: 1px solid #333 !important;
    border-radius: 8px;
    padding: 16px;
    page-break-inside: avoid;
    margin-bottom: 16px;
  }
  
  /* Headers */
  h1, h2, h3 {
    color: #1d4ed8 !important;
    page-break-after: avoid;
  }
  
  /* Links */
  a {
    color: #000 !important;
    text-decoration: underline;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
  
  /* Lists */
  .list li {
    border: 1px solid #ccc !important;
    background: #fff !important;
  }
  
  /* QR Codes */
  .qr-container {
    border: 1px solid #000 !important;
    padding: 8px;
    background: #fff !important;
  }
  
  /* Banners for print */
  .print-banner {
    border: 2px solid #333 !important;
    background: #f5f5f5 !important;
    padding: 12px;
    margin: 12px 0;
  }
  
  /* Page breaks */
  .page-break {
    page-break-before: always;
  }
  
  .avoid-break {
    page-break-inside: avoid;
  }
  
  /* Custodian card specific */
  .custodian-card {
    max-width: 4in;
    border: 2px solid #1d4ed8 !important;
    padding: 16px;
    margin: 0 auto;
  }
  
  .custodian-card h1 {
    font-size: 14pt;
    margin-bottom: 12px;
  }
  
  .custodian-card .qr-container {
    margin: 16px auto;
    display: block;
    text-align: center;
  }
  
  .custodian-card .share-code {
    font-family: monospace;
    font-size: 9pt;
    word-break: break-all;
    background: #f5f5f5;
    padding: 8px;
    border: 1px solid #ccc;
  }
  
  /* Emergency card specific */
  .emergency-card {
    max-width: 6in;
    border: 3px solid #1d4ed8 !important;
    padding: 20px;
    margin: 0 auto;
  }
  
  /* Footer */
  .print-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 8pt;
    color: #999;
    padding: 8px;
    border-top: 1px solid #ccc;
  }
  
  /* Two-up printing for custodian cards */
  @page {
    size: letter;
    margin: 0.5in;
  }
  
  .print-two-up {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5in;
  }
  
  .print-two-up .custodian-card {
    max-width: 100%;
  }
}

/* Print preview mode (for on-screen print preview) */
.print-preview {
  background: #fff;
  color: #000;
  padding: 0.5in;
  max-width: 8.5in;
  margin: 0 auto;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.print-preview .card {
  background: #fff;
  border: 1px solid #333;
}

.print-preview button,
.print-preview .btn {
  display: none;
}
