/* Print Styles for Schools Directory */

@media print {
    /* Global print styles */
    body {
        font-family: serif;
        font-size: 12pt;
        line-height: 1.5;
        background: #fff;
        color: #000;
    }
    
    /* Hide non-essential elements */
    header nav, footer, .sidebar, .no-print, 
    button:not(.print-include), .social-share,
    .comparison-controls, #compareBar, .filter-sidebar,
    .search-controls, .view-toggle, .pagination {
        display: none !important;
    }
    
    /* Make sure the content is print-friendly */
    .container {
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin: 0;
    }
    
    /* Remove background colors and shadows */
    .bg-white, .bg-gray-50, .bg-gray-100, .shadow, .shadow-md, .shadow-lg {
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
    }
    
    /* Add borders to tables */
    table {
        border-collapse: collapse;
    }
    
    table th, table td {
        border: 1px solid #ddd;
        padding: 8px;
    }
    
    /* Improve link display */
    a {
        color: #000;
        text-decoration: none;
    }
    
    a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        font-style: italic;
    }
    
    /* School details page */
    .school-header {
        display: flex;
        align-items: flex-start;
    }
    
    .school-image {
        width: 100px;
        height: auto;
        margin-right: 20px;
    }
    
    .school-info {
        flex: 1;
    }
    
    /* Make sure images are printable */
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    
    /* Page breaks */
    h1, h2, h3, 
    .school-item, 
    .school-details, 
    .comparison-school, 
    .table-responsive {
        page-break-inside: avoid;
    }
    
    /* School comparison specific styles */
    .comparison-table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 20px;
    }
    
    .comparison-table th, .comparison-table td {
        border: 1px solid #ddd;
        padding: 8px;
        text-align: left;
    }
    
    /* Adjust layouts */
    .grid, .flex {
        display: block !important;
    }
    
    .col-span-1, .col-span-2, .col-span-3, .col-span-4 {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Analytics charts */
    .chart-container {
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 20px;
    }
    
    /* Add page numbers */
    @page {
        margin: 2cm;
    }
    
    @page :first {
        margin-top: 3cm;
    }
    
    /* Hide interactive elements */
    .leaflet-container, #schoolsMap {
        height: 0 !important;
        display: none !important;
    }
    
    /* Show printer-friendly message */
    body::before {
        content: "Singapore Schools Directory";
        display: block;
        text-align: center;
        font-size: 10pt;
        margin-bottom: 20px;
        font-style: italic;
    }
    
    /* Footer */
    body::after {
        content: "© Singapore Schools Directory";
        display: block;
        text-align: center;
        font-size: 10pt;
        margin-top: 20px;
        font-style: italic;
        page-break-after: always;
    }
}
