/**
 * Print Styles - Comprehensive A4 Print Support
 * Optimized for GIGW compliance and proper A4 paper printing
 * This file contains all print-related CSS for the application
 */

@media print {
    /* CSS loading confirmed - test removed */
    
    /* ===========================================
       A4 PAGE SETUP - GIGW COMPLIANT
    =========================================== */
    @page {
        size: A4;
        margin: 1.2cm 1.2cm 1.2cm 1.2cm; /* Reduced bottom margin since no footer */
    }
    
    /* Initialize page counter */
    body {
        counter-reset: page 1;
    }
    
    /* ===========================================
       RESET AND BASE SETUP
    =========================================== */
    * {
        box-sizing: border-box;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    html, body {
        height: auto !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 11pt !important;
        line-height: 1.3 !important;
        color: #000 !important;
        background: #fff !important;
        font-family: "Times New Roman", Times, serif !important;
        width: 100% !important;
        max-width: none !important;
    }
    
    /* ===========================================
       HIDE NON-ESSENTIAL ELEMENTS - MORE SELECTIVE
    =========================================== */
    /* Hide page header H1 to avoid duplication with company header */
    .page-header .page-title,
    .page-header h1 {
        display: none !important;
    }
    
    /* ===========================================
       COMPLETELY REMOVE NAVIGATION AND LAYOUT ELEMENTS
    =========================================== */
    /* Hide and remove from layout flow - ALL navigation elements EXCEPT brand and page nav in print */
    .navbar-nav,
    .navbar-toggler,
    .navbar-expand-xl,
    .navbar-static,
    .navbar-bg-img,
    .navbar-dark,
    .navbar-sm,
    .navbar-xs,
    .nav:not(.nav-scrollspy),
    .nav-item:not(.nav-scrollspy-wrapper .nav-item),
    .nav-link:not(.nav-scrollspy-wrapper .nav-link),
    .navbar-nav .nav-link,
    .navbar-nav .dropdown-menu,
    .navbar-nav .dropdown-item,
    .navbar-nav .dropdown-toggle,
    .navbar-nav .dropdown,
    .navbar-nav .navbar-nav,
    .navbar-nav .navbar-brand,
    .navbar-nav .navbar-toggler,
    .navbar-nav .navbar-expand-xl,
    .navbar-nav .navbar-static,
    .navbar-nav .navbar-bg-img,
    .navbar-nav .navbar-dark,
    .navbar-nav .navbar-sm,
    .navbar-nav .navbar-xs,
    /* Hide ALL sidebar elements */
    .sidebar,
    .sidebar-lg,
    .sidebar-main,
    .sidebar-expand-xl,
    .sidebar-section,
    .sidebar-section-body,
    .sidebar-content,
    .sidebar-resize-hide,
    .sidebar-control,
    .sidebar-mobile-main-toggle,
    .sidebar-nav,
    .sidebar-nav-item,
    .sidebar-nav-link,
    .sidebar-nav .nav-link,
    .sidebar-nav .dropdown-menu,
    .sidebar-nav .dropdown-item,
    .sidebar-nav .dropdown-toggle,
    .sidebar-nav .dropdown,
    /* Hide topbar elements */
    .topbar,
    .topbar-top,
    .topbar-info,
    .topbar-icon,
    .topbar-controls,
    .container-fluid.topbar-top,
    /* Hide ALL footer elements */
    .navbar-footer,
    #footContent,
    footer,
    .footer,
    .footer-content,
    .footer-nav,
    .footer-nav-item,
    .footer-nav-link,
    /* Hide ALL page header elements */
    .page-header,
    .page-header-content,
    .page-title,
    .page-header .page-title,
    .page-header h1,
    .page-header .navbar,
    .page-header .nav,
    .page-header .navbar-nav,
    .page-header .navbar-brand,
    .page-header .navbar-toggler,
    .page-header .navbar-expand-xl,
    .page-header .navbar-static,
    .page-header .navbar-bg-img,
    .page-header .navbar-dark,
    .page-header .navbar-sm,
    .page-header .navbar-xs,
    /* Hide ALL interactive elements */
    .btn,
    .modal,
    .dropdown,
    .tooltip,
    .popover,
    .alert,
    .badge,
    .progress,
    .carousel,
    .accordion-collapse:not(.show),
    .breadcrumb,
    .pagination,
    .form-control,
    .input-group,
    .btn-group,
    form[data-bs-toggle="search"],
    .fixed-top,
    .fixed-bottom,
    .sticky-top,
    .external-link-icon,
    [data-bs-toggle="modal"],
    [data-action="print-page"],
    .interactive,
    .clickable,
    .d-print-none,
    /* Hide cookie settings button and all cookie consent elements */
    #cookieSettingsBtn,
    .cookie-settings-btn,
    #cookie-banner,
    .cc-container,
    .cc-text,
    .cc-actions,
    .cc-btn,
    #cookie-preferences,
    .cc-panel,
    .cc-header,
    .cc-body,
    .cc-row,
    .cc-toggle,
    .cc-footer,
    /* Hide ALL script content */
    script,
    script *,
    .content script,
    .content-inner script,
    .content-wrapper script,
    /* Hide the print title data div on screen */
    .print-title-data {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        width: 0 !important;
        overflow: hidden !important;
        position: absolute !important;
        left: -9999px !important;
        top: -9999px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        background: none !important;
        box-shadow: none !important;
        transform: none !important;
        clip: rect(0, 0, 0, 0) !important;
        clip-path: inset(50%) !important;
    }
    
    /* ===========================================
       SHOW PRINT-ONLY ELEMENTS
    =========================================== */
    .d-print-block,
    .d-print-inline,
    .d-print-inline-block {
        display: block !important;
    }
    
    .d-print-inline {
        display: inline !important;
    }
    
    .d-print-inline-block {
        display: inline-block !important;
    }
    
    /* Show the print title data div in print */
    .print-title-data {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        margin: 0 !important;
        margin-bottom: 0.05em !important; /* Ultra minimal space */
        padding: 0 !important;
        height: auto !important;
        width: 100% !important;
        overflow: visible !important;
        left: auto !important;
        top: 0 !important;
        right: auto !important;
        bottom: auto !important;
        page-break-after: avoid !important;
        z-index: 1 !important;
        clip: auto !important;
        clip-path: none !important;
        transform: none !important;
    }
    
    /* ===========================================
       SHOW PRINT-ONLY ELEMENTS
    =========================================== */
    .d-print-block,
    .d-print-inline,
    .d-print-inline-block {
        display: block !important;
    }
    
    .d-print-inline {
        display: inline !important;
    }
    
    .d-print-inline-block {
        display: inline-block !important;
    }
    
            /* ===========================================
       LAYOUT CONTAINERS - FORCE CONTENT TO TOP
    =========================================== */
    /* Remove ALL layout containers that might push content down */
    .container,
    .container-fluid,
    .content-wrapper,
    .content-inner,
    .content,
    .page-content,
    .main-content,
    .main-wrapper,
    .page-wrapper,
    .app-wrapper,
    .app-content,
    .app-main,
    .app-body,
    .app-container,
    .app-layout,
    .app-layout-main,
    .app-layout-content,
    .app-layout-body,
    .app-layout-container,
    .app-layout-wrapper,
    .app-layout-inner,
    .app-layout-outer,
    .app-layout-header,
    .app-layout-sidebar,
    .app-layout-footer,
    .app-layout-main-content,
    .app-layout-main-body,
    .app-layout-main-container,
    .app-layout-main-wrapper,
    .app-layout-main-inner,
    .app-layout-main-outer {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        display: block !important;
        height: auto !important;
        position: static !important;
        left: auto !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        flex: none !important;
        transform: none !important;
        box-shadow: none !important;
        border: none !important;
        background: none !important;
        z-index: auto !important;
    }
    
    /* Force content to start at the very top of the page */
    body > *:first-child,
    html > body > *:first-child {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* Allow main content containers to break across pages */
    .mx-lg-n4,
    .content,
    .main-content {
        page-break-inside: auto !important;
        break-inside: auto !important;
    }
    
    /* Override height constraints in print mode */
    .h-100,
    .h-auto {
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
    }
    
    /* Override flex alignment constraints in print */
    .align-items-stretch {
        align-items: flex-start !important;
    }
    
    /* Ensure content starts immediately after print header */
    .content:first-child,
    .content-inner:first-child,
    .content-wrapper:first-child,
    .page-content:first-child {
        margin-top: 0 !important;
        padding-top: 0 !important;
        position: static !important;
        top: 0 !important;
    }
    
    /* ===========================================
       BOOTSTRAP GRID SYSTEM
    =========================================== */
    .row {
        display: flex !important;
        flex-wrap: wrap !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
        width: 100% !important;
        overflow: visible !important;
    }
    
    /* All column classes with comprehensive coverage */
    .col,
    .col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12,
    .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12,
    .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12,
    .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12,
    .col-xl-1, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-10, .col-xl-11, .col-xl-12,
    .col-xxl-1, .col-xxl-2, .col-xxl-3, .col-xxl-4, .col-xxl-5, .col-xxl-6, .col-xxl-7, .col-xxl-8, .col-xxl-9, .col-xxl-10, .col-xxl-11, .col-xxl-12 {
        position: relative !important;
        width: 100% !important;
        padding-right: 10px !important;
        padding-left: 10px !important;
        flex: 0 0 auto !important;
        overflow: visible !important;
    }
    
    /* Specific column widths for all breakpoints */
    .col-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xl-1, .col-xxl-1 { flex: 0 0 8.333333% !important; max-width: 8.333333% !important; width: 8.333333% !important; }
    .col-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xl-2, .col-xxl-2 { flex: 0 0 16.666667% !important; max-width: 16.666667% !important; width: 16.666667% !important; }
    .col-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xl-3, .col-xxl-3 { flex: 0 0 25% !important; max-width: 25% !important; width: 25% !important; }
    .col-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xl-4, .col-xxl-4 { flex: 0 0 33.333333% !important; max-width: 33.333333% !important; width: 33.333333% !important; }
    .col-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xl-5, .col-xxl-5 { flex: 0 0 41.666667% !important; max-width: 41.666667% !important; width: 41.666667% !important; }
    .col-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xl-6, .col-xxl-6 { flex: 0 0 50% !important; max-width: 50% !important; width: 50% !important; }
    .col-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xl-7, .col-xxl-7 { flex: 0 0 58.333333% !important; max-width: 58.333333% !important; width: 58.333333% !important; }
    .col-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xl-8, .col-xxl-8 { flex: 0 0 66.666667% !important; max-width: 66.666667% !important; width: 66.666667% !important; }
    .col-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xl-9, .col-xxl-9 { flex: 0 0 75% !important; max-width: 75% !important; width: 75% !important; }
    .col-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xl-10, .col-xxl-10 { flex: 0 0 83.333333% !important; max-width: 83.333333% !important; width: 83.333333% !important; }
    .col-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xl-11, .col-xxl-11 { flex: 0 0 91.666667% !important; max-width: 91.666667% !important; width: 91.666667% !important; }
    .col-12, .col-sm-12, .col-md-12, .col-lg-12, .col-xl-12, .col-xxl-12 { flex: 0 0 100% !important; max-width: 100% !important; width: 100% !important; }
    
    /* ===========================================
       TYPOGRAPHY - A4 OPTIMIZED
    =========================================== */
    h1, h2, h3, h4, h5, h6 {
        color: #000 !important;
        page-break-after: avoid;
        margin-top: 0.5em !important;
        margin-bottom: 0.3em !important;
        font-weight: bold !important;
    }
    
    h1 { 
        font-size: 16pt !important; 
        text-align: center !important;
        margin-bottom: 0.5em !important;
    }
    h2 { 
        font-size: 14pt !important; 
        border-bottom: none !important;
        padding-bottom: 0 !important;
    }
    h3 { font-size: 12pt !important; }
    h4, h5, h6 { font-size: 11pt !important; }
    
    p {
        margin: 0.3em 0 !important;
        line-height: 1.4 !important;
        text-align: justify !important;
        orphans: 3 !important;
        widows: 3 !important;
    }
    
    /* Ensure proper spacing for lists */
    ul, ol {
        margin: 0.5em 0 !important;
        padding-left: 1em !important;
    }
    
    li {
        margin: 0.2em 0 !important;
        line-height: 1.3 !important;
    }
    
    /* ===========================================
       SWIPER/CAROUSEL IN PRINT - Show all slides
    =========================================== */
    /* Show Swiper container and make it display all slides */
    .swiper,
    .product-slideshow {
        display: block !important;
        visibility: visible !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    /* Show wrapper and make it display all slides stacked */
    .swiper-wrapper {
        display: block !important;
        visibility: visible !important;
        transform: none !important;
        height: auto !important;
        width: 100% !important;
    }
    
    /* Show all slides stacked vertically */
    .swiper-slide {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        height: auto !important;
        margin-bottom: 1em !important;
        page-break-inside: avoid !important;
        transform: none !important;
        position: relative !important;
    }
    
    /* Hide navigation buttons and pagination in print */
    .swiper-pagination,
    .swiper-button-prev,
    .swiper-button-next {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* Show slide content (images, captions, etc.) */
    .swiper-slide img,
    .swiper-slide .slideshow-image {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        max-width: 100% !important;
        height: auto !important;
        margin: 0 auto !important;
    }
    
    /* Show slide captions and text */
    .swiper-slide .slideshow-caption,
    .swiper-slide .carousel-caption,
    .swiper-slide .slideshow-title,
    .swiper-slide .slideshow-description {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        text-align: center !important;
        color: #000 !important;
        background: transparent !important;
        padding: 0.5em 0 !important;
    }
    
    /* Show buttons in slides */
    .swiper-slide .btn {
        display: inline-block !important;
        visibility: visible !important;
    }
    
    /* ===========================================
       LINKS AND IMAGES - FIXED
    =========================================== */
    /* Hide URLs for all links in print - WCAG compliant as link text should be descriptive */
    a[href]:after {
        content: "" !important;
    }
    
    
    /* Image handling - ENSURE IMAGES ARE VISIBLE */
    img {
        max-width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
        object-position: center !important;
        page-break-inside: avoid;
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        border: none !important;
    }
    
    /* Force all images to be visible - simple and direct */
    img,
    .card img,
    .card-body img,
    .col-4 img,
    a[data-bs-popup="lightbox"] img {
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Prevent image distortion */
    .rounded-3 img,
    .card img,
    .ratio img {
        max-width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
        object-position: center !important;
        display: inline-block !important; /* Changed to inline-block */
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Force all images in content to be visible */
    .content img,
    .content-inner img,
    .content-wrapper img {
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Specific image fixes for the content structure */
    .card img,
    .rounded-3 img,
    .position-relative img,
    .h-100 img,
    .w-100 img {
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        max-width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
        object-position: center !important;
    }
    
    /* Fix for specific image classes in your content */
    .card-body img,
    .card-body .rounded-3,
    .card-body .position-relative,
    .card-body .h-100,
    .card-body .w-100 {
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* COMPREHENSIVE IMAGE FORCING - Force ALL images to show */
    img,
    img[src*="uploadFiles"],
    img[src*="products"],
    img[src*="photos"],
    img[src*="DSC_"],
    .card img,
    .card-body img,
    .col-4 img,
    .rounded-3 img,
    .position-relative img,
    .h-100 img,
    .w-100 img,
    img.rounded-3,
    img.position-relative,
    img.h-100,
    img.w-100 {
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        max-width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
        object-position: center !important;
        border: none !important;
        position: relative !important;
        left: auto !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        overflow: visible !important;
        clip: auto !important;
        clip-path: none !important;
        transform: none !important;
        filter: none !important;
        page-break-inside: avoid !important;
    }
    
    /* ===========================================
       TABLES
    =========================================== */
    .table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin: 1em 0 !important;
        page-break-inside: avoid;
    }
    
    .table th,
    .table td {
        border: 1px solid #000 !important;
        padding: 0.5em !important;
        text-align: left !important;
        vertical-align: top !important;
    }
    
    .table th {
        background-color: #f0f0f0 !important;
        font-weight: bold !important;
    }
    
    /* ===========================================
       CARDS AND COMPONENTS
    =========================================== */
    .card {
        border: 1px solid #000 !important;
        margin: 0.2em 0 !important;
        padding: 0.3em !important;
        background: #fff !important;
        box-shadow: none !important;
        height: auto !important;
        page-break-inside: auto;
        break-inside: auto;
        overflow: visible !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .card-header {
        background: #f0f0f0 !important;
        border: none !important;
        padding: 0.3em !important;
        margin: 0 !important;
    }
    
    /* Respect border-bottom-0 class in print */
    .card-header.border-bottom-0 {
        border-bottom: none !important;
    }
    
    /* Preserve border-top for dividers between sections */
    .card-header.border-top,
    .card-header.border-top.border-300,
    .card-header.border-top.border-300.border-bottom-0 {
        border-top: 1px solid #000 !important;
        border-top-color: #000 !important;
        border-top-style: solid !important;
        border-top-width: 1px !important;
    }
    
    /* Override Bootstrap border color classes in print */
    .border-300,
    .border-primary,
    .border-secondary,
    .border-success,
    .border-danger,
    .border-warning,
    .border-info,
    .border-light,
    .border-dark {
        border-color: #000 !important;
    }
    
    .card-body {
        padding: 0.2em !important;
    }
    
    /* ===========================================
       BOOTSTRAP SPACING OVERRIDES FOR PRINT
    =========================================== */
    
    /* Override Bootstrap padding classes for print */
    .p-0 { padding: 0 !important; }
    .p-1 { padding: 0.2em !important; }
    .p-2 { padding: 0.3em !important; }
    .p-3 { padding: 0.4em !important; }
    .p-4 { padding: 0.5em !important; }
    .p-5 { padding: 0.6em !important; }
    
    /* Override Bootstrap margin classes for print */
    .m-0 { margin: 0 !important; }
    .m-1 { margin: 0.2em !important; }
    .m-2 { margin: 0.3em !important; }
    .m-3 { margin: 0.4em !important; }
    .m-4 { margin: 0.5em !important; }
    .m-5 { margin: 0.6em !important; }
    
    /* ===========================================
       LISTS
    =========================================== */
    ul, ol {
        margin: 0.5em 0 !important;
        padding-left: 1em !important;
    }
    
    li {
        margin: 0.2em 0 !important;
    }
    
    /* ===========================================
       RATIO CONTAINERS
    =========================================== */
    .ratio {
        position: relative !important;
        width: 100% !important;
    }
    
    .ratio::before {
        display: block !important;
        content: "" !important;
        width: 100% !important;
    }
    
    .ratio-16x9::before {
        padding-top: 56.25% !important;
    }
    
    .ratio-4x3::before {
        padding-top: 75% !important;
    }
    
    .ratio-1x1::before {
        padding-top: 100% !important;
    }
    
    .ratio > * {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    
    /* ===========================================
       FLEX UTILITIES
    =========================================== */
    .d-flex {
        display: flex !important;
    }
    
    .flex-row {
        flex-direction: row !important;
    }
    
    .flex-column {
        flex-direction: column !important;
    }
    
    .flex-wrap {
        flex-wrap: wrap !important;
    }
    
    .flex-nowrap {
        flex-wrap: nowrap !important;
    }
    
    /* ===========================================
       SPACING UTILITIES
    =========================================== */
    .mb-3 { margin-bottom: 0.5rem !important; }
    .mb-4 { margin-bottom: 0.8rem !important; }
    .mt-3 { margin-top: 0.5rem !important; }
    .mt-4 { margin-top: 0.8rem !important; }
    .p-3 { padding: 0.5rem !important; }
    .p-4 { padding: 0.8rem !important; }
    
    /* ===========================================
       PAGE BREAKS - A4 OPTIMIZED
    =========================================== */
    .page-break-before {
        page-break-before: always !important;
    }
    
    .page-break-after {
        page-break-after: always !important;
    }
    
    .page-break-inside-avoid {
        page-break-inside: avoid !important;
    }
    
    /* Allow page breaks in layout elements for better content flow */
    .table {
        page-break-inside: auto;
        break-inside: auto;
    }
    
    /* Allow page breaks in cards but avoid breaking small cards */
    .card {
        page-break-inside: auto;
        break-inside: auto;
    }
    
    /* Allow page breaks in rows and columns */
    .row,
    .col,
    .col-md-*,
    .col-lg-*,
    .col-xl-*,
    .col-xxl-* {
        page-break-inside: auto;
        break-inside: auto;
    }
    
    /* A4-specific page break rules */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid !important;
        break-after: avoid !important;
    }
    
    /* Allow card headers and bodies to break across pages for better flow */
    .card-header + .card-body {
        page-break-inside: auto;
        break-inside: auto;
    }
    
    /* Table page break handling */
    .table {
        page-break-inside: auto !important;
    }
    
    .table thead {
        display: table-header-group !important;
    }
    
    .table tbody tr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
    
    /* Image page break handling */
    img {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        max-height: 20cm !important; /* Prevent oversized images */
    }
    
    /* ===========================================
       CLEANUP AND OVERRIDES
    =========================================== */
    /* Remove shadows and backgrounds */
    * {
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    /* Remove any fixed positioning */
    .fixed-top,
    .fixed-bottom,
    .sticky-top {
        position: static !important;
    }
    
    /* Ensure proper text color */
    .text-muted {
        color: #666 !important;
    }
    
    .text-primary {
        color: #000 !important;
    }
    
    /* Remove any overflow hidden */
    .overflow-hidden {
        overflow: visible !important;
    }
    
    /* Force display properties for common layouts */
    [class*="col-"] {
        display: block !important;
    }
    
    /* Override any conflicting styles */
    .content .row .col-md-6,
    .content .row .col-lg-6,
    .content .row .col-xl-6,
    .content .row .col-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        width: 50% !important;
        float: left !important;
    }
    
    .content .row .col-md-4,
    .content .row .col-lg-4,
    .content .row .col-xl-4,
    .content .row .col-4 {
        flex: 0 0 33.333333% !important;
        max-width: 33.333333% !important;
        width: 33.333333% !important;
        float: left !important;
    }
    
    .content .row .col-md-8,
    .content .row .col-lg-8,
    .content .row .col-xl-8,
    .content .row .col-8 {
        flex: 0 0 66.666667% !important;
        max-width: 66.666667% !important;
        width: 66.666667% !important;
        float: left !important;
    }
    
    /* Force all column classes to display properly */
    .content .row [class*="col-"] {
        display: block !important;
        float: left !important;
    }
    
    /* Ensure row clears floats */
    .content .row::after {
        content: "";
        display: table;
        clear: both;
    }
    
    /* ===========================================
       PRINT-ONLY CONTENT
    =========================================== */
    
    /* Create a simple print-only header at top of FIRST PAGE only */
    body::before {
        content: "";
        display: block !important;
        width: 100% !important;
        height: 50px !important;
        background: #fff !important;
        background-image: url('../img/logos/logo.png') !important;
        background-repeat: no-repeat !important;
        background-position: 10px center !important;
        background-size: 40px 40px !important;
        border-bottom: 1px solid #000 !important;
        margin-bottom: 30px !important;
        page-break-after: avoid !important;
        position: relative !important;
    }
    
    /* Add company text next to logo - FIRST PAGE ONLY */
    body::after {
        content: "Gun & Shell Factory" "\A" "A unit of AWEIL" "\A" "Govt. of India Enterprise, Ministry of Defence";
        display: block !important;
        position: absolute !important;
        top: 5px !important;
        left: 60px !important;
        font-size: 10pt !important;
        font-weight: bold !important;
        color: #000 !important;
        white-space: pre-line !important;
        line-height: 1.0 !important;
        text-align: left !important;
        font-family: "Times New Roman", Times, serif !important;
        z-index: 1001 !important;
        page-break-after: avoid !important;
        height: 50px !important;
        overflow: hidden !important;
    }
    
    /* URL moved to footer - this section removed */
    
    /* Print-only brand header with logo and company info - LEFT ALIGNED */
    .print-brand-header {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        text-align: left !important;
        margin-bottom: 1em !important;
        padding-bottom: 0.5em !important;
        border-bottom: 2px solid #000 !important;
        page-break-after: avoid !important;
        page-break-inside: avoid !important;
        width: 100% !important;
        background: #fff !important;
    }
    
    .print-brand-header .print-logo {
        display: inline-block !important;
        width: 60px !important;
        height: 60px !important;
        margin-right: 15px !important;
        flex-shrink: 0 !important;
    }
    
    .print-brand-header .print-logo img {
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        object-position: center !important;
    }
    
    .print-brand-header .print-company-info {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        text-align: left !important;
        line-height: 1.2 !important;
    }
    
    .print-brand-header .print-company-name {
        font-size: 18pt !important;
        font-weight: bold !important;
        color: #000 !important;
        margin: 0 !important;
        margin-bottom: 2px !important;
    }
    
    .print-brand-header .print-company-slogan {
        font-size: 12pt !important;
        font-weight: normal !important;
        color: #000 !important;
        margin: 0 !important;
        margin-bottom: 1px !important;
    }
    
    .print-brand-header .print-company-sub-slogan {
        font-size: 10pt !important;
        font-weight: normal !important;
        color: #333 !important;
        margin: 0 !important;
    }
    
    /* Hide all navbar elements completely - we'll use CSS-generated header instead */
    .navbar,
    #navigation,
    .navbar-brand {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        position: absolute !important;
        left: -9999px !important;
        top: -9999px !important;
    }
    
    /* All navbar-brand styles removed - using CSS-generated header instead */
    
    /* ===========================================
       SHOW PAGE NAVIGATION (RIGHT SIDEBAR)
    =========================================== */
    /* Override hiding rules for page navigation - show right nav in print */
    .nav-scrollspy-wrapper,
    .nav-scrollspy-wrapper .nav,
    .nav-scrollspy-wrapper .nav-item,
    .nav-scrollspy-wrapper .nav-link,
    .nav-scrollspy,
    .nav-scrollspy .nav-item,
    .nav-scrollspy .nav-link,
    /* Include all nav variations with flex-column and text-wrap */
    .nav.nav-scrollspy,
    .nav.nav-scrollspy.flex-column,
    .nav.nav-scrollspy.flex-column.text-wrap,
    .nav.flex-column .nav-item,
    .nav.flex-column .nav-link,
    .text-wrap .nav-item,
    .text-wrap .nav-link {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: static !important;
        left: auto !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        margin: 0 !important;
        padding: 0.25em 0 !important;
        background: #fff !important;
        color: #000 !important;
        text-decoration: none !important;
        border: none !important;
        box-shadow: none !important;
        transform: none !important;
        overflow: visible !important;
        z-index: auto !important;
    }
    
    /* Style the right nav for print */
    .nav-scrollspy-wrapper {
        border: 1px solid #ccc !important;
        padding: 1em !important;
        margin-bottom: 1em !important;
        page-break-inside: avoid !important;
        background: #f9f9f9 !important;
    }
    
    .nav-scrollspy-wrapper h6 {
        display: block !important;
        font-weight: bold !important;
        margin-bottom: 0.5em !important;
        color: #000 !important;
        font-size: 12pt !important;
    }
    
    .nav-scrollspy .nav-item {
        margin-bottom: 0.25em !important;
        list-style: none !important;
    }
    
    .nav-scrollspy .nav-link {
        color: #000 !important;
        font-size: 10pt !important;
        padding-left: 0.5em !important;
        text-decoration: underline !important;
    }
    
    .nav-scrollspy .nav-link:before {
        content: "• " !important;
        font-weight: bold !important;
    }
    
    /* Navigation elements - clean styling */
    .nav-scrollspy-wrapper,
    .nav-scrollspy-wrapper *,
    .nav-scrollspy-wrapper ul,
    .nav-scrollspy-wrapper li,
    .nav-scrollspy-wrapper a {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: static !important;
        left: auto !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        transform: none !important;
        overflow: visible !important;
        width: auto !important;
        height: auto !important;
        max-width: none !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0.25em !important;
        background: transparent !important;
        color: #000 !important;
        border: none !important;
        box-shadow: none !important;
        z-index: auto !important;
        font-size: 10pt !important;
        font-weight: normal !important;
    }
    
    /* Force navigation content via CSS - fallback approach */
    .nav-scrollspy-wrapper:after {
        content: "On This Page:" "\A" "• Particulars of Organization, Functions and Duties" "\A" "• Powers and Duties of Officers and Employees" "\A" "• Procedure Followed in Decision Making Process" "\A" "• Directory of Officers and Employees" "\A" "• Monthly Remuneration Received by Officers and Employees" "\A" "• Particulars of Public Information Officers (PIOs)" "\A" "• Procedure for Obtaining Information" "\A" "• Fees and Payments for Obtaining Information" "\A" "• Time Limits for Disposal of Request" !important;
        display: block !important;
        background: #f9f9f9 !important;
        color: #000 !important;
        font-size: 10pt !important;
        font-weight: normal !important;
        padding: 1em !important;
        border: 1px solid #ccc !important;
        white-space: pre-line !important;
        line-height: 1.4 !important;
        margin-bottom: 1em !important;
        page-break-inside: avoid !important;
    }
    
    .nav-scrollspy-wrapper:after:first-line {
        font-weight: bold !important;
        font-size: 12pt !important;
    }
    
    /* ===========================================
       TABLE BORDERS FOR PRINT
    =========================================== */
    /* Force table borders to print */
    table,
    .table,
    table *,
    .table * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* Ensure all table elements have proper borders */
    table,
    .table {
        border-collapse: collapse !important;
        border-spacing: 0 !important;
        border: 1px solid #000 !important;
        width: 100% !important;
        margin-bottom: 1em !important;
    }
    
    table th,
    table td,
    .table th,
    .table td,
    table tr th,
    table tr td,
    .table tr th,
    .table tr td,
    table tbody th,
    table tbody td,
    .table tbody th,
    .table tbody td {
        border: 1px solid #000 !important;
        border-top: 1px solid #000 !important;
        border-right: 1px solid #000 !important;
        border-bottom: 1px solid #000 !important;
        border-left: 1px solid #000 !important;
        padding: 0.5em !important;
        text-align: left !important;
        vertical-align: top !important;
        background: #fff !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    table thead th,
    .table thead th,
    table th,
    .table th {
        background: #f0f0f0 !important;
        font-weight: bold !important;
        border: 1px solid #000 !important;
    }
    
    /* Comprehensive Bootstrap table support */
    .table-bordered,
    .table-bordered th,
    .table-bordered td,
    .table-bordered thead th,
    .table-bordered tbody th,
    .table-bordered tbody td {
        border: 1px solid #000 !important;
        border-collapse: collapse !important;
    }
    
    /* Bootstrap table variants */
    .table-striped tbody tr:nth-of-type(odd),
    .table-striped tbody tr:nth-of-type(odd) td,
    .table-striped tbody tr:nth-of-type(odd) th {
        background: #f9f9f9 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .table-striped tbody tr:nth-of-type(even),
    .table-striped tbody tr:nth-of-type(even) td,
    .table-striped tbody tr:nth-of-type(even) th {
        background: #fff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* Bootstrap table hover - remove hover effects for print */
    .table-hover tbody tr:hover,
    .table-hover tbody tr:hover td,
    .table-hover tbody tr:hover th {
        background: inherit !important;
    }
    
    /* Bootstrap table sizing */
    .table-sm th,
    .table-sm td {
        padding: 0.25rem !important;
        border: 1px solid #000 !important;
    }
    
    .table-lg th,
    .table-lg td {
        padding: 0.75rem !important;
        border: 1px solid #000 !important;
    }
    
    /* Bootstrap table colors - convert to print-friendly */
    .table-primary,
    .table-primary th,
    .table-primary td {
        background: #e3f2fd !important;
        border: 1px solid #000 !important;
    }
    
    .table-secondary,
    .table-secondary th,
    .table-secondary td {
        background: #f5f5f5 !important;
        border: 1px solid #000 !important;
    }
    
    .table-success,
    .table-success th,
    .table-success td {
        background: #e8f5e8 !important;
        border: 1px solid #000 !important;
    }
    
    .table-danger,
    .table-danger th,
    .table-danger td {
        background: #ffeaea !important;
        border: 1px solid #000 !important;
    }
    
    .table-warning,
    .table-warning th,
    .table-warning td {
        background: #fff3cd !important;
        border: 1px solid #000 !important;
    }
    
    .table-info,
    .table-info th,
    .table-info td {
        background: #e2f3ff !important;
        border: 1px solid #000 !important;
    }
    
    .table-light,
    .table-light th,
    .table-light td {
        background: #f8f9fa !important;
        border: 1px solid #000 !important;
    }
    
    .table-dark,
    .table-dark th,
    .table-dark td {
        background: #e0e0e0 !important;
        color: #000 !important;
        border: 1px solid #000 !important;
    }
    
    /* Override any border-none classes */
    .border-0,
    .border-none,
    .no-border,
    .table .border-0,
    .table .border-none,
    .table .no-border {
        border: 1px solid #000 !important;
    }
    
    /* Force responsive table wrapper to show content */
    .table-responsive,
    .table-responsive-sm,
    .table-responsive-md,
    .table-responsive-lg,
    .table-responsive-xl,
    .table-responsive-xxl {
        overflow: visible !important;
        width: 100% !important;
        border: none !important;
    }
    
    /* Ensure table captions are visible */
    .table caption {
        display: table-caption !important;
        caption-side: top !important;
        color: #000 !important;
        font-weight: bold !important;
        text-align: left !important;
        padding: 0.5rem 0 !important;
    }
    
    /* Specific styling for nav elements */
    .nav-scrollspy-wrapper ul,
    .nav-scrollspy-wrapper ul * {
        list-style: none !important;
        margin: 0 !important;
        padding: 0.25em 0 !important;
    }
    
    .nav-scrollspy-wrapper li {
        margin-bottom: 0.25em !important;
        padding-left: 0.5em !important;
    }
    
    .nav-scrollspy-wrapper a {
        text-decoration: underline !important;
        font-size: 10pt !important;
        line-height: 1.2 !important;
        color: #000 !important;
    }
    
    .nav-scrollspy-wrapper a:before {
        content: "• " !important;
        font-weight: bold !important;
    }
    
    /* Footer removed - no longer needed */
    
    /* Add centered page title only */
    .print-title-data:before {
        content: attr(data-page-title, "Document");
        display: block;
        font-size: 16pt !important;
        font-weight: bold;
        text-align: center;
        margin-top: 0 !important;
        margin-bottom: 1em !important;
        color: #000;
        line-height: 1.2;
        border: none;
        padding: 0;
        page-break-after: avoid;
    }
    
    /* ===========================================
       ACCESSIBILITY IMPROVEMENTS
    =========================================== */
    /* Ensure sufficient color contrast */
    .text-light {
        color: #333 !important;
    }
    
    .bg-light {
        background-color: #f8f9fa !important;
    }
    
    /* Make sure focus indicators are visible */
    *:focus {
        outline: 2px solid #000 !important;
    }
    
        /* ===========================================
        DEBUGGING - ENSURE CONTENT IS VISIBLE
    =========================================== */
    /* Make sure all content areas are visible */
    .content > *,
    .content-inner > *,
    .content-wrapper > * {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Ensure divs and other containers are visible */
    div {
        display: block !important;
        visibility: visible !important;
    }
    
    /* Override any display:none that might be hiding content */
    .content div[style*="display: none"],
    .content div[style*="display:none"] {
        display: block !important;
    }
    
    /* Force content to start immediately after header */
    .content:first-child,
    .content-inner:first-child,
    .content-wrapper:first-child {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* Ensure first content element is visible */
    .content > *:first-child,
    .content-inner > *:first-child,
    .content-wrapper > *:first-child {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* ===========================================
       A4 SPECIFIC OPTIMIZATIONS
    =========================================== */
    /* Ensure content fits within A4 margins */
    .container,
    .container-fluid {
        max-width: 18cm !important; /* A4 width minus margins */
        margin: 0 auto !important;
    }
    
    /* Optimize font sizes for A4 readability */
    .small, .text-small {
        font-size: 9pt !important;
    }
    
    .lead {
        font-size: 12pt !important;
        line-height: 1.4 !important;
    }
    
    /* Ensure proper spacing for A4 */
    .mb-1 { margin-bottom: 0.2rem !important; }
    .mb-2 { margin-bottom: 0.4rem !important; }
    .mb-3 { margin-bottom: 0.6rem !important; }
    .mb-4 { margin-bottom: 0.8rem !important; }
    .mb-5 { margin-bottom: 1rem !important; }
    
    .mt-1 { margin-top: 0.2rem !important; }
    .mt-2 { margin-top: 0.4rem !important; }
    .mt-3 { margin-top: 0.6rem !important; }
    .mt-4 { margin-top: 0.8rem !important; }
    .mt-5 { margin-top: 1rem !important; }
    
    /* Ensure proper padding for A4 */
    .p-1 { padding: 0.2rem !important; }
    .p-2 { padding: 0.4rem !important; }
    .p-3 { padding: 0.6rem !important; }
    .p-4 { padding: 0.8rem !important; }
    .p-5 { padding: 1rem !important; }
    

    /* GIGW Compliance - Ensure accessibility in print */
    .visually-hidden {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }
    
    /* Ensure proper contrast for print */
    .text-muted {
        color: #333 !important; /* Darker for better print contrast */
    }
    
    .text-secondary {
        color: #555 !important;
    }
    
    /* Print-specific utility classes */
    .print-only {
        display: block !important;
    }
    
    .no-print {
        display: none !important;
    }
    
    /* Ensure proper table printing */
    .table-responsive {
        overflow: visible !important;
    }
    
    /* Optimize card printing for A4 */
    .card {
        border: 1px solid #000 !important;
        margin: 0.2em 0 !important;
        padding: 0.3em !important;
        background: #fff !important;
        box-shadow: none !important;
        page-break-inside: auto !important;
        break-inside: auto !important;
        overflow: visible !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .card-header {
        background: #f8f9fa !important;
        border: none !important;
        padding: 0.3em !important;
        font-weight: bold !important;
    }
    
    /* Respect border-bottom-0 class in print */
    .card-header.border-bottom-0 {
        border-bottom: none !important;
    }
    
    /* Preserve border-top for dividers between sections */
    .card-header.border-top,
    .card-header.border-top.border-300,
    .card-header.border-top.border-300.border-bottom-0 {
        border-top: 1px solid #000 !important;
        border-top-color: #000 !important;
        border-top-style: solid !important;
        border-top-width: 1px !important;
    }
    
    /* Override Bootstrap border color classes in print */
    .border-300,
    .border-primary,
    .border-secondary,
    .border-success,
    .border-danger,
    .border-warning,
    .border-info,
    .border-light,
    .border-dark {
        border-color: #000 !important;
    }
    
    .card-body {
        padding: 0.2em !important;
    }
    
    /* ===========================================
       PRINT-SPECIFIC HEADERS FOR COMPANY INFO AND PAGE TITLES
    =========================================== */
    /* Fix ammunition items print layout - page structure */
    .ammunition-items {
        page-break-inside: auto !important;
    }
    
    .ammunition-items .text-center {
        page-break-after: avoid !important;
        margin-bottom: 1rem !important;
    }
    
    .ammunition-items section {
        page-break-inside: auto !important;
    }
    
    .ammunition-items .row {
        page-break-inside: avoid !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.3rem !important;
    }
    
    .ammunition-items .col-xl-4 {
        flex: 0 0 32% !important;
        max-width: 32% !important;
        width: 32% !important;
        padding: 0.2rem !important;
        page-break-inside: avoid !important;
        vertical-align: top !important;
    }
    
    .ammunition-items .col-sm-6 {
        flex: 0 0 49% !important;
        max-width: 49% !important;
        width: 49% !important;
        padding: 0.2rem !important;
        page-break-inside: avoid !important;
        vertical-align: top !important;
    }
    
    .ammunition-items .card {
        margin-bottom: 0.3rem !important;
        page-break-inside: avoid !important;
        height: auto !important;
        min-height: 180px !important;
        display: block !important;
    }
    
    .ammunition-items .card-img-actions {
        height: 120px !important;
        page-break-inside: avoid !important;
    }
    
    .ammunition-items .card-body {
        padding: 0.5rem !important;
    }
    
    /* Global image styles for print */
    .w-100 {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .object-fit-cover {
        object-fit: cover !important;
    }
    
    .img-fluid {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Card image containers for print - more specific */
    .card-img-actions .w-100.h-100.object-fit-cover.img-fluid {
        display: block !important;
        width: 100% !important;
        height: 120px !important;
        object-fit: cover !important;
        page-break-inside: avoid !important;
    }
    
    /* Print company header and page title headers */
    .print-company-header,
    .print-header {
        display: block !important;
        text-align: center !important;
        margin-bottom: 1em !important;
        page-break-after: avoid !important;
        page-break-inside: avoid !important;
    }
    
    .print-company-header h2 {
        font-size: 18pt !important;
        font-weight: bold !important;
        margin: 0 !important;
        color: #000 !important;
        line-height: 1.2 !important;
    }
    
    .print-company-header p {
        font-size: 12pt !important;
        margin: 0.2em 0 !important;
        color: #000 !important;
        line-height: 1.3 !important;
    }
    
    .print-header h1 {
        font-size: 20pt !important;
        font-weight: bold !important;
        margin: 0 !important;
        color: #000 !important;
        border-bottom: 1px solid #000 !important;
        padding-bottom: 0.3em !important;
        line-height: 1.2 !important;
    }
    
    /* Ensure print headers are always visible */
    .print-company-header,
    .print-header {
        background: #fff !important;
        border: none !important;
        box-shadow: none !important;
    }
}
