/* =============================================================================
 * AI Panel: print styles
 * Ported from scitex-cloud global-ai-chat/13-print.css
 * Triggered via body.scitex-print-ai
 * ============================================================================= */

@media print {
  /* Hide everything first */
  body.scitex-print-ai * {
    visibility: hidden;
  }

  /* Show only the active AI view and its contents */
  body.scitex-print-ai .stx-shell-ai-view.active,
  body.scitex-print-ai .stx-shell-ai-view.active * {
    visibility: visible;
  }

  body.scitex-print-ai .stx-shell-ai-view.active {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    max-height: none !important;
    overflow: visible !important;
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
    padding: 1rem;
  }

  /* ── Chat messages ─────────────────────────── */

  body.scitex-print-ai .stx-shell-ai-msg {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    color: #000 !important;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ddd !important;
    page-break-inside: avoid;
  }

  body.scitex-print-ai .stx-shell-ai-msg.user {
    font-weight: 600;
  }

  body.scitex-print-ai .stx-shell-ai-msg.user::before {
    content: "You: ";
    font-weight: 700;
    color: #333;
  }

  body.scitex-print-ai .stx-shell-ai-msg.assistant::before {
    content: "AI: ";
    font-weight: 700;
    color: #333;
  }

  /* ── Config: expand all for print ──────────── */

  body.scitex-print-ai .ai-config-grid,
  body.scitex-print-ai .ai-config-tool-cards {
    max-height: none !important;
    overflow: visible !important;
  }

  body.scitex-print-ai .ai-config-card,
  body.scitex-print-ai .ai-config-tool-card {
    border-color: #ddd !important;
    background: #fff !important;
    color: #000 !important;
  }

  body.scitex-print-ai .ai-config-tool-card {
    background: #f5f5f5 !important;
  }

  /* ── Terminal (xterm) ──────────────────────── */

  body.scitex-print-ai .xterm-screen {
    color: #000 !important;
    background: #fff !important;
  }

  /* ── Code blocks ───────────────────────────── */

  body.scitex-print-ai pre,
  body.scitex-print-ai code {
    background: #f5f5f5 !important;
    color: #000 !important;
    border: 1px solid #ddd !important;
    font-size: 9pt;
    white-space: pre-wrap;
    word-break: break-word;
  }

  /* ── Links: show URL ───────────────────────── */

  body.scitex-print-ai a[href]::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    color: #666;
  }

  /* ── Hide UI elements ──────────────────────── */

  body.scitex-print-ai .stx-shell-ai-tool-tag,
  body.scitex-print-ai .stx-shell-ai-empty,
  body.scitex-print-ai .stx-shell-ai-typing,
  body.scitex-print-ai .ai-config-toggle,
  body.scitex-print-ai .ai-context-download-btn,
  body.scitex-print-ai .ai-config-module-chevron,
  body.scitex-print-ai .ai-config-category-chevron {
    display: none !important;
  }

  /* ── Images ────────────────────────────────── */

  body.scitex-print-ai img {
    max-width: 80% !important;
    height: auto !important;
  }
}
