/* InstantCopyTraders — Print Styles (extracted for performance)
   Consolidated into a single @media print block for clarity & maintainability */

@media print {

  /* ── 1. Page setup ── */
  @page { margin: 1.5cm; size: auto; }

  /* ── 2. Base reset: white background, black text, no transitions ── */
  *, *::before, *::after {
    text-shadow: none !important;
    box-shadow: none !important;
    animation: none !important;
    transition: none !important;
    animation-delay: 0s !important;
    animation-duration: 0s !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12pt !important;
    line-height: 1.5 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  html { scroll-behavior: auto !important; }

  /* ── 3. Hide non-essential chrome ── */
  .navbar,
  .footer,
  .mobile-bottom-nav,
  .mobile-overlay,
  .mobile-sidebar-toggle,
  .sidebar,
  .skip-to-content,
  .breadcrumb,
  .page-header-actions,
  .dashboard-footer,

  /* Ticker & trust bars */
  .ticker-tape,
  .ticker-strip,
  .ticker-section,
  .trust-bar-lower,

  /* Decorative backgrounds & effects */
  .gradient-mesh,
  .gradient-mesh-blob,
  .data-stream-bg,
  .data-stream-col,
  .hero-candles,
  .hero-grid,
  .hero-price-line,
  .stat-card-chart,
  .glass-premium::before,
  .card-gradient-border::before,
  .hover-sparkle::after,
  .live-indicator-dot::before,

  /* Scroll & loading indicators */
  .back-to-top-wrap,
  .btt-ring-bg,
  .btt-ring-fill,
  .page-loading-bar,
  .reading-progress,
  .scroll-indicator,
  .ict-loading-screen,

  /* Modals, overlays, popups */
  .modal-overlay,
  .scm-overlay,
  .exit-modal-overlay,
  .exit-popup-overlay,
  .dl-modal-overlay,
  .confirm-modal,
  .tour-overlay,

  /* Banners, toasts, notifications */
  .cookie-banner,
  .cookie-consent,
  .connection-banner,
  .offline-banner,
  .ct-toast,
  .toast-container,
  .notif-dropdown,
  .social-proof-toast,
  .proof-toast,
  .help-widget,
  .onboarding-banner,
  #onboarding-banner,
  #first-trader-prompt,
  #referral-banner,
  .td-referral-banner,
  .network-status-banner,
  .pwa-install-banner,

  /* Interactive widgets */
  .feedback-widget,
  .compare-bar,
  .cmd-palette,
  .sticky-cta-bar,
  .cross-page-cta,
  .final-cta-glow,
  .error-bg,
  .chat-bubble,
  .glossary-tooltip,
  .urgency-badge,
  .cta-social-proof,

  /* Buttons & controls (non-essential for print) */
  .btn-group,
  .mobile-settings-tabs,
  .mst-tab,
  .toggle,
  .toggle-slider,
  .theme-toggle,
  .testimonial-carousel-dots,

  /* Form micro-interaction decorations */
  .form-group-float .form-label-float,
  .form-input-valid::after,
  .form-input-error::after,

  /* Billing interactive elements */
  .billing-skeleton,
  .billing-how-card,
  .billing-savings-tip,
  #payment-section,
  .billing-help-footer,

  /* Trader-dashboard decorative elements */
  .td-hero-header::before,
  .td-hero-header::after,
  .td-onboarding-card::before,
  .td-status-pulse,
  .td-compact-icon,
  .td-stat-icon-circle,

  /* Legal page navigation */
  .legal-toc-sidebar,
  .legal-sidebar-toc,
  .legal-mobile-toc,
  .legal-cross-nav,
  .legal-back,
  .legal-reading-time,
  .legal-progress-bar,
  .section-tag,
  .fab,
  video,
  iframe { display: none !important; }

  /* ── 4. Layout resets ── */
  .dashboard-layout,
  .dashboard { display: block !important; }
  .main-content { padding: 0 !important; margin-left: 0 !important; }
  .container { max-width: 100% !important; padding: 0 !important; }

  /* ── 5. Links: show URLs ── */
  a { color: #333 !important; text-decoration: underline !important; }
  a[href]::after {
    content: " (" attr(href) ")" !important;
    font-size: 0.8em !important;
    color: #555 !important;
    font-weight: 400 !important;
  }
  a[href^="/"]::after {
    content: " (instantcopytraders.com" attr(href) ")" !important;
  }
  a[href^="#"]::after,
  a[href^="javascript"]::after,
  a[href^="mailto"]::after,
  a[href^="tel"]::after,
  .navbar-brand::after,
  .btn::after,
  .sidebar-nav a::after,
  nav a::after,
  .billing-overview-bar a::after,
  .footer a::after { content: none !important; }

  /* ── 6. Cards & containers ── */
  .card,
  .feature-card,
  .pricing-card,
  .testimonial-card,
  .sub-card,
  .sub-card-enhanced,
  .mini-testimonial-card,
  .trader-card,
  .tp-header-card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    background: #fff !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .stat-card {
    border: 1px solid #ddd !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* ── 7. Typography ── */
  h1, h2, h3, h4, h5, h6 { color: #000 !important; page-break-after: avoid; }
  p, li, blockquote { orphans: 3; widows: 3; }
  .hero { background: #fff !important; padding: 20px 0 !important; }
  .hero h1 { color: #000 !important; }
  .hero .subtitle { color: #333 !important; }
  .section-alt-bg { background: #f9f9f9 !important; }

  /* Preserve meaningful PnL colors */
  .pnl-positive,
  .stat-value.pnl-positive,
  .stat-value.positive {
    color: #059669 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .pnl-negative,
  .stat-value.pnl-negative,
  .stat-value.negative {
    color: #dc2626 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .text-muted, .text-secondary, .stat-label,
  .stat-note, .billing-overview-label { color: #444 !important; }

  /* ── 8. Badges ── */
  .badge,
  .billing-period-badge {
    border: 1px solid #999 !important;
    background: transparent !important;
    color: #333 !important;
  }

  /* ── 9. Tables ── */
  table, .table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 10pt !important;
    page-break-inside: auto;
  }
  table th {
    background: #f5f5f5 !important;
    color: #000 !important;
    border-bottom: 2px solid #999 !important;
    padding: 6px 8px !important;
    font-size: 9pt !important;
    text-align: left !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  table td {
    border-bottom: 1px solid #ddd !important;
    color: #333 !important;
    padding: 6px 8px !important;
    font-size: 9pt !important;
  }
  tr { page-break-inside: avoid; }
  thead { display: table-header-group; }
  tfoot { display: table-footer-group; }

  /* ── 10. Images & charts ── */
  img { max-width: 100% !important; }
  svg { max-width: 100% !important; height: auto !important; }
  .tp-chart-min canvas,
  .chart-min canvas { max-width: 100% !important; height: auto !important; }
  .tp-chart-min,
  .chart-min,
  .chart-container,
  .chart-wrap {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* ── 11. Dark backgrounds to white ── */
  .card,
  .stat-card,
  .main-content,
  .dashboard,
  .page-section,
  section,
  .hero,
  .billing-overview-bar,
  .legal-page,
  .legal-contact-box { background: #fff !important; }

  /* ── 12. Grid layouts ── */
  .stats-grid,
  .stats-grid-3 { grid-template-columns: repeat(3, 1fr) !important; }
  .stats-grid-4 { grid-template-columns: repeat(4, 1fr) !important; }

  /* ── 13. Page breaks ── */
  .section, section { page-break-inside: avoid; }

  /* ── 14. Reveal / scroll animations: ensure content visible ── */
  .reveal,
  .reveal-up,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  [data-animate],
  [data-scroll],
  .fade-in,
  .animate-in {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
  }

  /* ── 15. Page title branding ── */
  .page-header h1::after {
    content: " — InstantCopyTraders" !important;
    font-weight: 400 !important;
    font-size: 0.6em !important;
    color: #666 !important;
  }

  /* ── 16. Buttons visible as outlined text ── */
  .btn {
    border: 1px solid #000 !important;
    background: transparent !important;
    color: #000 !important;
    padding: 4px 8px !important;
  }
  /* Hide interactive-only buttons — pointless on paper */
  .btn-primary,
  .btn-danger,
  .btn-success,
  .btn-secondary {
    display: none !important;
  }
  /* Print/export buttons are meta-actions worth showing */
  .btn-print,
  .btn-export {
    display: inline-block !important;
  }

  /* ── 17. Gradient text fix (ensure visibility) ── */
  [style*="background-clip: text"],
  [style*="-webkit-background-clip: text"],
  .gradient-text,
  .gradient-text-green,
  .gradient-text-gold,
  .gradient-text-sunset,
  .gradient-text-accent,
  .legal-title,
  .pricing-card .price,
  .share-panel h3 {
    -webkit-text-fill-color: #000 !important;
    background: none !important;
    color: #000 !important;
  }

  /* ── 18. Billing / invoice print ── */
  .billing-overview-bar {
    display: flex !important;
    flex-wrap: wrap !important;
    border: 1px solid #ccc !important;
    padding: 12px !important;
    gap: 16px !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .billing-overview-card {
    background: transparent !important;
    border: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .billing-overview-label { color: #666 !important; font-size: 9pt !important; }
  .billing-overview-value { color: #000 !important; font-size: 11pt !important; font-weight: 700 !important; }
  .billing-overview-icon,
  .billing-overview-divider { display: none !important; }
  .billing-invoice-table,
  .billing-fee-table { width: 100% !important; border-collapse: collapse !important; }
  .billing-invoice-table th,
  .billing-fee-table th {
    background: #f5f5f5 !important;
    color: #000 !important;
    border-bottom: 2px solid #999 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .billing-invoice-table td,
  .billing-fee-table td {
    border-bottom: 1px solid #ddd !important;
    color: #333 !important;
  }
  .open-trade-row {
    border-bottom: 1px solid #ddd !important;
    background: transparent !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .open-trade-row:hover { background: transparent !important; transform: none !important; }

  /* ── 19. Dashboard sidebar hidden, full-width content ── */
  .db-sidebar { display: none !important; }
  .db-main,
  .db-main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* ── 20. Settings page: collapse tabs into visible blocks ── */
  .tab-content {
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
    position: static !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* ── 21. Trader-dashboard hero ── */
  .td-hero-header {
    border: 1px solid #ddd;
    background: #fff !important;
  }

  /* ── 22. Legal pages ── */
  .legal-page {
    max-width: 100% !important;
    padding: 20px !important;
    color: #000 !important;
  }
  .legal-flex-layout { display: block !important; }
  .legal-title {
    background: none !important;
    -webkit-text-fill-color: #000 !important;
    color: #000 !important;
    font-size: 1.8rem !important;
  }
  .legal-page .legal-content {
    color: #333 !important;
    line-height: 1.6 !important;
    font-size: 11pt !important;
  }
  .legal-page .legal-content h2 {
    color: #000 !important;
    font-size: 14pt !important;
    page-break-after: avoid;
    border-bottom-color: #ccc !important;
    border-top-color: #ccc !important;
  }
  .legal-page .legal-content h2 .section-num {
    background: transparent !important;
    color: #000 !important;
    border: 1px solid #999 !important;
    box-shadow: none !important;
  }
  .legal-page .legal-content h3 {
    color: #222 !important;
    font-size: 12pt !important;
    page-break-after: avoid;
  }
  .legal-page .legal-content p,
  .legal-page .legal-content li {
    color: #333 !important;
    line-height: 1.7;
    orphans: 3;
    widows: 3;
  }
  .legal-page .legal-content ul,
  .legal-page .legal-content ol { page-break-inside: avoid; }
  .legal-page .legal-content ul > li::before {
    background: #333 !important;
    box-shadow: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .legal-page .legal-content a {
    color: #333 !important;
    text-decoration: underline !important;
  }
  .legal-page .legal-content a::after {
    content: " (" attr(href) ")" !important;
    font-size: 0.7rem;
    color: #666;
  }
  .legal-page .legal-content a[href^="/"]::after {
    content: " (instantcopytraders.com" attr(href) ")" !important;
  }
  .legal-page .legal-content a[href^="#"]::after { content: none !important; }
  .legal-contact-box {
    border: 1px solid #ccc !important;
    background: #f9f9f9 !important;
  }
  .legal-contact-box::before { background: transparent !important; border-left: 3px solid #999 !important; }
  .legal-contact-box p,
  .legal-contact-box strong { color: #000 !important; }
  .legal-warning {
    color: #c00 !important;
    border: 1px solid #c00 !important;
    padding: 8px 12px !important;
    background: #fff5f5 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .legal-updated-badge {
    background: none !important;
    border: 1px solid #ccc !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .legal-updated-badge .badge-label { color: #666 !important; }
  .legal-updated-badge .badge-date { color: #000 !important; }
  .legal-page .legal-content table { border-color: #ccc !important; }
  .legal-page .legal-content table th {
    background: #f0f0f0 !important;
    color: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .legal-page .legal-content table td {
    color: #333 !important;
    border-color: #ddd !important;
  }

  /* ── 23. Print footer with URL ── */
  body::after {
    content: "Printed from instantcopytraders.com";
    display: block;
    text-align: center;
    font-size: 8pt;
    color: #555;
    margin-top: 24px;
    padding-top: 8px;
    border-top: 1px solid #ddd;
    page-break-before: avoid;
    break-before: avoid;
  }
}
