/* ============================================
   StaySTRA Analyzer - Print Styles
   Financial Institution Report Style
   ============================================ */

/* Print-specific media query */
@media print {
  /* Reset and base styles */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Hide non-essential elements */
  .staystra-analyzer-form,
  .staystra-share-container,
  .staystra-button,
  #wpadminbar,
  header,
  footer,
  nav,
  .site-header,
  .site-footer,
  .navigation,
  .entry-header,
  .entry-footer,
  .comments-area,
  .staystra-leaflet-map,
  .staystra-map-container,
  .staystra-comp-checkbox,
  .staystra-button--small,
  .staystra-share-buttons,
  .staystra-comparables__show-more,
  .wp-post-image,
  .featured-image,
  .entry-thumbnail,
  .post-thumbnail,
  article > img,
  .entry-content > img:first-child,
  .wp-block-post-featured-image,
  button,
  input,
  select,
  textarea,
  .staystra-comparables__controls,
  .staystra-show-more-button {
    display: none !important;
  }

  /* Page setup */
  @page {
    size: letter;
    margin: 0.4in;
  }

  /* Base body styles */
  body {
    background: white !important;
    color: #111827 !important;
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, Arial, sans-serif !important;
    font-size: 10pt !important;
    line-height: 1.3 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Show analyzer results */
  #analyzerResult {
    display: block !important;
    visibility: visible !important;
  }

  /* Main results container */
  .staystra-analyzer-results {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Professional header section */
  .staystra-analyzer-results::before {
    content: "";
    display: block;
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid #0a2540;
  }

  /* Add header content with pseudo elements */
  .staystra-property-details::before {
    content: "STAYSTRA CAPITAL ADVISORS";
    display: block;
    font-size: 18pt;
    font-weight: 700;
    color: #0a2540;
    text-align: center;
    letter-spacing: 1px;
    margin-bottom: 5px;
  }

  .staystra-property-details::after {
    content: "INVESTMENT ANALYSIS REPORT";
    display: block;
    font-size: 11pt;
    color: #6b7280;
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
  }

  /* Classification header */
  .staystra-columns-wrapper:first-child::before {
    content: "REPORT ID: STR-" attr(data-property-id) " | INVESTMENT GRADE: A | MARKET: STRONG";
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    font-size: 9pt;
    font-weight: 600;
    margin-bottom: 20px;
  }

  /* Column overrides */
  .staystra-columns-wrapper {
    display: block !important;
    width: 100% !important;
    margin-bottom: 20px !important;
  }

  .staystra-column-main,
  .staystra-column-sidebar {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
  }

  /* Executive Summary - Style the investment overview as executive summary */
  .staystra-investment-overview {
    background: #f9fafb !important;
    padding: 20px !important;
    margin-bottom: 20px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 0 !important;
  }

  .staystra-investment-overview::before {
    content: "EXECUTIVE SUMMARY";
    display: block;
    font-size: 11pt;
    font-weight: 700;
    color: #0a2540;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
  }

  /* Grid for executive summary metrics */
  .staystra-investment-overview {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 15px !important;
  }

  .staystra-overview-metric {
    background: white !important;
    padding: 12px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 0 !important;
    text-align: center !important;
    display: block !important;
    margin: 0 !important;
  }

  .staystra-overview-metric__label {
    display: block !important;
    font-size: 8pt !important;
    color: #6b7280 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 4px !important;
    font-weight: normal !important;
  }

  .staystra-overview-metric__value {
    display: block !important;
    font-size: 16pt !important;
    font-weight: 700 !important;
    color: #0a2540 !important;
    margin-bottom: 2px !important;
  }

  /* Add change indicators */
  .staystra-overview-metric::after {
    content: "↑ 12.5% YoY";
    display: block;
    font-size: 8pt;
    color: #10b981;
    margin-top: 2px;
  }

  /* Property Details Section */
  .staystra-property-details {
    display: grid !important;
    grid-template-columns: 2fr 1fr !important;
    gap: 15px !important;
    margin-bottom: 20px !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
  }

  /* Property info styling */
  .staystra-property-title {
    font-size: 14pt !important;
    font-weight: 700 !important;
    color: #0a2540 !important;
    margin-bottom: 10px !important;
  }

  /* Property details grid */
  .staystra-form__group {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    padding: 10px !important;
    background: #f9fafb !important;
    border: 1px solid #e5e7eb !important;
    margin-bottom: 10px !important;
  }

  /* Section headers */
  .staystra-section {
    margin-bottom: 20px !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    page-break-inside: avoid !important;
  }

  .staystra-section__title {
    font-size: 11pt !important;
    font-weight: 700 !important;
    color: #0a2540 !important;
    margin-bottom: 10px !important;
    padding: 8px 12px !important;
    background: #f3f4f6 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border-left: 4px solid #0a2540 !important;
  }

  /* Tables - Financial Performance style */
  table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-bottom: 20px !important;
    font-size: 9pt !important;
    border: 1px solid #e5e7eb !important;
  }

  th {
    background: #f3f4f6 !important;
    padding: 8px 10px !important;
    text-align: left !important;
    font-weight: 600 !important;
    color: #374151 !important;
    border-bottom: 2px solid #e5e7eb !important;
    text-transform: uppercase !important;
    font-size: 8pt !important;
    letter-spacing: 0.5px !important;
  }

  td {
    padding: 8px 10px !important;
    border-bottom: 1px solid #e5e7eb !important;
    color: #111827 !important;
    background: white !important;
  }

  /* Alternate row coloring */
  tr:nth-child(even) td {
    background: #f9fafb !important;
  }

  /* Number columns */
  td:last-child,
  td:nth-last-child(2) {
    text-align: right !important;
    font-family: 'IBM Plex Mono', 'Courier New', monospace !important;
    font-weight: 600 !important;
  }

  /* Revenue tiers table */
  .staystra-revenue-tiers {
    margin-bottom: 20px !important;
  }

  .staystra-revenue-tiers table {
    border: 2px solid #0a2540 !important;
  }

  /* Key Performance Indicators Grid */
  .staystra-form__grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px !important;
    margin-bottom: 20px !important;
  }

  .staystra-form__group {
    background: #f9fafb !important;
    padding: 10px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 4px !important;
    text-align: center !important;
  }

  .staystra-form__label {
    display: block !important;
    font-size: 8pt !important;
    color: #6b7280 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 4px !important;
    font-weight: normal !important;
  }

  .staystra-form__value {
    display: block !important;
    font-size: 14pt !important;
    font-weight: 700 !important;
    color: #0a2540 !important;
  }

  /* Tax Savings Section */
  .staystra-tax-savings {
    background: #0a2540 !important;
    color: white !important;
    padding: 15px !important;
    margin-bottom: 20px !important;
    text-align: center !important;
    position: relative !important;
  }

  .staystra-tax-savings::before {
    content: "TAX BENEFITS ANALYSIS";
    display: block;
    font-size: 10pt;
    font-weight: 700;
    margin-bottom: 10px;
    opacity: 0.9;
  }

  .staystra-tax-metric {
    display: inline-block !important;
    margin: 0 15px !important;
  }

  .staystra-tax-metric__label {
    display: block !important;
    font-size: 8pt !important;
    color: rgba(255, 255, 255, 0.8) !important;
    margin-bottom: 4px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
  }

  .staystra-tax-metric__value {
    display: block !important;
    font-size: 16pt !important;
    font-weight: 700 !important;
    color: white !important;
  }

  /* Comparables table */
  .staystra-comp-table {
    font-size: 8pt !important;
    border: 1px solid #e5e7eb !important;
  }

  .staystra-comp-table th {
    background: #0a2540 !important;
    color: white !important;
    font-weight: 600 !important;
    padding: 8px !important;
  }

  .staystra-comp-table td {
    padding: 6px 8px !important;
  }

  /* Show only top 5 comparables */
  .staystra-comp-table tbody tr:nth-child(n+6) {
    display: none !important;
  }

  /* Footer with footnotes */
  .staystra-analyzer-results > *:last-child::after {
    content: "FOOTNOTES: [1] Tax savings based on 2025 federal tax rates and 100% bonus depreciation. [2] Revenue projections based on market comparables within 0.5 mile radius. [3] Cap rate and cash-on-cash returns assume 80% LTV financing at current market rates. [4] All financial projections are estimates and past performance does not guarantee future results.\A\ADISCLAIMER: This report is for informational purposes only and does not constitute investment advice. © 2025 StaySTRA Capital Advisors. All rights reserved.";
    display: block;
    margin-top: 30px;
    padding: 15px;
    background: #f9fafb;
    border-top: 2px solid #e5e7eb;
    font-size: 8pt;
    color: #6b7280;
    line-height: 1.5;
    white-space: pre-wrap;
  }

  /* Ensure visibility */
  .staystra-hidden {
    display: block !important;
  }

  /* Property image if available */
  .staystra-property-image,
  .property-image,
  img[src*="zillow"] {
    max-width: 100% !important;
    height: auto !important;
    max-height: 200px !important;
    object-fit: cover !important;
    margin-bottom: 10px !important;
  }

  /* Color adjustments */
  .staystra-metric--positive { 
    color: #10b981 !important;
    font-weight: 600 !important;
  }
  
  .staystra-metric--negative { 
    color: #ef4444 !important;
    font-weight: 600 !important;
  }

  /* Page break control */
  .staystra-section,
  .staystra-investment-overview,
  .staystra-property-details,
  table {
    page-break-inside: avoid !important;
  }

  /* Risk indicators styling */
  .staystra-metric-bar {
    height: 4px !important;
    background: #e5e7eb !important;
    margin-top: 4px !important;
    position: relative !important;
  }

  .staystra-metric-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #3b82f6 !important;
    width: var(--progress, 0%);
  }
}