/* General Styles */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    margin: 0;
    padding: 20px;
}

.invoice-container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: #fff;
    padding: 30px;
    border: 1px solid #ccc;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.logo-container {
    width: 150px;
    height: 150px;
    border: 1px dashed #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#logo {
    max-width: 100%;
    max-height: 100%;
    cursor: pointer;
}

#logo-upload {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.invoice-header h1 {
    text-align: right;
    margin: 0;
    color: #007bff;
}

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

.invoice-details label {
    display: inline-block;
    width: 100px;
}

.invoice-details input {
    width: 150px;
    margin-bottom: 5px;
}

/* Party Details */
.party-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.from-details, .to-details {
    width: 48%;
}

.party-details h2 {
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.party-details input, .party-details textarea {
    width: 100%;
    margin-bottom: 5px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Items Section */
.items-section {
    margin-bottom: 20px;
}

#invoice-items {
    width: 100%;
    border-collapse: collapse;
}

#invoice-items th, #invoice-items td {
    border: 1px solid #ccc;
    padding: 8px;
    text-align: left;
}

#invoice-items th {
    background-color: #f2f2f2;
}

#add-item-btn {
    margin-top: 10px;
    padding: 8px 12px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Calculation Section */
.calculation-section {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.notes-terms, .summary {
    width: 48%;
}

.notes-terms textarea {
    width: 100%;
    height: 80px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

/* Footer */
footer {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ccc;
}

.signature-container {
    width: 200px;
    height: 100px;
    border: 1px dashed #ccc;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

#signature {
    max-width: 100%;
    max-height: 80%;
    cursor: pointer;
}

#signature-upload {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.bank-details {
    width: 50%;
}

/* Action Buttons */
.actions {
    text-align: center;
    margin-top: 20px;
}

.actions button {
    padding: 10px 20px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 0 10px;
}

@media (max-width: 768px) {
    .invoice-container {
        padding: 15px;
    }
    header, .party-details, .calculation-section, footer {
        flex-direction: column;
    }
    .logo-container, .from-details, .to-details, .notes-terms, .summary, .signature-container, .bank-details {
        width: 100%;
        margin-bottom: 15px;
    }
}
