/* Print-Friendly Styles for Reports */

@media print {
    /* Hide unnecessary elements */
    nav,
    .no-print,
    button:not(.print-visible),
    .sidebar,
    header .flex.gap-2,
    [x-data],
    footer {
        display: none !important;
    }

    /* Page setup */
    @page {
        margin: 1.5cm;
        size: A4;
    }

    body {
        background: white !important;
        color: black !important;
        font-size: 11pt;
        line-height: 1.4;
    }

    /* Remove shadows, borders for clean print */
    .bg-white,
    .dark\:bg-gray-800,
    .bg-gray-50 {
        background: white !important;
        box-shadow: none !important;
    }

    .border,
    .border-t,
    .border-b,
    .rounded-xl,
    .rounded-lg {
        border-color: #e5e7eb !important;
    }

    /* Ensure dark mode text is visible */
    .dark\:text-white,
    .dark\:text-gray-200,
    .text-gray-900 {
        color: black !important;
    }

    .dark\:text-gray-400,
    .text-gray-600 {
        color: #4b5563 !important;
    }

    /* Tables */
    table {
        width: 100%;
        border-collapse: collapse;
        page-break-inside: avoid;
    }

    thead {
        display: table-header-group;
        background: #f3f4f6 !important;
    }

    th, td {
        padding: 8px;
        border: 1px solid #d1d5db;
        text-align: left;
    }

    th {
        font-weight: 600;
        background: #f9fafb !important;
    }

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

    .avoid-break {
        page-break-inside: avoid;
    }

    /* Headers and footers for print */
    .print-header {
        display: block;
        text-align: center;
        margin-bottom: 20px;
        padding-bottom: 10px;
        border-bottom: 2px solid #000;
    }

    .print-header h1 {
        font-size: 20pt;
        font-weight: bold;
        margin: 0;
    }

    .print-header p {
        font-size: 10pt;
        color: #4b5563;
        margin: 5px 0 0;
    }

    .print-footer {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        text-align: center;
        font-size: 9pt;
        color: #6b7280;
        padding: 10px 0;
        border-top: 1px solid #d1d5db;
    }

    /* Charts - hide or show message */
    canvas {
        display: none;
    }

    .chart-print-message {
        display: block !important;
        text-align: center;
        padding: 20px;
        background: #f3f4f6;
        border: 1px dashed #9ca3af;
        color: #6b7280;
    }

    /* Stat cards - optimize for print */
    .grid {
        display: block !important;
    }

    .grid > div {
        display: inline-block;
        width: 48%;
        margin-bottom: 10px;
        vertical-align: top;
    }

    /* Ensure important data is visible */
    .font-bold,
    .font-semibold {
        font-weight: 600 !important;
    }

    /* Status badges */
    .bg-green-100,
    .bg-blue-100,
    .bg-yellow-100,
    .bg-red-100 {
        background: white !important;
        border: 1px solid currentColor !important;
        padding: 2px 6px;
    }

    /* Links */
    a {
        color: black !important;
        text-decoration: none;
    }

    a[href]:after {
        content: none; /* Don't print URLs */
    }

    /* Signature section for reports */
    .print-signature {
        display: flex;
        justify-content: space-between;
        margin-top: 40px;
        padding-top: 20px;
        border-top: 1px solid #d1d5db;
    }

    .print-signature > div {
        width: 45%;
    }

    .signature-line {
        border-top: 1px solid #000;
        margin-top: 30px;
        padding-top: 5px;
        text-align: center;
        font-size: 9pt;
    }

    /* Folio invoice specific */
    .invoice-header {
        margin-bottom: 30px;
    }

    .invoice-details {
        margin-bottom: 20px;
    }

    .invoice-total {
        font-size: 14pt;
        font-weight: bold;
        text-align: right;
        margin-top: 15px;
        padding-top: 10px;
        border-top: 2px solid #000;
    }

    /* Night audit reconciliation */
    .audit-summary {
        background: #f9fafb !important;
        padding: 15px;
        margin-bottom: 20px;
        border: 1px solid #d1d5db;
    }

    .audit-summary h3 {
        margin-top: 0;
        font-size: 12pt;
        font-weight: 600;
    }

    /* Check-in/out reports */
    .guest-list-item {
        padding: 10px;
        margin-bottom: 8px;
        border: 1px solid #e5e7eb;
        page-break-inside: avoid;
    }

    .guest-list-item h4 {
        margin: 0 0 5px 0;
        font-size: 11pt;
        font-weight: 600;
    }

    .guest-list-item p {
        margin: 2px 0;
        font-size: 9pt;
    }

    /* Compact spacing */
    .space-y-6 > * + *,
    .space-y-4 > * + * {
        margin-top: 10px !important;
    }

    .gap-6,
    .gap-4 {
        gap: 10px !important;
    }

    /* Hotel branding */
    .print-logo {
        display: block;
        max-width: 150px;
        margin: 0 auto 15px;
    }
}

/* Print button visible on screen only */
.print-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #3b82f6;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    z-index: 1000;
}

.print-button:hover {
    background: #2563eb;
}

@media print {
    .print-button {
        display: none !important;
    }
}
