@media print {
    /* Hide non-essential UI elements */
    .sidebar, 
    nav, 
    header, 
    footer, 
    button, 
    .no-print,
    .setup-panel,
    .history-panel,
    .gen-header,
    .toc-panel,
    #sidebar-overlay,
    .intelligence-hub-pill,
    .edit-overlay,
    .config-sidebar,
    #copilot-toggle,
    #copilot-ui {
        display: none !important;
    }

    /* Reset body and main container */
    body {
        background: white !important;
        color: black !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        height: auto !important;
    }

    main {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: none !important;
        position: static !important;
        overflow: visible !important;
        height: auto !important;
        display: block !important;
    }

    .flex, .grid {
        display: block !important;
    }

    /* Ensure background colors and images are printed */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Typography adjustments */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        color: #000 !important;
    }

    p, li, blockquote {
        page-break-inside: avoid;
    }

    /* Column and Card Adjustments */
    .strategy-card, 
    .persona-card, 
    .doc-page, 
    .report-doc,
    .billing-card {
        box-shadow: none !important;
        border: 1px solid #eee !important;
        margin-bottom: 2rem !important;
        padding: 2rem !important;
        page-break-inside: avoid !important;
        width: 100% !important;
    }

    /* Document specific tweaks */
    .doc-page {
        padding: 0 !important;
        border: none !important;
    }

    /* Table adjustments */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
    }
    
    th, td {
        border-bottom: 1px solid #eee !important;
        padding: 8px !important;
    }

    /* Page breaks */
    .page-break {
        page-break-before: always;
    }

    /* Sidebar and Header resets for MS-64/72 classes */
    .ms-64, .ms-72, .lg\:ms-72 {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* RTL specific print fixes */
    [dir="rtl"] .ms-64, 
    [dir="rtl"] .ms-72, 
    [dir="rtl"] .lg\:ms-72 {
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    /* Add a custom print header/footer if needed */
    .print-header {
        display: block !important;
        margin-bottom: 2rem;
        border-bottom: 2px solid #000;
        padding-bottom: 1rem;
    }

    .print-footer {
        display: block !important;
        position: fixed;
        bottom: 0;
        width: 100%;
        text-align: center;
        font-size: 10px;
        color: #999;
        border-top: 1px solid #eee;
        padding-top: 10px;
    }
}

/* Hide print-only elements in normal view */
.print-header,
.print-footer {
    display: none;
}
