/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Helvetica Neue', sans-serif;
    background-color: #e9ecef;
    color: #000;
    line-height: 1.6;
    padding: 20px 0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background-color: white;
    min-height: calc(100vh - 40px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Header Styles */
.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 40px 60px;
    position: relative;
}

.invoice-title {
    font-size: 4rem;
    font-weight: bold;
    color: #000;
    letter-spacing: 2px;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    position: relative;
}

.logo-section {
    background-color: #2c2c2c;
    padding: 20px 30px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.logo-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 30px 30px 0;
    border-color: transparent #dc3545 transparent transparent;
    z-index: 1;
}

.logo-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 20px 0 0 20px;
    border-color: transparent transparent transparent #dc3545;
    z-index: 1;
}

.logo-shape {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-direction: row;
}

.logo-shape::before {
    content: '';
    width: 50px;
    height: 35px;
    background: #dc3545;
    clip-path: polygon(0% 0%, 60% 0%, 100% 30%, 100% 100%, 40% 100%, 0% 70%);
    position: relative;
}

.logo-shape::after {
    content: '';
    position: absolute;
    left: 26px;
    top: 0;
    width: 24px;
    height: 35px;
    background: #2c2c2c;
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 70%);
    z-index: -1;
}

.logo-text-wrapper {
    display: flex;
    flex-direction: column;
}

.logo-text-top {
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.logo-text-bottom {
    color: #fff;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    font-weight: normal;
}

.invoice-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.invoice-detail-item {
    display: flex;
    gap: 10px;
}

.detail-label {
    color: #dc3545;
    font-weight: 600;
}

.detail-value {
    color: #000;
}

/* Main Content */
.main-content {
    padding: 30px 60px 40px;
}

/* Billing Section */
.billing-section {
    display: flex;
    justify-content: space-between;
    gap: 60px;
    margin-bottom: 30px;
}

.bill-by,
.bill-to {
    flex: 1;
}

.bill-label {
    color: #dc3545;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.bill-name {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #000;
}

.bill-address {
    color: #333;
    line-height: 1.8;
}

.bill-address div {
    margin-bottom: 2px;
}

/* Divider */
.divider {
    border: none;
    border-top: 1px solid #ddd;
    margin: 25px 0;
}

/* Descriptions Table */
.descriptions-section {
    margin: 30px 0;
}

.descriptions-table {
    width: 100%;
    border-collapse: collapse;
}

.descriptions-table thead {
    background-color: #f8f9fa;
}

.descriptions-table th {
    padding: 12px;
    text-align: center;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
}

.descriptions-table td {
    padding: 15px 12px;
    text-align: center;
    color: #333;
    border-bottom: 1px solid #eee;
}

.descriptions-table tbody tr:last-child td {
    border-bottom: none;
}

/* Summary Section */
.summary-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    margin: 30px 0;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    width: 250px;
    font-size: 1rem;
}

.summary-item.total {
    font-weight: bold;
    color: #dc3545;
    font-size: 1.2rem;
    margin-top: 5px;
}

.summary-item.total span:last-child {
    color: #dc3545;
}

/* Terms Section */
.terms-section {
    margin: 40px 0 30px;
}

.terms-title {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #000;
}

.terms-content {
    color: #333;
    line-height: 1.8;
}

.terms-content p {
    margin-bottom: 8px;
}

/* Bank Section */
.bank-section {
    margin: 30px 0;
}

.bank-title {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #000;
}

.bank-content {
    color: #333;
    line-height: 2;
}

.bank-item {
    display: flex;
    gap: 10px;
}

.bank-label {
    font-weight: 600;
    min-width: 150px;
}

.bank-value {
    color: #000;
}

/* Footer */
.invoice-footer {
    margin-top: 50px;
}

.electronic-note {
    text-align: center;
    color: #6c757d;
    font-size: 0.85rem;
    margin-bottom: 20px;
    font-style: italic;
}

.footer-bar {
    background-color: #2c2c2c;
    padding: 20px 40px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.footer-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 20px 20px 0 0;
    border-color: #dc3545 transparent transparent transparent;
}

.footer-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 20px 20px;
    border-color: transparent transparent #dc3545 transparent;
}

.footer-bar p {
    margin: 0;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

/* Form Page Styles */
.form-container {
    max-width: 800px;
    margin: 0 auto;
}

.form-title {
    font-size: 2rem;
    color: #dc3545;
    text-align: center;
    margin-bottom: 10px;
    font-weight: bold;
}

.form-description {
    text-align: center;
    color: #6c757d;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.invoice-form {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.form-section {
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 2px solid #e9ecef;
}

.form-section:last-of-type {
    border-bottom: none;
}

.section-title {
    font-size: 1.3rem;
    color: #2c2c2c;
    margin-bottom: 20px;
    font-weight: bold;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: bold;
    color: #495057;
    margin-bottom: 8px;
    font-size: 1rem;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background-color: #fff;
}

.form-input:focus {
    outline: none;
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-input:invalid {
    border-color: #dc3545;
}

/* Item Row Styles */
.item-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 15px;
    align-items: end;
    margin-bottom: 15px;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.btn-remove-item {
    padding: 8px 16px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: background-color 0.3s ease;
    height: fit-content;
}

.btn-remove-item:hover {
    background-color: #c82333;
}

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

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background-color: #dc3545;
    color: white;
}

.btn-primary:hover {
    background-color: #c82333;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 0;
        box-shadow: none;
    }
    
    .invoice-header {
        flex-direction: column;
        padding: 30px 20px;
    }

    .invoice-title {
        font-size: 2.5rem;
        margin-bottom: 20px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .billing-section {
        flex-direction: column;
        gap: 30px;
    }

    .summary-item {
        width: 100%;
    }

    .item-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .btn-remove-item {
        width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .invoice-title {
        font-size: 2rem;
    }
    
    .form-title {
        font-size: 1.5rem;
    }
    
    .invoice-form {
        padding: 20px;
    }

    .descriptions-table {
        font-size: 0.85rem;
    }

    .descriptions-table th,
    .descriptions-table td {
        padding: 8px 6px;
    }
}

