@media print {
    /* Hide Navigation and Sidebar */
    .sidebar, 
    .navbar, 
    .d-footer, 
    .back-to-top,
    .customizer-wrapper,
    .sidebar-close-btn,
    .mobile-menu-btn {
        display: none !important;
    }

    /* Reset Main Content Layout */
    .dashboard-main {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .dashboard-main-body {
        padding: 0 !important;
    }

    /* Colors and Backgrounds */
    body {
        background-color: white !important;
        color: black !important;
        font-family: serif; /* Better for reading printed text */
    }

    .card {
        border: none !important;
        box-shadow: none !important;
        margin-bottom: 20px !important;
    }

    .card-body {
        padding: 0 !important;
    }

    /* Typography */
    a {
        text-decoration: none !important;
        color: black !important;
    }
    
    /* Ensure links show their URL */
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #555;
    }

    /* Code Blocks */
    pre, code {
        border: 1px solid #ccc !important;
        white-space: pre-wrap !important; /* Wrap long lines */
        page-break-inside: avoid;
        background-color: #f5f5f5 !important;
        color: black !important;
    }

    /* Page Breaks */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }

    .accordion-item {
        page-break-inside: avoid;
    }
    
    img {
        max-width: 100% !important;
    }
}
