/* Invoice System Styles */

/* Invoice Overlay */
.invoice-overlay {
    position: fixed;
    z-index: 10001;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

.invoice-overlay-content {
	position: relative;
	width: 90%;
	max-width: 800px;
	margin: 50px auto;
	padding: 40px;
	background: rgba(32, 33, 36, 0.5);
	border-radius: 2.5px;
	color: #FFFFFF;
	overflow-x: hidden;
	backdrop-filter: blur(5px);
}

.close-invoice-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    background: transparent;
    border: none;
    color: #e8e8e8;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease-in-out;
}

.button-center button {
	background: #FFF;
	border: initial;
	border-radius: 5px;
	box-shadow: 0px 10px 10px rgba(0, 0, 0, 0.165);
}

.close-invoice-overlay:hover {
    opacity: 1;
}

/* Invoice Sections */
.invoice-section {
    margin-bottom: 30px;
}

.invoice-section h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #e8e8e8;
}

/* Invoice Lookup Form */
#invoice-lookup .form-group {
    margin-bottom: 20px;
}

#invoice-lookup-error {
    color: #FF1D4D;
    margin-bottom: 15px;
}

/* Invoice Searching Animation */
.searching-animation, .processing-animation {
    text-align: center;
    margin: 30px 0;
}

/* Invoice Details */
.invoice-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.invoice-logo {
    max-width: 120px;
    margin-bottom: 10px;
}

.company-info h3 {
    margin-bottom: 5px;
}

.company-info p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

.invoice-info table {
    margin-left: auto;
}

.invoice-info td {
    padding: 5px 0;
    padding-left: 15px;
}

.invoice-customer {
    margin-bottom: 30px;
}

.invoice-customer h4 {
    margin-bottom: 10px;
    color: #e8e8e8;
}

.invoice-customer p {
    margin: 0;
    line-height: 1.4;
}

/* Invoice Table */
.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    table-layout: fixed;
}

.invoice-table th, .invoice-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #BDC1C6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.invoice-table th:first-child, .invoice-table td:first-child {
    width: 10%;
}

.invoice-table th:nth-child(2), .invoice-table td:nth-child(2) {
    width: 50%;
}

.invoice-table th:nth-child(3), .invoice-table td:nth-child(3),
.invoice-table th:nth-child(4), .invoice-table td:nth-child(4) {
    width: 20%;
}

.invoice-table th {
    background-color: #606368;
    color: #e8e8e8;
}

.invoice-table tfoot td {
    border-bottom: none;
}

.text-right {
    text-align: right;
}

.total-row {
    font-size: 18px;
    color: #e8e8e8;
}

.total-row td {
    padding-top: 20px;
}

/* Invoice Actions */
.invoice-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.paid-status {
    display: inline-block;
    padding: 10px 20px;
    background-color: #00c8aa;
    color: #e8e8e8;
    font-weight: bold;
    border-radius: 5px;
    margin-bottom: 15px;
}

.invoice-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    width: 100%;
    flex-wrap: wrap;
}

.action-btn {
    background: #202124;
    background: -webkit-linear-gradient(to right, #BDC1C6, #202124);
    background: linear-gradient(to right, #BDC1C6, #202124);
    color: #e8e8e8;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 5px;
    cursor: pointer;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.action-btn:hover {
    opacity: 0.9;
}

/* Payment Form */
.payment-toggle {
    display: flex;
    margin-top: 20px;
    margin-bottom: 20px;
}

.service-description h4 {
	color: #e8e8e8;
}

.payment-toggle label {
    margin-right: 20px;
    cursor: pointer;
    padding: 10px 15px;
    border: 1px solid #606368;
    border-radius: 5px;
    transition: all 0.2s ease-in-out;
}

.payment-toggle label:hover {
    background-color: rgba(99, 110, 114, 0.3);
}

.payment-toggle input[type="radio"] {
    margin-right: 5px;
}

.payment-toggle input[type="radio"]:checked + span {
    color: #606368;
    font-weight: bold;
}

/* Card Types */
.card-types {
    display: flex;
    margin-top: 5px;
    margin-bottom: 5px;
}

.card-type-icon {
    height: 24px;
    margin-right: 2.5px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.card-type-icon:hover {
    opacity: 1;
}

/* Field Error */
.field-error {
    color: #FF1D4D;
    font-size: 12px;
    margin-top: 5px;
}

/* Required Field */
.required-field {
    color: #AAAAAA;
    font-size: 11px;
    margin-top: 3px;
}

/* Billing Details */
.billing-details {
    margin-top: 20px;
    margin-bottom: 20px;
    border-top: 1px solid #BDC1C6;
    padding-top: 15px;
}

.billing-details h4 {
    margin-bottom: 15px;
    color: #e8e8e8;
}

.form-group.third {
    width: 32%;
}

/* Button Center */
.button-center {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* Expiry Date Fields */
.expiry-group {
    flex: 1;
}

.cvc-group {
    flex: 0.5;
}

.expiry-inputs {
    display: flex;
    align-items: center;
}

.expiry-inputs input {
    width: 50px;
    text-align: center;
}

.expiry-separator {
    margin: 0 5px;
    color: #e8e8e8;
}

/* Card Details Row */
.card-details-row {
    flex-wrap: nowrap;
}

/* Address Row */
.address-row {
    flex-wrap: nowrap;
    justify-content: space-between;
}

.address-row .form-group {
    margin-right: 5px;
}

.address-row .form-group:last-child {
    margin-right: 0;
}

/* Save Payment Checkbox */
.save-payment-group {
    margin-top: 20px;
    margin-bottom: 20px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-container input {
    margin-right: 10px;
}

.checkbox-text {
    color: #EFEFEF;
}

/* Payment Error Buttons */
.payment-error-buttons {
    display: flex;
    justify-content: center;
    gap: 5px;
}

/* Card Payment Form */
#card-payment-form .form-group {
    margin-bottom: 20px;
}

#card-payment-form label {
    display: block;
    margin-bottom: 5px;
    color: #EFEFEF;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-group.half {
    width: 50%;
}

#card-payment-error {
    color: #FF1D4D;
    margin-bottom: 15px;
}

/* ACH/Wire Payment Section */
.bank-details {
    width: 100%;
    margin: 20px 0;
}

.bank-details td {
    padding: 8px 0;
}

.bank-details td:first-child {
    width: 40%;
}

.note {
    font-style: italic;
    margin-top: 20px;
    color: #EFEFEF;
}

/* Payment Error */
.error-icon {
    text-align: center;
    margin: 30px 0;
    color: #FF1D4D;
}

.error-message {
    color: #FF1D4D;
    text-align: center;
    margin-bottom: 20px;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* Responsive Adjustments */
@media only screen and (max-width: 768px) {
    .invoice-overlay-content {
        padding: 20px;
        margin: 20px auto;
        width: 95%;
        max-width: 100%;
    }
    
    .invoice-header {
        flex-direction: column;
    }
    
    .invoice-info {
        margin-top: 20px;
    }
    
    .invoice-info table {
        margin-left: 0;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-group.half {
        width: 100%;
    }
    
    .error-actions {
        flex-direction: column;
    }
    
    .error-actions button {
        margin-bottom: 10px;
    }
    
    .invoice-buttons {
        flex-direction: row;
    }
    
    .invoice-table {
        display: block;
        overflow-x: auto;
        white-space: normal;
        -webkit-overflow-scrolling: touch;
        font-size: 14px;
    }
    
    .invoice-table th, 
    .invoice-table td {
        padding: 8px 6px;
        font-size: 14px;
    }
    
    .invoice-table th:first-child, .invoice-table td:first-child {
        width: 40px;
        min-width: 40px;
    }
    
    .invoice-table th:nth-child(2), .invoice-table td:nth-child(2) {
        min-width: 120px;
    }
    
    .invoice-table th:nth-child(3), .invoice-table td:nth-child(3),
    .invoice-table th:nth-child(4), .invoice-table td:nth-child(4) {
        min-width: 80px;
    }
}
