*:root {
    --primary-color: #a855f7;
    --secondary-color: #7c3aed;
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --form-bg: rgba(255, 255, 255, 0.05);
    --input-bg: rgba(255, 255, 255, 0.1);
    --border-color: rgba(255, 255, 255, 0.2);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
    color: white;
    min-height: 100vh;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Invoice Preview Section */
.invoice-section {
    flex: 1;
    padding: 30px;
    background: var(--bg-secondary);
    overflow-y: auto;
}

/* Form Section */
.form-section {
    width: 400px;
    padding: 30px;
    background: rgba(26, 26, 46, 0.95) !important;
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.2) !important;
    overflow-y: auto;
    color: white !important;
}

.form-section h1 {
    color: white !important;
    margin-bottom: 30px;
    text-align: center;
    font-size: 28px;
}

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

.form-group h3 {
    color: white !important;
    margin-bottom: 15px;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input, textarea, select {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white !important;
    font-size: 14px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.form-group textarea {
    height: 80px;
    resize: vertical;
}

.item-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.item-description {
    flex: 2;
}

.item-price {
    flex: 1;
}

.remove-item {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Logo Upload Styles */
.logo-upload-section {
    margin-bottom: 15px;
}

.logo-upload-label {
    cursor: pointer;
    display: block;
}

.logo-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--form-bg);
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.logo-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(168, 85, 247, 0.1);
}

.logo-upload-area.has-image {
    border: 2px solid var(--primary-color);
    padding: 10px;
}

.upload-text {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 14px;
    display: block;
    margin-bottom: 5px;
}

.upload-subtext {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

.logo-preview {
    max-width: 100%;
    max-height: 80px;
    border-radius: 5px;
}

.remove-logo-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 10px;
}

.remove-logo-btn:hover {
    background: #dc2626;
}

/* Payment Terms Styles */
.payment-term-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.payment-term {
    flex: 1;
}

.remove-term {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#addPaymentTerm {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
}

#addItem {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

.form-actions button {
    flex: 1;
    padding: 15px;
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.form-actions button:hover {
    background: #9333ea;
}

/* Invoice Section */
.invoice-section {
    flex: 1;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 40px;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.invoice-preview {
    width: 796px;
    min-height: fit-content;
    height: auto;
    background: white;
    padding: 30px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    margin: 0 auto;
    color: black;
    border: none;
}

/* Brand-specific backgrounds */
.invoice-preview.elite-brand {
    background: linear-gradient(180deg, rgba(24, 24, 24, 1) 0%, rgba(56, 56, 56, 1) 100%) !important;
    color: white !important;
}

.invoice-preview.steller-brand {
    background: white !important;
    color: black !important;
    border: 3px solid #000 !important;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2) !important;
    outline: 2px solid #333 !important;
}

.invoice-preview.omni-brand {
    background: rgba(22, 33, 62, 0.9) !important;
    color: white !important;
}

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

.company-info {
    display: block;
    align-items: flex-start;
    gap: 20px;
    flex: 1;
}

.logo {
    padding: 0;
    border-radius: 10px;
    text-align: center;
    width: 200px;
    height: 90px;
}

.logo-text {
    font-size: 24px;
    font-weight: bold;
    color: white;
    letter-spacing: 2px;
}

.logo-subtitle {
    font-size: 12px;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 5px;
    letter-spacing: 1px;
}

.company-details {
    margin-top: 10px;
}

.company-name {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 5px;
}

.company-email,
.company-address {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

.invoice-info {
    text-align: right;
    flex: 1;
    max-width: 300px;
}

.invoice-info h1 {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 10px;
    letter-spacing: 3px;
}

.invoice-number {
    font-size: 16px;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.9);
}

.invoice-dates {
    margin-bottom: 30px;
    font-size: 14px;
    line-height: 1.6;
}

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

.bill-to-label {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 16px;
}

.bill-to div:not(.bill-to-label) {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

/* Invoice Table */
.invoice-table {
    margin-bottom: 40px;
}

.table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.table-header > div {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    padding: 15px 20px;
    border-radius: 25px;
    text-align: center;
    font-weight: 500;
    font-size: 16px;
}

.table-body {
    margin-bottom: 30px;
}

.table-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.table-row .description {
    font-size: 16px;
    line-height: 1.4;
}

.table-row .price,
.table-row .total {
    text-align: center;
    font-size: 16px;
    font-weight: bold;
}

.table-footer {
    display: flex;
    justify-content: flex-end;
}

.totals {
    min-width: 300px;
}

.totals > div {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 16px;
}

.subtotal-row,
.tax-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.grand-total-row {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    padding-top: 15px;
}

/* Payment Section */
.payment-section {
    margin-top: 40px;
    display: flex;
    gap: 40px;
}

.payment-info {
    flex: 1;
}

.payment-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 15px 25px;
    border-radius: 25px;
    font-weight: 500;
    font-size: 16px;
    display: inline-block;
    margin-bottom: 20px;
}

.payment-details {
    margin-left: 10px;
}

.payment-details > div {
    margin-bottom: 8px;
    font-size: 16px;
    line-height: 1.4;
}

.payment-details strong {
    font-weight: 600;
    min-width: 120px;
    display: inline-block;
}

.payment-details span {
    font-weight: normal;
}

/* Checkbox Styles */
.checkbox-container {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.checkbox-container label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    cursor: pointer;
}

/* Brand Selection Styles */
#brandSelect {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 14px;
}
.invoice-preview.steller-brand .bill-to div:not(.bill-to-label) {
    color: #000 !important;
}

.invoice-preview.steller-brand .payment-header {
    color: #fff !important;
}

.invoice-preview.steller-brand .payment-terms-header {
    color: #fff !important;
}

.invoice-preview.steller-brand .table-row {
    border-color: #000000 !important;
}

.invoice-preview.steller-brand .subtotal-row {
    border-color: #000000 !important;
}

.invoice-preview.steller-brand .tax-row {
    border-color: #000 !important;
}

.invoice-preview.steller-brand .grand-total-row {
    border-color: #000 !important;
}
#brandSelect option {
    background: #1a1a2e;
    color: white;
}

#manageBrands {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 15px;
}

/* Color Theme Styles */
.color-theme-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.color-theme-section h4 {
    color: white !important;
    margin-bottom: 15px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.color-inputs {
    display: flex;
    gap: 15px;
}

.color-input-group {
    flex: 1;
}

.color-input-group label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    margin-bottom: 5px;
}

.color-input-group input[type="color"] {
    width: 100%;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

/* Brand Modal Styles */
.brand-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.brand-modal-content {
    background: var(--bg-tertiary);
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.brand-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-modal-header h2 {
    color: var(--primary-color);
    margin: 0;
    font-size: 20px;
}

.close-modal {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: white;
}

.brand-modal-body {
    padding: 25px;
}

.brand-list {
    margin-bottom: 20px;
}

.brand-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-info h4 {
    color: white;
    margin: 0 0 5px 0;
    font-size: 16px;
}

.brand-info p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 8px 0;
    font-size: 14px;
}

.brand-colors {
    display: flex;
    gap: 5px;
}

.color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.brand-actions {
    display: flex;
    gap: 10px;
}

.brand-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    background: var(--primary-color);
    color: white;
}

.brand-actions .delete-btn {
    background: #ef4444;
}

.add-brand-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

/* Payment Terms */
.payment-terms {
    flex: 1;
}

.payment-terms-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 15px 25px;
    border-radius: 25px;
    font-weight: 500;
    font-size: 16px;
    display: inline-block;
    margin-bottom: 20px;
}

.payment-terms-list {
    margin-left: 10px;
}

.payment-terms-list > div {
    margin-bottom: 8px;
    font-size: 16px;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        flex-direction: column;
    }
    
    .form-section {
        width: 100%;
        max-height: 50vh;
    }
    
    .invoice-section {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .table-header,
    .table-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .table-header > div {
        border-radius: 15px;
        padding: 10px 15px;
    }
    
    .company-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .logo {
        align-self: flex-start;
    }
    
    .invoice-info h1 {
        font-size: 36px;
    }
    
    .form-actions {
        flex-direction: column;
    }
}
