/* General Styles */
body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #e0e7ff, #f4f7f9);
    margin: 0;
    padding: 20px;
    color: #333;
}

/* Billing Container */
.billing-container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
 
    padding: 40px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}



/* Logo */
.logo img {
    height: 80px;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.2));
}

/* Heading Styles */
h2, h3, h4 {
    color: #033466;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    width: 100%;
}

/* Form Section */
.form-section {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 20px;
    flex: 1 1 48%;
    margin: 10px 0;
    transition: transform 0.3s ease;
    box-sizing: border-box; /* Ensure padding doesn't affect width */
    max-width: 100%; /* Ensure it doesn't exceed the container width */
}

/* Hover effect */
.form-section:hover {
    transform: scale(1.01);
}

/* Input Styles */
label {
    font-weight: bold;
    color: #003366;
}

input[type="text"], input[type="number"], input[type="date"], textarea, select {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #fff;
    transition: border 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box; /* Prevent padding from breaking layout */
}

/* Focused input styles */
input:focus, textarea:focus, select:focus {
    border-color: #003366;
    box-shadow: 0 0 10px rgba(0, 51, 102, 0.2);
    outline: none;
}

/* Button Styles */
button {
    background: linear-gradient(135deg, #003366, #00509e);
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    font-size: 14px;
    margin-top: 10px;
}

button:hover {
    background: linear-gradient(135deg, #004080, #0060bf);
    transform: translateY(-3px);
}

button:active {
    transform: translateY(1px);
}

/* Table Styles */
table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
}

th {
    background: #003366;
    color: white;
    padding: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 8px 8px 0 0;
}

td {
    background: #ffffff;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Responsive Styles for Mobile */
@media (max-width: 768px) {
    .form-section {
        flex: 1 1 100%; /* Take up full width on smaller screens */
        margin: 10px 0;
        padding: 10px; /* Adjust padding for smaller screens */
        box-sizing: border-box; /* Prevent overflow */
    }

    table {
        font-size: 14px; /* Adjust table font size for mobile */
    }

    th, td {
        padding: 8px; /* Reduce padding for table cells */
    }

    button {
        width: 100%; /* Make buttons full width on mobile */
        padding: 12px;
        margin-top: 15px;
    }

    input[type="text"], input[type="number"], input[type="date"], textarea, select {
        font-size: 14px; /* Smaller font size for inputs */
    }
}

/* Additional responsiveness for very small screens (mobile portrait) */
@media (max-width: 480px) {
    .form-section {
        padding: 15px; /* Reduce padding for very small screens */
    }

    input[type="text"], input[type="number"], input[type="date"], textarea, select {
        padding: 8px; /* Adjust padding for smaller screens */
    }

    table {
        font-size: 12px; /* Smaller font size for very small screens */
    }

    button {
        padding: 12px 18px;
        font-size: 14px;
    }
}

/* Style for the container that will allow horizontal scroll */
.goods-table-container {
    width: 100%;
    overflow-x: auto; /* Enable horizontal scroll if the table exceeds the container width */
    -webkit-overflow-scrolling: touch; /* For smooth scrolling on iOS devices */
    margin-bottom: 10px; /* Add some space below the table */
}

/* Table Styles */
table {
    width: 100%;
    margin: 10px 0;
    border-collapse: collapse;
    table-layout: fixed; /* Ensures the table will respect its width */
}

/* Header Styling */
th, td {
    border: 1px solid black;
    padding: 8px;
    text-align: center;
}

th {
    background-color: #003366;
    color: white;
}

/* Button Styles */
button {
    background: linear-gradient(135deg, #003366, #00509e);
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    font-size: 14px;
    margin-top: 10px;
}

button:hover {
    background: linear-gradient(135deg, #004080, #0060bf);
    transform: translateY(-3px);
}

button:active {
    transform: translateY(1px);
}

/* Mobile view: Apply to devices with max width of 768px */
@media (max-width: 768px) {
    /* Ensure the table can scroll horizontally on smaller screens */
    .goods-table-container {
        margin-left: -10px;
        margin-right: -10px; /* Reduce container margins for mobile */
    }

    table {
        width: 100%;
        min-width: 600px; /* Prevent table from shrinking too much */
    }

    /* Resize the button for better mobile UX */
    button {
        width: 100%; /* Make the button full-width on mobile */
        padding: 15px; /* Larger padding for easier tapping */
        font-size: 16px; /* Increase font size for better readability */
    }

    /* Optional: Adjust padding and margins for better spacing */
    .form-section {
        padding: 15px;
    }

    th, td {
        font-size: 14px; /* Smaller font size for better fitting */
        padding: 6px; /* Adjust padding for mobile screens */
    }
}


/* Style for the form buttons */
.form-buttons {
    display: flex;                /* Display buttons in a row */
    justify-content: space-between; /* Space buttons evenly across the row */
    gap: 10px;                    /* Add space between buttons */
    width: 100%;
    margin-top: 20px;             /* Space between table and buttons */
    flex-wrap: wrap;              /* Allow buttons to wrap on smaller screens */
}

/* Button Styling */
.form-buttons button {
    background: linear-gradient(135deg, #003366, #00509e);
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    font-size: 14px;
    flex-grow: 1;                 /* Allow buttons to grow and fill the space */
    min-width: 150px;             /* Ensure buttons do not become too small */
}

.form-buttons button:hover {
    background: linear-gradient(135deg, #004080, #0060bf);
    transform: translateY(-3px);
}

.form-buttons button:active {
    transform: translateY(1px);
}

/* Button Styling for the 'New Bill' button */
.new-bill-btn {
    background: linear-gradient(135deg, #ff9900, #ff6600);
    color: white;
}

/* General Styling for Bill Preview */
.bill-preview {
    border: 1px solid #003366;
    padding: 20px;
    margin-top: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff, #e6f7ff);
    box-shadow: 0 6px 20px rgba(0, 51, 102, 0.1);
    width: 100%; /* Ensure full width for responsiveness */
    box-sizing: border-box; /* Include padding and border in the width */
    overflow-x: auto; /* Add horizontal scrolling if necessary */
}

.total {
    font-weight: bold;
    text-align: right;
    margin-top: 30px;
    font-size: 18px;
    color: #00509e;
}

/* Company Details Table */
.company-details {
    width: 100%; /* Use full width */
    margin: 20px 0;
    border-collapse: collapse;
    overflow-x: auto; /* Ensure no horizontal scrolling issues */
}

.company-details td, .company-details th {
    padding: 5px;
    vertical-align: top;
    text-align: left;
    border: 1px solid #ccc; /* Add border for better structure */
}

.company-details th {
    text-align: center;
    font-weight: bold;
    background-color: #f4f4f4;
}

/* Row Container */
.row-container {
    display: flex; /* Use flex for responsiveness */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    width: 100%; /* Full width */
    padding: 5px;
    box-sizing: border-box;
    justify-content: space-between;
    align-items: center; /* Align items for better vertical spacing */
    gap: 10px; /* Space between items */
}

.row-container .left, .row-container .center, .row-container .right {
    flex: 1 1 100%; /* Make sections stack by default */
    padding: 10px;
    text-align: center; /* Center-align text */
}

/* Adjust Layout for Larger Screens */
@media (min-width: 768px) {
    .row-container .left, .row-container .center, .row-container .right {
        flex: 1 1 33%; /* Three sections in a row */
        text-align: left; /* Reset alignment for larger screens */
    }
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px; /* Limit width for large screens */
}

/* Print Styling */
@media print {
    .bill-preview {
        border: 1px solid black; /* Print-friendly borders */
        box-shadow: none; /* Remove shadow for printing */
    }

    .company-details td, .company-details th {
        font-size: 12pt;
        border: 1px solid black;
    }

    .row-container {
        display: table;
        width: 100%;
    }

    .row-container div {
        display: table-cell;
        width: 33.33%;
        padding: 5px;
    }
}

/* Table Styling */
.responsive-table-container table {
    width: 100%; /* Table fits within the container width */
    table-layout: auto; /* Let the table adjust based on content */
    border-collapse: collapse; /* Collapse borders for a cleaner look */
    border: 1px solid black; /* Add a border for clarity */
}

.responsive-table-container td {
    border: 1px solid black;
    padding: 8px; /* Default padding for desktop */
    text-align: left;
    font-size: 16px; /* Default font size for desktop */
    box-sizing: border-box;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .responsive-table-container td {
        padding: 4px; /* Reduce padding for smaller screens */
        font-size: 12px; /* Reduce font size to fit content */
    }
}
.error {
    border: 2px solid red;
}
