/**
 * Copyright (c) 2025-2026 1ai.dev
 * Developed with ❤️ by A.K.Mishra
 * 
 * This file is part of the Travelling Buddies project.
 * See LICENSE file for license information.
 */
/**
 * Travelling Buddies - Print Styles
 * Professional PDF export for trip itineraries
 * 
 * @package TravellingBuddies
 * @version 2.0.0
 */

@media print {
    /* ============================================
       PAGE SETUP
       ============================================ */
    @page {
        size: A4;
        margin: 1.5cm 1.5cm 2cm 1.5cm;
    }
    
    @page :first {
        margin-top: 0;
    }
    
    /* ============================================
       HIDE UI ELEMENTS
       ============================================ */
    .sidebar, 
    .navbar, 
    .footer, 
    .btn:not(.no-print-hide), 
    .nav-tabs, 
    .breadcrumb, 
    .trip-price-box,
    .sidebar-cta,
    .modal,
    .dropdown-menu,
    .alert,
    .toast,
    .no-print,
    #alertsDropdown,
    #messagesDropdown,
    .navbar-nav,
    .sidebar-toggle,
    .register-btn,
    .action-buttons,
    [data-bs-toggle],
    form,
    .card-footer {
        display: none !important;
    }

    /* ============================================
       RESET LAYOUT
       ============================================ */
    html, body {
        width: 100% !important;
        height: auto !important;
        font-size: 11pt !important;
        line-height: 1.5 !important;
        color: #000 !important;
        background: #fff !important;
    }
    
    body {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .wrapper, .main, .content, .container-fluid {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .main {
        margin-left: 0 !important;
    }
    
    .row {
        display: block !important;
        margin: 0 !important;
    }
    
    .col-12, .col-lg-8, .col-md-8, .col-lg-4, .col-md-4,
    [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        padding: 0 !important;
        margin: 0 0 1rem 0 !important;
    }

    /* ============================================
       ENSURE BACKGROUND GRAPHICS PRINT
       ============================================ */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    /* ============================================
       TYPOGRAPHY
       ============================================ */
    h1 { font-size: 24pt !important; margin-bottom: 0.5cm !important; }
    h2 { font-size: 18pt !important; margin-bottom: 0.4cm !important; }
    h3 { font-size: 14pt !important; margin-bottom: 0.3cm !important; }
    h4 { font-size: 12pt !important; margin-bottom: 0.2cm !important; }
    h5, h6 { font-size: 11pt !important; margin-bottom: 0.2cm !important; }
    
    p, li, td, th {
        font-size: 10pt !important;
        orphans: 3;
        widows: 3;
    }
    
    a {
        color: #000 !important;
        text-decoration: none !important;
    }
    
    a[href]::after {
        content: none !important; /* Don't print URLs after links */
    }

    /* ============================================
       HEADER / COVER IMAGE
       ============================================ */
    .trip-cover-image {
        height: 180px !important;
        margin: 0 0 1cm 0 !important;
        border-radius: 8px !important;
        overflow: hidden !important;
        page-break-inside: avoid !important;
    }
    
    .trip-cover-overlay {
        background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%) !important;
    }
    
    .trip-header h1 {
        color: #fff !important;
        text-shadow: 1px 1px 2px rgba(0,0,0,0.5) !important;
        font-size: 22pt !important;
    }
    
    .trip-meta {
        margin-top: 0.5cm !important;
    }
    
    .trip-meta span, .trip-meta .badge {
        background: #fff !important;
        color: #333 !important;
        border: 1px solid #ccc !important;
        padding: 4px 10px !important;
        font-size: 9pt !important;
        display: inline-block !important;
        margin-right: 8px !important;
        margin-bottom: 4px !important;
        border-radius: 4px !important;
    }

    /* ============================================
       CARDS
       ============================================ */
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        margin-bottom: 0.8cm !important;
        page-break-inside: avoid !important;
        background: #fff !important;
    }
    
    .card-header {
        display: block !important;
        background: #f8f9fa !important;
        border-bottom: 1px solid #ddd !important;
        padding: 0.3cm 0.5cm !important;
    }
    
    .card-header h5, .card-header .card-title {
        font-size: 12pt !important;
        margin: 0 !important;
        color: #333 !important;
    }
    
    .card-body {
        padding: 0.5cm !important;
    }

    /* ============================================
       TABS - SHOW ALL CONTENT
       ============================================ */
    .tab-content > .tab-pane {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        height: auto !important;
    }
    
    .tab-pane::before {
        content: attr(aria-labelledby) !important;
        display: block !important;
        font-weight: bold !important;
        font-size: 14pt !important;
        margin-bottom: 0.5cm !important;
        padding-bottom: 0.2cm !important;
        border-bottom: 2px solid #264653 !important;
        color: #264653 !important;
    }
    
    #overview::before { content: "Overview" !important; }
    #itinerary::before { content: "Detailed Itinerary" !important; }
    #participants::before { content: "Participants" !important; }

    /* ============================================
       ITINERARY TIMELINE
       ============================================ */
    .timeline-item, .itinerary-day {
        page-break-inside: avoid !important;
        margin-bottom: 0.6cm !important;
        padding: 0.4cm !important;
        border-left: 3px solid #264653 !important;
        background: #f9f9f9 !important;
    }
    
    .day-number, .timeline-date {
        font-weight: bold !important;
        color: #264653 !important;
        font-size: 11pt !important;
    }

    /* ============================================
       TABLES
       ============================================ */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 9pt !important;
        page-break-inside: avoid !important;
    }
    
    th, td {
        border: 1px solid #ddd !important;
        padding: 6px 8px !important;
        text-align: left !important;
    }
    
    th {
        background: #f5f5f5 !important;
        font-weight: 600 !important;
    }
    
    tr:nth-child(even) {
        background: #fafafa !important;
    }

    /* ============================================
       IMAGES
       ============================================ */
    img {
        max-width: 100% !important;
        height: auto !important;
        page-break-inside: avoid !important;
    }
    
    .avatar, .rounded-circle {
        width: 30px !important;
        height: 30px !important;
    }

    /* ============================================
       PAGE BREAKS
       ============================================ */
    h1, h2, h3, h4 {
        page-break-after: avoid !important;
    }
    
    .page-break-before {
        page-break-before: always !important;
    }
    
    .no-page-break {
        page-break-inside: avoid !important;
    }

    /* ============================================
       WATERMARK (Subtle)
       ============================================ */
    body::before {
        content: "Travelling Buddies";
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) rotate(-30deg);
        font-size: 8rem;
        font-weight: 700;
        color: rgba(38, 70, 83, 0.03);
        z-index: -1;
        white-space: nowrap;
        pointer-events: none;
        letter-spacing: 0.5rem;
    }

    /* ============================================
       FOOTER COPYRIGHT
       ============================================ */
    body::after {
        content: "© " attr(data-year) " Travelling Buddies | " attr(data-url) " | Printed: " attr(data-print-date);
        position: fixed;
        bottom: 0.5cm;
        left: 50%;
        transform: translateX(-50%);
        font-size: 8pt;
        color: #888;
        text-align: center;
        width: 100%;
        padding: 0 1cm;
        box-sizing: border-box;
    }

    /* ============================================
       GREEN SCORE BOX
       ============================================ */
    .green-score-circle {
        width: 60px !important;
        height: 60px !important;
    }
    
    .eco-badge, .green-score {
        background: #2A9D8F !important;
        color: #fff !important;
        padding: 4px 10px !important;
        border-radius: 4px !important;
        display: inline-block !important;
    }

    /* ============================================
       LISTS
       ============================================ */
    ul, ol {
        padding-left: 1.2cm !important;
        margin-bottom: 0.4cm !important;
    }
    
    li {
        margin-bottom: 0.1cm !important;
    }

    /* ============================================
       SPECIAL PRINT SECTIONS
       ============================================ */
    .print-header {
        display: block !important;
        text-align: center !important;
        padding: 0.5cm 0 !important;
        border-bottom: 2px solid #264653 !important;
        margin-bottom: 1cm !important;
    }
    
    .print-logo {
        max-height: 50px !important;
        margin-bottom: 0.3cm !important;
    }
    
    .print-title {
        font-size: 20pt !important;
        color: #264653 !important;
        margin: 0 !important;
    }
    
    .print-subtitle {
        font-size: 11pt !important;
        color: #666 !important;
        margin: 0.2cm 0 0 0 !important;
    }

    /* ============================================
       UTILITY CLASSES
       ============================================ */
    .print-only {
        display: block !important;
    }
    
    .screen-only {
        display: none !important;
    }
    
    .badge {
        padding: 3px 8px !important;
        font-size: 8pt !important;
        border-radius: 3px !important;
    }
    
    .badge-primary, .bg-primary {
        background: #264653 !important;
        color: #fff !important;
    }
    
    .badge-success, .bg-success {
        background: #2A9D8F !important;
        color: #fff !important;
    }
    
    .badge-warning, .bg-warning {
        background: #E9C46A !important;
        color: #333 !important;
    }
    
    .badge-danger, .bg-danger {
        background: #E76F51 !important;
        color: #fff !important;
    }
}

/* Print-only content (hidden on screen) */
.print-only {
    display: none;
}

/* Screen-only content marker */
.screen-only {
    /* visible by default */
}
