/* =========================
   Print Styles
========================= */
@media print {
    .print-hide {
        display: none !important;
    }

    @page {
        size: auto;
        margin: 0.4in;
    }

    html,
    body {
        background: #ffffff !important;
        color: #000000 !important;
        height: auto !important;
    }

    body {
        margin: 0;
        padding: 0;
        font-size: 10.5pt;
        line-height: 1.35;
    }

    /* Hide everything first */
    body * {
        visibility: hidden;
    }

    /* Show quote results */
    #quoteResults,
    #quoteResults * {
        visibility: visible;
    }

    /* Position printable area at the top */
    #quoteResults {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        background: #ffffff !important;
    }

    /* Hide page elements not needed in print */
    header,
    nav,
    footer,
    form,
    .quote-actions,
    #savedQuotesSection,
    .navbar,
    .btn,
    #getAnotherQuoteBtn,
    #saveQuoteBtn,
    #printQuoteBtn {
        display: none !important;
    }

    /* Show print branding */
    .print-only {
        display: block !important;
    }

    .print-branding {
        text-align: center;
        margin-bottom: 0.75rem;
        border-bottom: 1px solid #000;
        padding-bottom: 0.35rem;
    }

    .print-branding h1 {
        font-size: 18pt;
        margin: 0 0 0.15rem;
        color: #000 !important;
    }

    .print-branding p {
        margin: 0;
        font-size: 10pt;
        color: #000 !important;
    }

    /* Tighten the results section spacing */
    .quote-results-section {
        padding: 0 !important;
        margin: 0 !important;
    }

    .quote-results-section .text-center.mb-4 {
        margin-bottom: 0.5rem !important;
    }

    .quote-results-section h2 {
        font-size: 16pt !important;
        margin-bottom: 0.35rem !important;
        color: #000 !important;
    }

    /* Remove shadows/background effects */
    .quote-summary-card,
    .premium-box,
    .quote-breakdown-table,
    .quote-breakdown-wrapper,
    .card,
    .card-body {
        background: #ffffff !important;
        color: #000000 !important;
        box-shadow: none !important;
        border-color: #000000 !important;
    }

    .quote-summary-card {
        margin-bottom: 0.75rem !important;
    }

    .quote-summary-header {
        background: #ffffff !important;
        color: #000000 !important;
        border-bottom: 1px solid #000 !important;
        font-size: 12pt !important;
        padding: 0.35rem 0.5rem !important;
    }

    .quote-summary-card .card-body {
        padding: 0.75rem !important;
    }

    .quote-summary-card p {
        margin-bottom: 0.35rem !important;
        font-size: 10pt !important;
        color: #000 !important;
    }

    /* Make premium boxes more compact */
    .premium-box {
        padding: 0.75rem 0.5rem !important;
        border: 1px solid #000 !important;
        min-height: auto !important;
    }

    .premium-label {
        font-size: 9pt !important;
        margin-bottom: 0.2rem !important;
        color: #000 !important;
    }

    .premium-amount,
    .premium-monthly,
    .premium-annual {
        font-size: 18pt !important;
        font-weight: 700;
        color: #000 !important;
    }

    /* Reduce row spacing */
    .quote-summary-card .row.g-3 {
        --bs-gutter-x: 0.75rem;
        --bs-gutter-y: 0.5rem;
    }

    /* Breakdown heading */
    .quote-breakdown-wrapper {
        margin-top: 0.5rem !important;
    }

    .quote-breakdown-wrapper h3 {
        font-size: 12pt !important;
        margin-bottom: 0.35rem !important;
        color: #000 !important;
    }

    /* Compact table */
    .table-responsive {
        overflow: visible !important;
    }

    .quote-breakdown-table {
        width: 100% !important;
        margin-bottom: 0 !important;
        font-size: 9pt !important;
        table-layout: fixed;
    }

    .quote-breakdown-table thead th {
        background: #eeeeee !important;
        color: #000 !important;
        border: 1px solid #000 !important;
        padding: 0.3rem 0.35rem !important;
        font-size: 9pt !important;
    }

    .quote-breakdown-table tbody td {
        background: #ffffff !important;
        color: #000 !important;
        border: 1px solid #000 !important;
        padding: 0.28rem 0.35rem !important;
        font-size: 8.75pt !important;
        vertical-align: top;
        word-wrap: break-word;
    }

    /* Force all text black */
    p,
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    td,
    th,
    span,
    strong,
    div {
        color: #000 !important;
    }

    /* Keep summary + table together when possible */
    .quote-summary-card,
    .quote-breakdown-wrapper,
    .quote-breakdown-table,
    .quote-breakdown-table tbody,
    .quote-breakdown-table tr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
}