/* Basic Reset and Font Setup */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Color Palette: 
   Primary/Accent: #4a90e2 (Mild Blue)
   Secondary Text: #6c757d (Gray for values)
   Light Background: #eaf3ff (Very Pale Blue/Sky)
   Card Background: #f6f9fc (Off White/Lightest Gray)
   Border: #c7d8ee (Light Blue Gray)
*/
body {
    font-family: 'Noto Sans Bengali', sans-serif;
    background-color: #eaf3ff; /* Lighter background color */
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

/* Main Container Styling */
.container {
    max-width: 900px;
    margin: 0 auto;
    background-color: #ffffff;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); /* Softer shadow */
    border-radius: 12px;
}

/* Header Styling */
.header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.govt-logo, .union-logo {
    width: 80px; 
    height: auto;
    flex-shrink: 0;
}

.header-text {
    flex-grow: 1;
    text-align: center;
    padding: 0 10px;
}

.union-name {
    color: #4a90e2; /* Mild Blue accent color */
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.header p {
    font-size: 1rem;
    color: #555;
    margin-bottom: 10px;
}

.contact-info a {
    color: #4a90e2; 
    text-decoration: none;
    font-size: 0.9rem;
}

.contact-info span {
    color: #999;
}

hr {
    border: 0;
    height: 1px;
    background: #c7d8ee; /* Light blue-gray line */
    margin: 20px 0;
}

/* QR Code Section Styling */
.qr-section {
    text-align: right; /* Align QR code to the right side of the page */
    margin-bottom: 20px;
}

.qr-code-img {
    width: 100px; 
    height: 100px;
    border: 3px solid #f6f9fc; /* Light border around the code */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.qr-section p {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 5px;
}

/* Section Title Styling */
.section-title {
    font-size: 1.4rem;
    color: #333;
    border-left: 5px solid #4a90e2; /* Blue accent border */
    padding-left: 10px;
    margin: 30px 0 15px 0;
    font-weight: 600;
}

/* Information Card (Grid) Styling */
.info-card {
    display: grid;
    grid-template-columns: 1fr; 
    gap: 15px;
    padding: 15px;
    background-color: #f6f9fc; /* Very light background for card */
    border-radius: 8px;
    border: 1px solid #c7d8ee; /* Soft border */
}

.info-item {
    padding: 10px 15px;
    background-color: #ffffff;
    border: 1px solid #e0eaf6; /* Slightly lighter border */
    border-radius: 6px;
    font-size: 1rem;
}

/* --- Content Coloring --- */
.label-color {
    color: #4a90e2; /* Blue for the labels */
    font-weight: 600;
    margin-right: 5px;
}

.value-color {
    color: #343a40; /* Darker grey for the actual data/values */
    font-weight: 500;
}

/* Ensure display properties are correct for responsiveness */
.info-item strong {
    display: block; /* Makes the label take its own line on mobile */
    margin-bottom: 2px;
}

@media (min-width: 576px) {
    .info-item strong {
        display: inline; /* Label next to value on wider screens */
        margin-bottom: 0;
    }
}
/* ------------------------- */


/* Tax Table Styling */
.tax-details table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.tax-details th, .tax-details td {
    border: 1px solid #c7d8ee;
    padding: 12px;
    text-align: center;
    font-size: 1rem;
}

.tax-details th {
    background-color: #4a90e2; /* Blue header background */
    color: white;
    font-weight: 600;
}

.tax-details td {
    background-color: #fff;
}

.tax-details tr:nth-child(even) {
    background-color: #f6f9fc; /* Alternating row color */
}

/* Specific styling for 'Bokeya' (Due) column */
.due {
    font-weight: 700;
    color: #e57373; /* Slightly softer red color for outstanding amount */
}

.due-value {
    color: #e57373; /* Apply red color to the value too */
}


/* --- Responsive Design (Media Queries) --- */

@media (max-width: 768px) {
    .logo-container {
        flex-direction: column;
    }
    .govt-logo, .union-logo {
        margin-bottom: 10px;
    }
    .header-text {
        padding: 0;
    }
    .union-name {
        font-size: 1.6rem;
    }
}


@media (min-width: 576px) {
    .info-card {
        grid-template-columns: repeat(2, 1fr); 
    }
    
    .customer-details .info-item:nth-child(1),
    .customer-details .info-item:nth-child(2) {
        grid-column: span 2;
    }
}

@media (min-width: 992px) {
    .union-name {
        font-size: 2.2rem;
    }
    
    .info-card {
        grid-template-columns: repeat(3, 1fr); 
    }
    
    .customer-details .info-item:nth-child(1),
    .customer-details .info-item:nth-child(2) {
        grid-column: span 1; 
    }

    .customer-details .info-item:nth-child(6) {
        grid-column: span 3; 
    }
    
    .household-details {
        grid-template-columns: repeat(2, 1fr); 
    }

    .govt-logo, .union-logo {
        width: 100px;
    }
}

/* -------------------------------------------------------------------------- */
/* PRINT STYLES */
/* -------------------------------------------------------------------------- */

@media print {
    /* 1. Page Setup for A4 */
    @page {
        size: A4;
        margin: 1.5cm;
    }
	
	/* -------------------------------------------------------------------------- */
/* PRINT STYLES */
/* -------------------------------------------------------------------------- */

@media print {
    /* 1. Page Setup for A4 */
    @page {
        size: A4;
        margin: 1.5cm;
    }
    
    /* ... (অন্যান্য প্রিন্ট স্টাইল) ... */
    
    /* QR Code specific print style: Move to top-right corner */
    .qr-section {
        position: absolute;
        top: 0.5cm; /* Adjusted for A4 margin */
        right: 0.5cm; /* Adjusted for A4 margin */
        text-align: center;
        margin: 0;
    }
    
    .qr-code-img {
        width: 80px; 
        height: 80px;
        box-shadow: none;
    }
    
    .qr-section p {
        font-size: 0.7rem;
        color: #000 !important;
    }
    
    /* ... (বাকি প্রিন্ট স্টাইল) ... */
}

    /* 2. Hide unnecessary elements on print */
    body {
        background-color: #fff !important; 
        padding: 0;
        margin: 0;
    }
    
    .container {
        box-shadow: none !important; 
        border-radius: 0;
        padding: 0;
        max-width: 100%;
        width: 100%;
    }

    /* 3. Ensure text and structure are clear */
    .union-name, .section-title, .label-color, .value-color {
        color: #000 !important; /* Force black for all text for optimal printing */
        font-weight: 500;
    }

    .info-item strong {
        font-weight: 600; /* Labels slightly bolder on print */
    }

    .contact-info a {
        color: #333 !important; 
        text-decoration: none !important;
    }

    /* Ensure tables and grids print correctly */
    .info-card {
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }

    .info-item {
        border: none;
        background-color: #fff;
        padding: 5px 10px;
    }

    .tax-details table {
        border-collapse: collapse;
        width: 100%;
    }

    .tax-details th, .tax-details td {
        border: 1px solid #000;
        padding: 8px;
    }

    .tax-details th {
        background-color: #f0f0f0; 
        color: #000;
    }
    
    .due-value {
        color: #000 !important; /* Change red to black on print */
    }
}