* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
    gap: 20px;
    padding: 20px;
    box-sizing: border-box;
}

.form-section {
    width: 400px;
    flex-shrink: 0;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: calc(100vh - 40px);
    overflow-y: auto;
}

.preview-section {
    flex: 1;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px);
}

h1 {
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
}

.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.header-section h1 {
    margin-bottom: 0;
    text-align: left;
}

.logout-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.logout-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.logout-button:active {
    transform: translateY(0);
}

h3 {
    color: #34495e;
    margin: 20px 0 15px 0;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

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

.form-group:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

input, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 15px;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.invoice-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    border-left: 4px solid #3498db;
}

.remove-item {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

.remove-item:hover {
    background: #c0392b;
}

#addItem {
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

#addItem:hover {
    background: #229954;
}

/* Invoice Preview Styles */
.invoice-preview-iframe {
    width: 100%;
    height: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.invoice-preview {
    background: white;
    padding: 40px;
    font-family: Arial, sans-serif;
    font-size: 12px;
    line-height: 1.4;
    color: #000;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.invoice-content {
    flex: 1;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
}

.sender-info {
    flex: 1;
}

.sender-name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
}

.sender-address {
    font-size: 11px;
    line-height: 1.3;
    margin-bottom: 15px;
}

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

.invoice-number {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.invoice-dates {
    font-size: 11px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.recipient-section {
    margin-bottom: 40px;
}

.recipient-info {
    margin-bottom: 20px;
}

.customer-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    font-size: 11px;
}

.invoice-title-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    margin-top: 20px;
}

.invoice-title {
    font-size: 16px;
    font-weight: bold;
}

.invoice-dates {
    font-size: 11px;
    line-height: 1.5;
    text-align: right;
}

.greeting {
    margin-bottom: 15px;
    font-size: 12px;
}

.invoice-intro {
    margin-bottom: 25px;
    font-size: 12px;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    font-size: 11px;
}

.invoice-table th {
    background-color: #f0f0f0;
    padding: 8px;
    text-align: left;
    border: 1px solid #ddd;
    font-weight: bold;
}

.invoice-table td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: right;
}

.invoice-table td:first-child,
.invoice-table td:nth-child(2) {
    text-align: left;
}

.totals-section {
    margin-left: auto;
    width: 300px;
    margin-top: 20px;
    margin-bottom: 30px;
    text-align: right;
    font-size: 11px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 9px;
}

.total-row.final {
    font-weight: bold;
    border-top: 1px solid #000;
    border-bottom: 3px double #000;
    padding-top: 8px;
    margin-top: 10px;
}

.tax-note {
    margin-top: 15px;
    font-size: 10px;
    font-style: italic;
}

.tax-note-right {
    text-align: right;
    margin-top: 10px;
    font-size: 10px;
    font-style: italic;
}

.payment-terms {
    margin-bottom: 20px;
    font-size: 11px;
}

.bank-transfer-note {
    margin-bottom: 30px;
    font-size: 11px;
}

.closing {
    margin-bottom: 30px;
    font-size: 12px;
}

.footer {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #ddd;
    padding-top: 20px;
    font-size: 9px;
    margin-top: auto;
}

.footer-section {
    flex: 1;
}

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

.recipient-name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
}

.recipient-address {
    font-size: 11px;
    line-height: 1.3;
}

@media print {
    body {
        background: white;
    }
    
    .container {
        display: block;
    }
    
    .form-section {
        display: none;
    }
    
    .preview-section {
        box-shadow: none;
        padding: 0;
        margin: 0;
    }
    
    .invoice-preview {
        padding: 20px;
    }
}

@media (max-width: 900px) {
    body {
        height: auto;
        overflow: auto;
    }
    
    .container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    .form-section {
        width: 100%;
        height: auto;
        max-height: none;
    }
    
    .preview-section {
        height: 650px;
        min-height: 400px;
    }
    
    .invoice-preview-iframe {
        height: 650px;
    }
} 