/* General Styles */
body {
    font-family: Arial, sans-serif;
    background: #f7f7f7;
    margin: 0;
    padding: 0;
}

.wp-invoice-container {
    max-width: 900px;
    margin: 20px auto;
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Business Header Styles */
.wp-invoice-header-business {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ccc;
}

.business-logo {
    flex: 0 0 auto;
    margin-right: 20px;
}

.business-logo img {
    max-width: 150px;
    height: auto;
    border-radius: 4px;
}

.business-details {
    flex: 1 1 auto;
}

.business-details h1 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.business-details p {
    margin: 2px 0;
    color: #555;
}

/* Client Section */
.client-section {
    margin-bottom: 20px;
}

.client-selector label {
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

.client-details-container {
    display: flex;
    flex-wrap: wrap;
    border: 1px solid #ccc;
    padding: 10px;
    margin-top: 10px;
    background: #f9f9f9;
}

.client-details-left, .client-details-right {
    flex: 1;
    min-width: 300px;
    padding: 10px;
}

.client-details-left p, .client-details-right p {
    margin: 5px 0;
}

/* Invoice Header (Form Title) */
.wp-invoice-header h2 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

/* Form Styles */
.wp-invoice-form .form-group {
    margin-bottom: 15px;
}

.wp-invoice-form label {
    display: block;
    margin-bottom: 5px;
    color: #555;
}

.wp-invoice-form input[type="text"],
.wp-invoice-form input[type="date"],
.wp-invoice-form input[type="number"],
.wp-invoice-form select,
.wp-invoice-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.wp-invoice-form textarea {
    resize: vertical;
}

/* Two-column layout for date fields */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.form-row .form-group.half {
    flex: 1;
}

/* Invoice Items Table */
.invoice-items h3 {
    margin-top: 30px;
    color: #333;
}

#invoice-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

#invoice-items-table th,
#invoice-items-table td {
    border: 1px solid #ccc;
    padding: 10px;
    text-align: center;
}

#invoice-items-table th {
    background: #f0f0f0;
}

#invoice-items-table input[type="text"],
#invoice-items-table input[type="number"] {
    width: 90%;
    padding: 5px;
    border: 1px solid #aaa;
    border-radius: 3px;
}

/* Buttons */
button, input[type="submit"] {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

button:hover, input[type="submit"]:hover {
    background: #005177;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }

    #invoice-items-table th,
    #invoice-items-table td {
        padding: 8px;
    }

    .client-details-container {
        flex-direction: column;
    }
}

/* General Container & Header */
.wp-invoice-container {
    max-width: 1200px;
    margin: 30px auto;
    background: #fff;
    padding: 20px 30px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 5px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.wp-invoice-header h2 {
    margin: 0 0 20px;
    font-size: 28px;
    color: #333;
    text-align: center;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

/* Table Styles */
.wp-invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 14px;
}

.wp-invoice-table thead tr {
    background: #0073aa;
    color: #fff;
}

.wp-invoice-table thead th {
    padding: 12px 15px;
    text-align: left;
}

.wp-invoice-table tbody tr {
    border-bottom: 1px solid #e5e5e5;
    transition: background-color 0.3s ease;
}

.wp-invoice-table tbody tr:hover {
    background-color: #f9f9f9;
}

.wp-invoice-table tbody td {
    padding: 10px 15px;
    vertical-align: middle;
    color: #555;
}

/* Dropdown Styles */
.invoice-actions {
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background-color: #fff;
    color: #333;
    font-size: 13px;
    cursor: pointer;
}

/* Custom DataTables Overrides */
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #ccc;
    padding: 6px 10px;
    border-radius: 3px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    background-color: #0073aa;
    color: #fff !important;
    border: none;
    padding: 6px 12px;
    border-radius: 3px;
    margin: 0 2px;
    cursor: pointer;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background-color: #005177;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .wp-invoice-container {
        padding: 15px;
    }
    .wp-invoice-header h2 {
        font-size: 24px;
    }
    .wp-invoice-table thead th,
    .wp-invoice-table tbody td {
        padding: 8px 10px;
    }
}
