/* Kingsway Gold POS Calculator - Print Styles */

@media print {
    /* Reset everything */
    * {
        visibility: hidden;
        margin: 0;
        padding: 0;
    }
    
    /* Only show invoice wrapper and its contents */
    .invoice-wrapper,
    .invoice-wrapper * {
        visibility: visible;
    }
    
    /* Position invoice at top left */
    .invoice-wrapper {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: none;
        padding: 20px;
        background: white !important;
    }
    
    /* Invoice header styling */
    .invoice-header {
        text-align: center;
        border-bottom: 2px solid #000;
        padding-bottom: 15px;
        margin-bottom: 20px;
    }
    
    .invoice-header h1 {
        font-size: 24px;
        color: #000;
        margin: 0;
        font-weight: bold;
        letter-spacing: 1px;
    }
    
    .invoice-subtitle {
        font-size: 12px;
        color: #333;
        margin: 5px 0;
    }
    
    .invoice-details {
        margin-top: 10px;
        font-size: 12px;
    }
    
    .invoice-details p {
        margin: 3px 0;
    }
    
    /* Invoice sections */
    .invoice-section {
        margin: 15px 0;
        page-break-inside: avoid;
    }
    
    .invoice-section h3 {
        font-size: 14px;
        color: #000;
        border-bottom: 1px solid #ccc;
        padding-bottom: 5px;
        margin-bottom: 10px;
    }
    
    /* Invoice tables */
    .invoice-info {
        width: 100%;
        font-size: 11px;
    }
    
    .invoice-info td {
        padding: 3px 5px;
    }
    
    .invoice-items {
        width: 100%;
        border-collapse: collapse;
        font-size: 11px;
    }
    
    .invoice-items th,
    .invoice-items td {
        padding: 5px;
        border: 1px solid #ccc;
        text-align: left;
    }
    
    .invoice-items th {
        background: #f5f5f5 !important;
        font-weight: bold;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .invoice-total td {
        border-top: 2px solid #000;
        padding-top: 8px;
        font-size: 14px;
        font-weight: bold;
    }
    
    /* Invoice footer */
    .invoice-footer {
        margin-top: 15px;
        padding-top: 10px;
        border-top: 1px solid #ccc;
        font-size: 10px;
        color: #555;
    }
    
    /* Hide action buttons */
    .invoice-actions,
    .no-print {
        display: none !important;
    }
    
    /* Page settings */
    @page {
        margin: 0.5in;
        size: letter;
    }
    
    /* Force black text for printing */
    body {
        color: #000 !important;
        background: white !important;
    }
    
    /* Ensure proper page breaks */
    .invoice-wrapper {
        page-break-after: always;
    }
    
    /* Hide everything else on the page */
    body > *:not(#transaction-summary) {
        display: none !important;
    }
    
    #transaction-summary {
        display: block !important;
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* Screen styles for invoice preview */
@media screen {
    .invoice-wrapper {
        max-width: 800px;
        margin: 0 auto;
        padding: 30px;
        background: white;
        box-shadow: 0 0 10px rgba(0,0,0,0.1);
        border-radius: 8px;
    }
    
    .invoice-header {
        text-align: center;
        border-bottom: 3px solid #D4AF37;
        padding-bottom: 20px;
        margin-bottom: 30px;
    }
    
    .invoice-header h1 {
        color: #D4AF37;
        margin: 0;
        font-size: 32px;
        letter-spacing: 2px;
        font-weight: bold;
    }
    
    .invoice-subtitle {
        color: #666;
        margin: 10px 0;
        font-size: 14px;
    }
    
    .invoice-section h3 {
        color: #1a1a1a;
        border-bottom: 1px solid #ddd;
        padding-bottom: 8px;
        margin-bottom: 15px;
        font-size: 18px;
    }
    
    .invoice-info {
        width: 100%;
        margin: 10px 0;
    }
    
    .invoice-info td {
        padding: 5px;
        font-size: 14px;
    }
    
    .invoice-items {
        width: 100%;
        border-collapse: collapse;
        margin-top: 10px;
    }
    
    .invoice-items th,
    .invoice-items td {
        padding: 10px;
        border-bottom: 1px solid #eee;
        text-align: left;
    }
    
    .invoice-items th {
        background: #f9f9f9;
        font-weight: bold;
        color: #333;
    }
    
    .invoice-total td {
        border-top: 2px solid #D4AF37;
        padding-top: 15px;
        font-size: 20px;
        font-weight: bold;
        color: #1a1a1a;
    }
    
    .invoice-footer {
        margin-top: 30px;
        padding-top: 15px;
        border-top: 1px solid #ddd;
        font-size: 12px;
        color: #666;
    }
    
    .invoice-actions {
        margin-top: 30px;
        text-align: center;
    }
    
    .invoice-actions button {
        margin: 0 10px;
        padding: 12px 30px;
        border-radius: 4px;
        border: none;
        cursor: pointer;
        font-size: 14px;
        font-weight: 500;
        transition: opacity 0.2s;
    }
    
    .invoice-actions button:hover {
        opacity: 0.9;
    }
}