/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    margin: 0;
    padding: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 1200px;
}

/* --- Input Form Styles --- */
.input-form {
    background: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.input-group {
    flex: 1 1 100%;
    margin-bottom: 10px;
}

.half-width {
    flex: 1 1 calc(50% - 15px);
}

.input-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
}

.input-form input, .input-form textarea, .input-form select {
    width: 100%;
    padding: 10px;
    border: 1px solid #dcdcdc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 1em;
    transition: border-color 0.3s;
}

.input-form input:focus, .input-form textarea:focus, .input-form select:focus {
    border-color: #007bff;
    outline: none;
}

/* Item Input Design */
.item-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #f0f0f0;
    border-radius: 5px;
    background: #fafafa;
}

.item-row > div {
    flex: 1;
}

.item-row .qty-input, .item-row .price-input {
    flex: 0 0 15%; /* Shorter width for Qty and Price */
}

.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0 10px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    align-self: flex-start;
    height: 38px;
    margin-top: 24px;
}

.generate-btn, .add-item-btn, .print-btn {
    padding: 12px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: background 0.3s;
    margin-top: 10px;
}

.generate-btn:hover, .add-item-btn:hover, .print-btn:hover {
    background: #0056b3;
}

/* --- A4 Page Styling (For Screen Preview) --- */
.invoice-page {
    background: white; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin: 20px auto;
    position: relative; 
    overflow: hidden; 
}

.a4-size {
    width: 210mm;
    min-height: 297mm;
    box-sizing: border-box;
}

/* Watermark Image Styling */
.background-watermark {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* কন্টেন্টের নিচে রাখার জন্য */
    opacity: 1; /* যদি ওয়াটারমার্ক হালকা করতে চান, তবে 0.5 বা 0.3 ব্যবহার করুন */
    pointer-events: none; 
    object-fit: cover;
}

/* Label for the copies (Official/Client) */
.copy-label {
    position: absolute;
    top: 45mm;
    right: 20mm;
    font-size: 1.2em;
    color: #cc0000;
    opacity: 1; 
    z-index: 10;
    padding: 5px 10px;
    border: 2px solid #cc0000;
    background-color: rgba(255, 255, 255, 0.8);
}

/* --- Invoice Content Styles --- */
.invoice-content {
    padding: 20mm;
    position: relative;
    z-index: 2; /* ওয়াটারমার্কের উপরে থাকার জন্য */
}

.header {
    border-bottom: 3px solid #007bff;
    padding-bottom: 10px;
    margin-bottom: 20px;
    overflow: auto;
}

.header h1 {
    text-align: center;
    color: #007bff;
    font-size: 2.5em;
    margin: 0;
}

.client-block {
    margin-top: 70px;
    line-height: .5;
    font-size: 13px;
    width: 100%;
}

.detail-table, .total-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0px;
    font-size: 13px;
}

.detail-table td:first-child {
    width: 50%;
}

.detail-table td {
    padding: 5px 0;
}

.item-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
	font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.item-table th, .item-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
    font-size: 0.95em;
}

.item-table th {
    background-color: #212529;
    color: white;
    text-align: center;
}

.item-table td.right, .total-table td.right {
    text-align: right;
}

.total-section {
    width: 40%;
    margin-left: auto;
    border-top: 2px solid #333;
    padding-top: 10px;
}

.total-table td {
    padding: 5px 0;
}

.total-table tr:last-child td {
    font-size: 1.1em;
    font-weight: bold;
    border-top: 1px solid #ccc;
}

.note-section {
    font-size: 11px;
    border: 1px solid #ccc;
    padding: 15px;
    margin-top: 40px;
    line-height: 1.5;
    background: #f9f9f9;
}

/* --- Print Styles --- */
@media print {
    body {
        background: none;
        padding: 0;
    }

    .input-form, #print-button, #no-invoice-message {
        display: none !important;
    }

    /* Print settings for A4 page size */
    @page {
        size: A4;
        margin: 0;
    }

    .invoice-page {
        margin: 0;
        box-shadow: none;
        width: 210mm;
        height: 297mm; 
        padding: 0;
        page-break-after: always;
    }

    /* IMG ট্যাগকে প্রিন্ট মোডে ১০০% স্পষ্ট ও সঠিক পজিশনে রাখা */
    .background-watermark {
        opacity: 1 !important;
        display: block !important;
        /* এই প্রপার্টিটি প্রিন্টারে ব্যাকগ্রাউন্ড ইমেজ জোর করে দেখায় */
        -webkit-print-color-adjust: exact !important; 
        print-color-adjust: exact !important;
    }
    
    .page-break-before {
        page-break-before: always;
    }

    .invoice-page:last-child {
        page-break-after: auto;
    }
    
    .invoice-content {
        padding: 20mm;
    }
}
/* ... [existing invoice_style.css content remains here] ... */


/* --- New Invoice List Styles --- */

.list-control-buttons {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.back-to-list-btn {
    padding: 10px 15px;
    background-color: #004d99; /* Deep Navy Blue */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background-color 0.2s;
}
.back-to-list-btn:hover {
    background-color: #003366;
}

#goToInputFormBtn {
    padding: 10px 15px;
    background-color: #7cbb00; /* Lime Green */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background-color 0.2s;
}

#goToInputFormBtn:hover {
    background-color: #629400;
}

#invoice-list-container {
    margin-top: 20px;
}

#invoice-list-table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
}

#invoice-list-table th, #invoice-list-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    text-align: left;
    font-size: 14px;
}

#invoice-list-table th {
    background-color: #004d99;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9em;
}

#invoice-list-table tbody tr:hover {
    background-color: #e6f7ff;
}

#invoice-list-table td.price {
    font-weight: bold;
    color: #008000; /* Green for price */
    text-align: right;
}

.view-invoice-btn {
    padding: 6px 10px;
    background-color: #ff8c00; /* Dark Orange */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.view-invoice-btn:hover {
    background-color: #cc7000;
}