/**
 * Print Styles for Single Application
 *
 * @package MARA_Applications
 * @since 1.0.0
 */

@media print {
    /* Hide navigation, header, footer, and buttons */
    header,
    footer,
    .site-header,
    .site-footer,
    nav,
    .breadcrumb,
    .page-header,
    .btn,
    button,
    .d-flex.justify-content-between,
    .bg-light,
    .bg-secondary {
        display: none !important;
    }
    
    /* Reset margins and padding for print */
    * {
        box-shadow: none !important;
    }
    
    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        color: black !important;
    }
    
    /* Ensure content starts at top of page */
    .site-content,
    .content-area,
    .site-main {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 10px !important;
    }
    
    /* Remove all card styling */
    .card {
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        margin-bottom: 0.5rem !important;
    }
    
    .card-body {
        padding: 0 !important;
    }
    
    /* Keep application content formatted */
    .mara-application-single {
        page-break-inside: avoid;
    }
    
    /* Application header - show reference number prominently */
    .application-header {
        margin-bottom: 1rem !important;
        padding-bottom: 0.5rem !important;
        border-bottom: 2px solid #000 !important;
        display: block !important;
    }
    
    .application-header .row {
        display: block !important;
    }
    
    .application-header .col-12 {
        display: block !important;
    }
    
    .application-header .lead {
        display: block !important;
        font-size: 1.5rem !important;
        margin-bottom: 0.5rem !important;
        color: black !important;
    }
    
    .application-header .lead strong {
        display: none !important;
    }
    
    .application-header .lead span {
        font-weight: bold !important;
        color: black !important;
    }
    
    /* Hide category badges in header */
    .application-header .badge {
        display: none !important;
    }
    
    /* Tighten up the meta section at top */
    .application-meta {
        margin-bottom: 1rem !important;
    }
    
    .application-meta .row {
        margin-bottom: 0 !important;
    }
    
    .application-meta .col-md-6,
    .application-meta .col-lg-4 {
        margin-bottom: 0.5rem !important;
        padding: 0 0.5rem !important;
    }
    
    .application-meta .card {
        margin-bottom: 0 !important;
    }
    
    .application-meta h6 {
        margin-bottom: 0.25rem !important;
        font-size: 0.85rem !important;
        font-weight: bold !important;
    }
    
    .application-meta p {
        margin-bottom: 0 !important;
        font-size: 0.9rem !important;
    }
    
    /* Section spacing */
    section {
        margin-bottom: 1rem !important;
    }
    
    /* Section headers */
    h2, h3, h4, h5, h6 {
        margin-top: 1rem !important;
        margin-bottom: 0.5rem !important;
        page-break-after: avoid;
    }
    
    h2.h4 {
        font-size: 1.1rem !important;
        margin-top: 1rem !important;
        margin-bottom: 0.5rem !important;
        color: black !important;
    }
    
    
    .application-meta h3.h5 {
        font-size: 1.1rem !important;
        margin-top: 1rem !important;
        margin-bottom: 0.5rem !important;
        color: black !important;
    }
    
    h3.h5.application-sub-heading {
        font-size: 0.9rem !important;
        color: grey !important;
        font-weight: bold !important;
        margin-top: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* Determination documents heading */
    .determination-details p.fw-bold {
        font-size: 0.9rem !important;
        color: grey !important;
        font-weight: bold !important;
        margin-top: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* Ensure tables fit on page */
    .table-responsive {
        overflow: visible !important;
        width: 100% !important;
    }
    
    table {
        page-break-inside: auto;
        border-collapse: collapse !important;
        width: 100% !important;
        margin-bottom: 1rem !important;
        table-layout: fixed !important;
    }
    
    thead {
        display: table-header-group;
    }
    
    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
    
    th, td {
        padding: 0.4rem !important;
        border: 1px solid #dee2e6 !important;
        font-size: 0.85rem !important;
        word-wrap: break-word !important;
    }
    
    /* Hide download column in tables */
    .documents-table th:last-child,
    .documents-table td:last-child {
        display: none !important;
    }
    
    /* Adjust remaining column widths */
    .documents-table th:first-child,
    .documents-table td:first-child {
        width: 70% !important;
    }
    
    .documents-table th:nth-child(2),
    .documents-table td:nth-child(2) {
        width: 30% !important;
    }
    
    /* Ensure badges are visible - but remove styling for status and determination date */
    .badge {
        border: none !important;
        padding: 0 !important;
        background: transparent !important;
        color: black !important;
        font-size: inherit !important;
        font-weight: normal !important;
    }
    
    /* Make links show their URL */
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: grey;
    }
    
    /* Don't show URL for download buttons or document links in tables */
    .btn[href]:after,
    a.btn:after,
    .documents-table a:after {
        content: "";
    }
    
    /* Remove any top spacing that creates blank page */
    .my-5 {
        margin-top: 0 !important;
        margin-bottom: 1rem !important;
    }
    
    /* Page title - hide it since we're showing reference number */
    .mara-application-single > header h1 {
        display: none !important;
    }
}