/**
 * Print-Specific Styles for PDF Export
 * Optimized for A4 paper, clean layout, no UI chrome
 */

@media print {
  /* ========================================
     RESET & PAGE SETUP
     ======================================== */

  * {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  @page {
    size: A4 portrait;
    margin: 1.5cm 2cm;
  }

  html,
  body {
    width: 210mm;
    height: 297mm;
    margin: 0;
    padding: 0;
    font-size: 11pt;
    line-height: 1.5;
  }

  body {
    /* Allow rich backgrounds from web view - do NOT force white */
    /* Preserve theme colors and background images */
  }

  /* ========================================
     HIDE UI ELEMENTS
     ======================================== */

  /* Navigation & Controls */
  nav,
  header,
  .sticky,
  [class*="nav"],
  [class*="Nav"],
  button,
  .no-print,
  [data-no-print="true"] {
    display: none !important;
  }

  /* Chat/Feedback FAB */
  [class*="fab"],
  [class*="FAB"],
  [class*="chat"],
  [class*="feedback"] {
    display: none !important;
  }

  /* Sticky Footer */
  footer,
  [class*="footer"],
  [class*="Footer"] {
    display: none !important;
  }

  /* Edit Controls, Settings, Tooltips */
  [class*="edit"],
  [class*="settings"],
  [class*="tooltip"],
  [class*="dropdown"],
  [class*="modal"],
  [class*="drawer"] {
    display: none !important;
  }

  /* Scrollbars */
  ::-webkit-scrollbar {
    display: none !important;
  }

  /* ========================================
     LAYOUT & SPACING
     ======================================== */

  .max-w-6xl,
  .max-w-5xl,
  .max-w-4xl,
  .container {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Remove excess margins */
  .min-h-screen {
    min-height: auto !important;
  }

  /* ========================================
     TYPOGRAPHY
     ======================================== */

  h1 {
    font-size: 24pt;
    font-weight: bold;
    margin-bottom: 12pt;
    margin-top: 0;
  }

  h2 {
    font-size: 18pt;
    font-weight: bold;
    margin-bottom: 10pt;
    margin-top: 16pt;
  }

  h3 {
    font-size: 14pt;
    font-weight: bold;
    margin-bottom: 8pt;
    margin-top: 12pt;
  }

  p {
    margin-bottom: 8pt;
    orphans: 3;
    widows: 3;
  }

  a {
    color: black;
    text-decoration: none;
  }

  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666;
  }

  /* ========================================
     BLOCK-LEVEL ELEMENTS
     ======================================== */

  /* Prevent page breaks inside blocks */
  [class*="block"],
  .hero,
  .gallery,
  .pricing,
  .timeline,
  .comparison,
  .weather,
  .currency,
  article,
  section {
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 16pt;
  }

  /* Hero Block */
  [class*="hero"] {
    page-break-after: avoid;
    margin-bottom: 20pt;
  }

  [class*="hero"] img {
    max-height: 200pt !important;
    width: 100% !important;
    object-fit: cover;
  }

  /* Gallery */
  [class*="gallery"] {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8pt !important;
  }

  [class*="gallery"] img {
    width: 100% !important;
    height: auto !important;
    max-height: 150pt !important;
    object-fit: cover;
  }

  /* Pricing Cards */
  [class*="pricing"] {
    page-break-inside: avoid;
  }

  [class*="pricing"] [class*="card"],
  [class*="pricing"] [class*="option"] {
    border: 1pt solid #ddd !important;
    padding: 10pt !important;
    margin-bottom: 8pt !important;
    page-break-inside: avoid;
  }

  /* Timeline/Itinerary */
  [class*="timeline"] {
    page-break-inside: avoid;
  }

  [class*="timeline"] [class*="day"],
  [class*="timeline"] [class*="event"] {
    padding: 6pt 0 !important;
    border-left: 2pt solid #333 !important;
    padding-left: 10pt !important;
    margin-bottom: 8pt !important;
  }

  /* Comparison Table */
  table,
  [class*="comparison"] {
    page-break-inside: avoid;
    width: 100% !important;
    border-collapse: collapse !important;
  }

  table th,
  table td {
    border: 1pt solid #ddd !important;
    padding: 6pt !important;
    text-align: left !important;
  }

  /* ========================================
     IMAGES & MEDIA
     ======================================== */

  img {
    max-width: 100% !important;
    height: auto !important;
    page-break-inside: avoid;
  }

  /* Hide videos, show placeholder */
  video,
  iframe,
  [class*="video"],
  [class*="map"] {
    display: block !important;
    height: 100pt !important;
    background: #f0f0f0 !important;
    border: 1pt solid #ddd !important;
    page-break-inside: avoid;
  }

  video::after,
  iframe::after {
    content: "[Video Content - View online]";
    display: block;
    padding: 20pt;
    text-align: center;
    color: #666;
  }

  /* ========================================
     INTERACTIVE ELEMENTS (Static for Print)
     ======================================== */

  /* Weather Widget - Show static version */
  [class*="weather"] {
    border: 1pt solid #ddd !important;
    padding: 10pt !important;
    background: #f9f9f9 !important;
  }

  /* Currency Converter - Show static info */
  [class*="currency"] {
    border: 1pt solid #ddd !important;
    padding: 10pt !important;
    background: #f9f9f9 !important;
  }

  /* Flight Status - Show static info */
  [class*="flight"] {
    border: 1pt solid #ddd !important;
    padding: 10pt !important;
    background: #f9f9f9 !important;
  }

  /* ========================================
     RICH VISUALS PRESERVATION
     ======================================== */

  /*
   * DO NOT force light mode - preserve theme aesthetics
   * Allow dark backgrounds, gradients, and colors to print
   * Ensure text remains readable with sufficient contrast
   */

  /* Ensure dark text on dark backgrounds gets proper contrast */
  .bg-zinc-950,
  .bg-zinc-900,
  .bg-zinc-800,
  .bg-black {
    /* Keep backgrounds as-is for rich visual output */
  }

  /* Ensure white/light text is visible on dark backgrounds */
  .text-white,
  .text-gray-100,
  .text-gray-200 {
    /* Keep as-is - needed for dark theme proposals */
  }

  /* Ensure sufficient contrast for readability */
  .dark {
    /* Allow dark themes to print with full visual fidelity */
  }

  /* ========================================
     EXPAND TABS & ACCORDIONS FOR PRINT
     ======================================== */

  /*
   * TIMELINE BLOCK: Show all days sequentially
   * Hide tab navigation, display all day content panels
   */

  /* Hide the day tabs navigation bar */
  .timeline-tabs-nav {
    display: none !important;
  }

  /* Force all timeline day panels to be visible (overrides hidden class) */
  .timeline-day-panel {
    display: block !important;
    opacity: 1 !important;
    position: static !important;
    transform: none !important;
    page-break-inside: avoid;
    margin-bottom: 20pt !important;
  }

  /* Add visible separator between days (except first) */
  .timeline-day-panel:not(:first-child) .timeline-day-header {
    margin-top: 24pt !important;
    padding-top: 20pt !important;
    border-top: 1pt solid currentColor !important;
    page-break-before: auto;
  }

  .timeline-day-panel:first-child .timeline-day-header {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  /* Ensure events container displays */
  .timeline-day-panel [class*="space-y-6"] {
    display: block !important;
  }

  /* Remove animations/transforms from day panels */
  .timeline-days-container > div {
    animation: none !important;
    transition: none !important;
  }

  /*
   * FAQ BLOCK: Expand all accordion items
   * Force all questions/answers to be visible
   */

  /* Force all FAQ accordion answer containers to be visible */
  .faq-block .faq-answer-container {
    display: block !important;
    height: auto !important;
    opacity: 1 !important;
    overflow: visible !important;
  }

  /* Ensure FAQ answer content is visible */
  .faq-block .faq-answer {
    display: block !important;
    height: auto !important;
  }

  /* Hide chevron toggle icons in FAQ */
  .faq-block .faq-accordion-item button {
    display: none !important;
  }

  /* Keep FAQ items contained */
  .faq-block .faq-accordion-item {
    page-break-inside: avoid;
    margin-bottom: 12pt !important;
  }

  /* ========================================
     UTILITY OVERRIDES
     ======================================== */

  /* Remove shadows */
  [class*="shadow"] {
    box-shadow: none !important;
  }

  /* Remove animations */
  * {
    animation: none !important;
    transition: none !important;
  }

  /* Remove fixed/sticky positioning */
  [class*="fixed"],
  [class*="sticky"] {
    position: static !important;
  }

  /* ========================================
     CUSTOM PRINT CLASSES
     ======================================== */

  /* Allow specific elements to be print-only */
  .print-only {
    display: block !important;
  }

  .print-hide {
    display: none !important;
  }

  /* Page break helpers */
  .page-break-before {
    page-break-before: always;
  }

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

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