/* TenderWatch — Print-Optimised Stylesheet */

@media print {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12pt;
    line-height: 1.5;
  }

  /* Hide non-essential elements */
  .header,
  .demo-banner,
  .hero-actions,
  .hero-badge,
  .hero-social-proof,
  .how-it-works,
  .alerts-cta,
  .action-bar,
  .filters,
  .pagination,
  .modal-footer,
  .btn,
  .btn-primary,
  .btn-outline,
  .btn-hero-primary,
  .btn-hero-outline,
  .btn-featured-cta,
  .btn-demo-cta,
  .btn-demo-signin,
  .btn-unlock,
  .btn-export,
  .btn-pricing,
  .share-buttons,
  .share-btn,
  .toast,
  .modal-overlay,
  .usage-bar,
  .province-filter,
  .export-options,
  .freshness-dot,
  .risk-gauge-pulse {
    display: none !important;
  }

  /* Hero as clean header */
  .hero {
    background: none !important;
    color: #000 !important;
    padding: 20px 0 !important;
    border-bottom: 2px solid #000;
    page-break-after: avoid;
  }

  .hero::before {
    display: none !important;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-title {
    font-size: 22pt !important;
    color: #000 !important;
  }

  .hero-desc {
    color: #333 !important;
    opacity: 1 !important;
    font-size: 11pt;
  }

  .hero-stats {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 12px;
    margin-top: 16px;
  }

  .hero-stat {
    background: none !important;
    border: 1px solid #ccc !important;
    border-radius: 4px;
    padding: 12px;
    text-align: center;
    backdrop-filter: none !important;
  }

  .hero-stat-number {
    color: #000 !important;
    font-size: 20pt !important;
  }

  .hero-stat--danger .hero-stat-number,
  .hero-stat--warning .hero-stat-number,
  .hero-stat--success .hero-stat-number {
    color: #000 !important;
  }

  .hero-stat-label {
    color: #555 !important;
    opacity: 1 !important;
    font-size: 9pt;
  }

  .hero-sync {
    opacity: 1 !important;
    color: #555 !important;
    font-size: 9pt;
    margin-top: 12px;
  }

  /* Charts - print static */
  .charts-row {
    padding: 16px 0 !important;
  }

  .chart-card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  .chart-card h3 {
    color: #000 !important;
  }

  .timeline-section {
    padding: 0 0 16px !important;
  }

  /* Data table — clean print */
  .table-container {
    padding: 0 !important;
  }

  .data-table {
    box-shadow: none !important;
    border: 1px solid #000;
    font-size: 10pt;
  }

  .data-table thead {
    background: #f0f0f0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .data-table th {
    color: #000 !important;
    border-bottom: 2px solid #000;
    font-size: 9pt;
  }

  .data-table td {
    border-bottom: 1px solid #ccc;
    font-size: 10pt;
    color: #000;
  }

  .data-table tbody tr:hover {
    background: none !important;
  }

  /* Badges — monochrome */
  .risk-badge {
    background: none !important;
    color: #000 !important;
    border: 1px solid #000;
    font-weight: 900;
  }

  .risk-high {
    border-width: 2px;
  }

  .status-badge {
    background: none !important;
    color: #000 !important;
    border: 1px solid #666;
  }

  .type-badge {
    background: none !important;
    color: #000 !important;
    border: 1px solid #999;
  }

  .province-tag {
    background: none !important;
    color: #000 !important;
    border: 1px solid #999;
  }

  /* Blurred text - show in print */
  .blurred-text {
    filter: none !important;
  }

  /* Mobile cards always hidden in print — show table */
  .mobile-only {
    display: none !important;
  }

  .desktop-only {
    display: block !important;
  }

  /* Risk gauges — static in print */
  .risk-gauge svg circle {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Featured card */
  .featured-anomaly {
    padding: 16px 0 !important;
  }

  .featured-card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  /* Footer — print-friendly */
  .footer {
    background: none !important;
    color: #000 !important;
    border-top: 2px solid #000;
    padding: 16px 0;
  }

  .footer .disclaimer {
    color: #333 !important;
  }

  .footer .disclaimer strong {
    color: #000 !important;
  }

  .footer .copyright {
    color: #555 !important;
  }

  .footer .copyright a {
    color: #555 !important;
  }

  .footer .footer-legal {
    color: #555 !important;
  }

  .trust-badges {
    display: none !important;
  }

  /* Page setup */
  @page {
    margin: 1.5cm 2cm;
    size: A4;

    @bottom-center {
      content: "Page " counter(page) " of " counter(pages);
      font-size: 9pt;
      color: #666;
    }

    @bottom-left {
      content: "TenderWatch SA — sword.sandtonstreets.com";
      font-size: 8pt;
      color: #999;
    }

    @bottom-right {
      content: "Confidential — Requires Human Review";
      font-size: 8pt;
      color: #999;
    }
  }

  /* Print footer with methodology note */
  .footer::after {
    content: "Methodology: Risk scores are calculated using deterministic forensic rules including bid rotation detection, shell company analysis, director overlap checks, and contract value anomaly detection. All flags are pattern-match indicators and require human investigation. Source: sword.sandtonstreets.com/cw-dashboard";
    display: block;
    margin-top: 16px;
    font-size: 8pt;
    color: #666;
    line-height: 1.5;
    border-top: 1px solid #ccc;
    padding-top: 8px;
  }

  /* Ensure page breaks work well */
  .chart-card,
  .featured-card,
  .mobile-card {
    page-break-inside: avoid;
  }

  h2, h3, h4 {
    page-break-after: avoid;
  }

  /* Screen-reader only helper class */
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

/* Screen-reader only (outside print too) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
