* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --error-color: #e74c3c;
    --success-color: #27ae60;
    --border-color: #ddd;
    --background-color: #f5f5f5;
    --text-color: #333;
}

body {
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

.container {
    display: flex;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
    gap: 2rem;
}

.input-section, .preview-section {
    flex: 1;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.required {
    color: var(--error-color);
}

input, textarea, button {
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-color);
}

input, textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    transition: border-color 0.3s;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
}

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

.file-input {
    padding: 0.5rem 0;
}

.logo-preview {
    max-width: 200px;
    max-height: 100px;
    margin: 1rem 0;
}

.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.service-item {
    border: 1px solid var(--border-color);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    position: relative;
}

.price-input {
    position: relative;
    display: inline-block;
    width: 150px;
}

.currency {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color);
}

.service-price {
    padding-left: 1.5rem;
}

.remove-service {
    position: absolute;
    right: 1rem;
    top: 1rem;
    background-color: var(--error-color);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
}

.btn-add {
    background-color: var(--success-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.export-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary:hover {
    background-color: #f8f9fa;
}

.error-message {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Preview Styles */
.proposal-preview {
    background: white;
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.preview-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.preview-logo img {
    max-width: 200px;
    max-height: 100px;
    object-fit: contain;
}

.preview-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    text-align: center;
}

.preview-client {
    white-space: pre-line;
    margin-bottom: 2rem;
}

.services-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.services-table th,
.services-table td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.services-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.services-total {
    font-weight: bold;
}

.services-total td:last-child {
    text-align: right;
}

.preview-terms {
    margin: 2rem 0;
}

.preview-terms h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.terms-content {
    white-space: pre-line;
}

.preview-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-style: italic;
    text-align: center;
}

.affiliate-banner {
    background: linear-gradient(135deg, #7928CA, #FF0080) !important;
    color: white !important;
    padding: 1.2rem;
    text-align: center;
    border-radius: 6px;
    margin: 1.5rem 0;
    font-size: 1.1rem;
    box-shadow: 0 3px 8px rgba(255, 0, 128, 0.25);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.affiliate-banner:hover {
    background: linear-gradient(135deg, #8A3FD1, #FF1493) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 0, 128, 0.3);
}

.affiliate-banner a {
    color: white !important;
    text-decoration: none;
    font-weight: 600;
    display: block;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    line-height: 1.4;
}

.affiliate-banner a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .affiliate-banner {
        width: 100%;
        margin: 1rem 0;
    }
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }

    .input-section,
    .preview-section {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .container {
        margin: 1rem;
        padding: 0;
    }

    .input-section,
    .preview-section {
        padding: 1rem;
    }

    .export-buttons {
        flex-direction: column;
    }

    .services-table {
        display: block;
        overflow-x: auto;
    }
}
