/* Print-friendly styles for CalcHub calculators */

/* Hide elements that shouldn't be printed */
@media print {
    header, 
    footer, 
    nav,
    .navbar,
    .hero,
    .benefits,
    .categories,
    .newsletter-container,
    .calculator-form,
    .calculator-buttons,
    .calculator-tabs,
    form,
    button,
    .tab-button,
    .tab-description,
    .related-calculators,
    .faq-item,
    iframe,
    .ad-container {
        display: none !important;
    }
    
    /* Show only the result section */
    .calculator-result {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }
    
    /* Basic page styling */
    body {
        font-family: Arial, sans-serif !important;
        font-size: 12pt !important;
        line-height: 1.5 !important;
        color: #000 !important;
        background: #fff !important;
        margin: 0 !important;
        padding: 0.5cm !important;
    }
    
    /* Add page header with calculator name */
    .calculator-container::before {
        content: attr(data-calculator-name) " Results";
        display: block;
        font-size: 18pt;
        font-weight: bold;
        text-align: center;
        margin-bottom: 1cm;
        border-bottom: 1pt solid #000;
        padding-bottom: 0.5cm;
    }
    
    /* Add CalcHub branding */
    .calculator-result::after {
        content: "Calculation performed using CalcHub - calc-hub-1-thewaywithin.replit.app";
        display: block;
        text-align: center;
        font-size: 9pt;
        margin-top: 1cm;
        padding-top: 0.5cm;
        border-top: 1pt solid #000;
    }
    
    /* Improve table styling */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin-bottom: 1cm !important;
    }
    
    th, td {
        padding: 0.25cm !important;
        text-align: left !important;
        border-bottom: 0.5pt solid #ccc !important;
    }
    
    th {
        font-weight: bold !important;
        border-bottom: 1pt solid #000 !important;
    }
    
    /* Improve chart visibility */
    canvas {
        max-width: 100% !important;
        height: auto !important;
        margin: 0.5cm 0 !important;
        border: 0.5pt solid #ccc !important;
        page-break-inside: avoid !important;
    }
    
    /* Ensure good spacing for result sections */
    .payment-summary,
    .payment-details,
    .loan-summary,
    .result-summary,
    .result-details {
        margin-bottom: 0.5cm !important;
        page-break-inside: avoid !important;
    }
    
    /* Make labels stand out */
    .payment-label,
    .detail-label,
    .summary-label,
    .result-label {
        font-weight: bold !important;
        color: #000 !important;
    }
    
    /* Emphasize important values */
    .payment-value,
    .detail-value,
    .summary-value,
    .result-value,
    .total-payment {
        font-weight: bold !important;
        color: #000 !important;
    }
    
    /* Add page breaks where needed */
    h2, h3 {
        page-break-after: avoid !important;
    }
    
    /* Remove background colors and use borders instead */
    .card,
    .payment-detail,
    .summary-item,
    .result-item {
        background: none !important;
        border: 0.5pt solid #ccc !important;
        padding: 0.25cm !important;
        margin-bottom: 0.25cm !important;
        page-break-inside: avoid !important;
    }
    
    /* Adjust grid layouts for print */
    .row, 
    .grid,
    .payment-details,
    .loan-summary {
        display: block !important;
        width: 100% !important;
    }
    
    .col-12, 
    .col-md-6, 
    .col-lg-4,
    .payment-detail,
    .summary-item {
        display: block !important;
        width: 100% !important;
        float: none !important;
        margin-bottom: 0.5cm !important;
    }
    
    /* Add date stamp */
    .calculator-result::before {
        content: "Printed on " attr(data-print-date);
        display: block;
        text-align: right;
        font-size: 9pt;
        margin-bottom: 0.5cm;
        color: #666;
    }
}
