/* Print Styles for Listing Detail Pages */

/* Hide print-only elements on screen */
.print-only,
.listing-agents-print {
    display: none !important;
}

@media print {
    /* Hide elements not needed in print */
    .no-print,
    nav,
    header,
    footer,
    .navbar,
    .btn,
    button,
    .contact-form,
    .social-share,
    .navigation-links,
    #map,
    .swiper-button-next,
    .swiper-button-prev,
    .swiper-pagination {
        display: none !important;
    }
    
    /* Show print-only elements */
    .print-only,
    .listing-agents-print {
        display: block !important;
    }
    
    /* Allow multi-page printing */
    @page {
        size: letter;
        margin: 0.5in;
    }
    
    /* Reset page styling for print */
    * {
        box-sizing: border-box !important;
        max-width: 100% !important;
    }
    
    html, body {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
    }
    
    body {
        font-size: 9pt;
        line-height: 1.2;
        color: #000;
        background: #fff;
    }
    
    /* Main container - allow overflow to next pages */
    .page-size,
    .container,
    .container-lg,
    .container-fluid {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
    }
    
    .row {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .col-12, .col-lg-7, .col-lg-5, .col, .col-md-6, .col-md-4, .col-sm-12,
    [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        flex: 0 0 100% !important;
    }
    
    /* Listing header - compact */
    .listing-header {
        margin-bottom: 5px;
        padding-bottom: 3px;
        border-bottom: 2px solid #000;
    }
    
    .listing-address {
        font-size: 16pt;
        font-weight: bold;
        margin: 0 0 2px 0;
        line-height: 1.1;
    }
    
    .listing-header .text-muted {
        font-size: 10pt;
        color: #333 !important;
        margin: 0;
    }
    
    .listing-price {
        font-size: 14pt;
        color: #000;
        font-weight: bold;
        margin: 3px 0;
    }
    
    /* Images - smaller to save space */
    .listing-images {
        margin: 5px 0 !important;
        padding: 0 !important;
        display: block !important;
        width: 100% !important;
    }
    
    .swiper-container,
    .swiper-wrapper,
    .swiper-slide {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        position: static !important;
    }
    
    .listing-images img,
    .swiper-slide img,
    .detail-img {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 250px !important;
        height: auto !important;
        object-fit: cover;
        display: block !important;
        margin: 0 0 5px 0;
        border: 1px solid #ccc;
    }
    
    /* Show only first image */
    .swiper-slide:nth-child(n+2) {
        display: none !important;
    }
    
    /* Property Overview - compact grid */
    h5 {
        font-size: 10pt;
        font-weight: bold;
        margin: 5px 0 3px 0;
        border-bottom: 1px solid #666;
        padding-bottom: 2px;
    }
    
    .d-flex.gap-4 {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 3px !important;
        margin: 3px 0 !important;
    }
    
    .text-detail {
        font-size: 8pt;
        padding: 2px;
        border: 1px solid #ddd;
        background: #f9f9f9;
    }
    
    .text-detail i {
        margin-right: 3px;
    }
    
    /* Description - compact */
    .listing-description,
    .fade-in-up > p,
    .fade-in-up > h3 {
        margin: 4px 0 !important;
        font-size: 8pt;
        line-height: 1.2;
    }
    
    .listing-description h3,
    h3 {
        font-size: 10pt;
        margin: 5px 0 2px 0 !important;
        border-bottom: 1px solid #666;
        padding-bottom: 1px;
    }
    
    /* Features list - compact */
    ul {
        margin: 3px 0 !important;
        padding-left: 12px !important;
    }
    
    ul li {
        font-size: 8pt !important;
        line-height: 1.1;
        margin-bottom: 1px;
    }
    
    /* Price section */
    .price-section,
    .col-lg-5 {
        margin-top: 5px;
        padding: 5px !important;
        background: #f5f5f5;
    }
    
    .price-section h3 {
        font-size: 11pt;
        margin: 0 0 3px 0 !important;
    }
    
    .price-section .fs-1 {
        font-size: 14pt !important;
    }
    
    /* Contact info box at bottom */
    .contact-info {
        margin-top: 10px;
        padding: 8px;
        border: 2px solid #000;
        background: #f9f9f9;
        page-break-inside: avoid;
    }
    
    .contact-info h3 {
        font-size: 12pt;
        margin: 0 0 5px 0 !important;
        border: none;
    }
    
    .contact-info p {
        margin: 2px 0;
        font-size: 10pt;
    }
    
    /* Listing agents section - compact styling */
    .listing-agents-print {
        margin-top: 10px !important;
        page-break-inside: avoid !important;
    }
    
    .listing-agents-print h3 {
        font-size: 10pt;
        font-weight: bold;
        margin: 8px 0 6px 0 !important;
        border-bottom: 2px solid #000;
        padding-bottom: 3px;
    }
    
    .listing-agents-print .row {
        display: flex !important;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .listing-agents-print .col {
        width: calc(50% - 5px) !important;
        margin: 0 !important;
    }
    
    .listing-agents-print .team-card {
        page-break-inside: avoid;
    }
    
    .listing-agents-print .img-team-wrapper img {
        max-height: 100px !important;
        width: auto !important;
        max-width: 100%;
        object-fit: cover;
        border: 1px solid #ccc;
    }
    
    .listing-agents-print h4 {
        font-size: 9pt;
        margin: 5px 0 3px 0 !important;
        padding-bottom: 3px !important;
        border-bottom: 1px solid #ccc;
    }
    
    .listing-agents-print p {
        font-size: 7pt;
        margin: 2px 0 !important;
        line-height: 1.2;
    }
    
    /* Remove all page breaks to force single page */
    * {
        page-break-before: auto !important;
        page-break-after: auto !important;
        page-break-inside: auto !important;
    }
    
    /* Compact everything that might cause overflow */
    .my-4, .my-5, .py-4, .py-5 {
        margin-top: 3px !important;
        margin-bottom: 3px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
    
    .mb-3, .mb-4, .mb-5 {
        margin-bottom: 3px !important;
    }
    
    .mt-3, .mt-4, .mt-5 {
        margin-top: 3px !important;
    }
    
    /* Links - show as plain text */
    a {
        text-decoration: none;
        color: #000;
    }
    
    /* Don't show URLs */
    a[href]:after {
        content: none;
    }
    
    /* Hide extra spacing elements */
    .bg-secondary-lighter {
        background: #fff !important;
        padding: 0 !important;
    }
    
    /* Table/grid layouts */
    table {
        font-size: 9pt;
        width: 100%;
    }
    
    /* Ensure single column on print */
    .fade-in-up {
        -webkit-column-break-inside: avoid;
        page-break-inside: avoid;
        break-inside: avoid;
    }
}

/* Print button styling (shown on screen, hidden in print) */
.print-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s;
}

.print-button:hover {
    background-color: #0056b3;
}

.print-button i {
    margin-right: 8px;
}

@media print {
    .print-button {
        display: none !important;
    }
}
