/**
 * Print Stylesheet for Ixora Group Website
 * Optimizes pages for printing by hiding navigation, interactive elements,
 * and showing only content with print-friendly styling
 */

@media print {
  /* Reset page margins and colors */
  * {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* Page setup */
  @page {
    margin: 2cm;
    size: A4;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  /* Hide interactive and navigation elements */
  header,
  nav,
  footer,
  .no-print,
  button,
  input[type="submit"],
  input[type="button"],
  [role="navigation"],
  [aria-label="Breadcrumb"] {
    display: none !important;
  }

  /* Hide specific components */
  #whatsapp-button,
  #back-to-top-button,
  #sticky-cta-bar,
  #exit-intent-popup,
  #chat-widget,
  .newsletter-signup,
  .social-share,
  .video-player,
  iframe {
    display: none !important;
  }

  /* Hide forms */
  form {
    display: none !important;
  }

  /* Show only content */
  main {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Typography optimization */
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    page-break-inside: avoid;
    font-weight: bold;
  }

  h1 {
    font-size: 24pt;
    margin-bottom: 12pt;
  }

  h2 {
    font-size: 18pt;
    margin-top: 12pt;
    margin-bottom: 8pt;
  }

  h3 {
    font-size: 14pt;
    margin-top: 8pt;
    margin-bottom: 6pt;
  }

  p, li {
    orphans: 3;
    widows: 3;
  }

  /* Lists */
  ul, ol {
    page-break-inside: avoid;
  }

  /* Tables */
  table {
    border-collapse: collapse;
    width: 100%;
    page-break-inside: avoid;
  }

  table, th, td {
    border: 1px solid black;
  }

  th, td {
    padding: 8pt;
    text-align: left;
  }

  /* Images */
  img {
    max-width: 100% !important;
    page-break-inside: avoid;
    page-break-after: avoid;
  }

  /* Links */
  a {
    text-decoration: underline;
    color: black !important;
  }

  /* Show URLs after links (optional - can be removed if cluttered) */
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666 !important;
  }

  /* Don't show URLs for internal links or anchors */
  a[href^="#"]:after,
  a[href^="/"]:after {
    content: "";
  }

  /* Blockquotes */
  blockquote {
    border-left: 3px solid black;
    padding-left: 12pt;
    margin: 12pt 0;
    page-break-inside: avoid;
  }

  /* Code blocks */
  pre, code {
    border: 1px solid black;
    page-break-inside: avoid;
    white-space: pre-wrap;
    word-wrap: break-word;
  }

  /* Card/section styling for print */
  .card,
  .section,
  article {
    page-break-inside: avoid;
    margin-bottom: 12pt;
  }

  /* Ensure text is readable */
  .text-white,
  .text-gray-50,
  .text-gray-100,
  [style*="color: white"],
  [style*="color: #fff"] {
    color: black !important;
  }

  /* Remove background colors and shadows */
  .bg-gray-50,
  .bg-gray-100,
  .bg-gray-200,
  [class*="bg-"],
  [style*="background"] {
    background: white !important;
  }

  /* Grid and flex adjustments for print */
  .grid,
  .flex {
    display: block !important;
  }

  /* Utility classes for print control */
  .print-only {
    display: block !important;
  }

  .print-break-before {
    page-break-before: always;
  }

  .print-break-after {
    page-break-after: always;
  }

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

  /* Logo styling */
  .logo {
    max-width: 150px;
    margin-bottom: 12pt;
  }

  /* Contact information - make visible for print */
  .contact-info {
    display: block !important;
    margin-top: 12pt;
    padding-top: 12pt;
    border-top: 1px solid black;
  }

  /* Add printed timestamp */
  body::after {
    content: "Printed from ixoragroup.com on " attr(data-print-date);
    display: block;
    position: fixed;
    bottom: 0;
    right: 0;
    font-size: 8pt;
    color: #666 !important;
  }

  /* Optimize specific page elements */
  .hero,
  .banner {
    margin-bottom: 12pt;
  }

  .cta-button,
  .action-button {
    display: none !important;
  }

  /* Statistics and metrics */
  .stat,
  .metric {
    page-break-inside: avoid;
    margin-bottom: 6pt;
  }

  /* Testimonials */
  .testimonial {
    page-break-inside: avoid;
    margin-bottom: 12pt;
    padding: 8pt;
    border: 1px solid black;
  }

  /* Timeline elements */
  .timeline-item {
    page-break-inside: avoid;
    margin-bottom: 8pt;
  }

  /* Pricing tables */
  .pricing-card {
    page-break-inside: avoid;
    border: 1px solid black;
    padding: 8pt;
    margin-bottom: 12pt;
  }

  /* FAQ sections */
  .faq-item {
    page-break-inside: avoid;
    margin-bottom: 8pt;
  }

  /* Ensure icons don't take up space */
  .icon,
  [class*="icon-"] {
    display: none;
  }

  /* Service cards */
  .service-card {
    page-break-inside: avoid;
    border: 1px solid black;
    padding: 8pt;
    margin-bottom: 8pt;
  }
}

/* Print-specific JavaScript can detect this class */
.print-mode-enabled {
  /* Add any special styling for when print mode is detected */
}
