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

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background: #2b3029;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    position: relative;
    padding-top: 70px;
}

.header-logo {
    position: absolute;
    top: 0;
    height: 60px;
    width: auto;
}

.header-logo-left {
    left: 0;
}

.header-logo-right {
    right: 0;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    font-weight: 400;
    letter-spacing: 1px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.95;
}

/* Wizard Progress Tracker */
.wizard-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.wizard-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    opacity: 0.5;
}

.wizard-step::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: 100%;
    height: 3px;
    background: #e0e0e0;
    z-index: 0;
}

.wizard-step:last-child::after {
    display: none;
}

.wizard-step.active {
    opacity: 1;
}

.wizard-step.completed {
    opacity: 1;
}

.wizard-step.completed .step-number {
    background: #4caf50;
}

.wizard-step.completed::after {
    background: #4caf50;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1a2634;
    color: #c9a962;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1em;
    z-index: 1;
    position: relative;
    border: 2px solid #c9a962;
}

.wizard-step.active .step-number {
    animation: pulse 2s infinite;
}

.step-label {
    margin-top: 10px;
    font-size: 0.85em;
    font-weight: 500;
    text-align: center;
    color: #555;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.card h2 {
    margin-bottom: 20px;
    color: #1a2634;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.step-description {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

.step-content {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.form-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.form-section input,
.form-section textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-section input:focus,
.form-section textarea:focus {
    outline: none;
    border-color: #1a2634;
}

/* Competitor Entries */
.competitor-inputs {
    margin-bottom: 15px;
}

.competitor-entry {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1.5fr;
    gap: 10px;
    margin-bottom: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.competitor-entry input {
    margin-bottom: 0;
}

.competitor-textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    min-height: 150px;
    transition: border-color 0.3s;
}

.competitor-textarea:focus {
    outline: none;
    border-color: #1a2634;
}

/* Buttons */
.primary-btn {
    background: linear-gradient(135deg, #1a2634 0%, #2c3e50 100%);
    color: #c9a962;
    border: 2px solid #c9a962;
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    letter-spacing: 0.5px;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(201, 169, 98, 0.4);
    background: linear-gradient(135deg, #2c3e50 0%, #1a2634 100%);
}

.primary-btn:active {
    transform: translateY(0);
}

.primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.secondary-btn {
    background: white;
    color: #1a2634;
    border: 2px solid #1a2634;
    padding: 12px 30px;
    font-size: 1em;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.secondary-btn:hover {
    background: #1a2634;
    color: #c9a962;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.button-group button {
    flex: 1;
}

.hidden {
    display: none !important;
}

/* Progress Indicator */
.progress-indicator {
    text-align: center;
    padding: 40px 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #1a2634;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-indicator p {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.progress-bar-container {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #1a2634 0%, #c9a962 100%);
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.progress-count {
    font-size: 0.9em;
    color: #777;
}

/* Insights Content */
.insights-content {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid #c9a962;
    margin-bottom: 20px;
    line-height: 1.4;
    font-size: 1.1em;
}

.insights-content h3 {
    color: #1a2634;
    margin-bottom: 15px;
}

.insights-content ul {
    padding-left: 20px;
}

.insights-content li {
    margin-bottom: 6px;
}

/* Insights Text Formatting */
.insights-text {
    line-height: 1.4;
    font-size: 1.1em;
}

.insights-text strong {
    color: #333;
}

.insights-text hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 10px 0;
}

.insights-text ul {
    list-style: none;
    padding-left: 0;
    margin: 8px 0;
}

.insights-text li {
    padding: 4px 0 4px 20px;
    position: relative;
}

.insights-text li::before {
    content: '•';
    color: #c9a962;
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* AI Generated Badge */
.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #1a2634 0%, #2c3e50 100%);
    color: #c9a962;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    margin-bottom: 15px;
    border: 1px solid #c9a962;
}

/* Jump to Advice Link */
.jump-to-advice {
    margin-bottom: 20px;
    text-align: right;
}

.jump-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.95em;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.3);
}

.jump-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

/* Insights Section */
.insights-section {
    margin-bottom: 25px;
}

/* Tailored Advice Section */
.tailored-advice-section {
    background: linear-gradient(135deg, #f0f9f0 0%, #e8f5e9 100%);
    padding: 25px;
    border-radius: 12px;
    border: 2px solid #4caf50;
    margin-top: 25px;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.15);
}

.tailored-advice-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tailored-advice-header h3 {
    color: #2e7d32;
    margin: 0;
    font-size: 1.3em;
}

.advice-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
}

.tailored-advice-content {
    line-height: 1.6;
    font-size: 1.05em;
    color: #333;
}

.tailored-advice-content ul {
    list-style: none;
    padding-left: 0;
    margin: 10px 0;
}

.tailored-advice-content li {
    padding: 6px 0 6px 25px;
    position: relative;
}

.tailored-advice-content li::before {
    content: '✓';
    color: #4caf50;
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Customer Summary */
.customer-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: linear-gradient(135deg, #1a2634 0%, #2c3e50 100%);
    color: #f5f0e6;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #c9a962;
}

.summary-card h3 {
    font-size: 0.9em;
    font-weight: 500;
    margin-bottom: 10px;
    opacity: 0.9;
    color: #c9a962;
}

.summary-value {
    font-size: 2.5em;
    font-weight: 700;
}

.customer-list-preview {
    max-height: 400px;
    overflow-y: auto;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
}

.customer-preview-item {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.customer-preview-item:hover {
    background-color: #f5f5f5;
}

.customer-expand-icon {
    margin-left: 8px;
    font-size: 0.8em;
    transition: transform 0.2s;
}

.customer-orders-details {
    padding: 10px 15px 15px 30px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.customer-order-detail {
    padding: 8px 0;
    border-bottom: 1px solid #e8e8e8;
    font-size: 0.9em;
    color: #555;
}

.customer-order-detail:last-child {
    border-bottom: none;
}

.customer-preview-item:last-child {
    border-bottom: none;
}

.customer-name-preview {
    font-weight: 600;
    color: #333;
}

.customer-orders-preview {
    color: #777;
    font-size: 0.9em;
}

/* Email List */
.email-item {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: box-shadow 0.3s;
}

.email-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.email-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    cursor: pointer;
    user-select: none;
}

.email-header:hover {
    background: #f0f0f0;
}

.email-info {
    flex: 1;
}

.customer-name {
    font-weight: 600;
    font-size: 1.1em;
    color: #333;
    margin-bottom: 5px;
}

.customer-id {
    color: #777;
    font-size: 0.9em;
}

.email-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.expand-icon {
    font-size: 1.5em;
    color: #1a2634;
    transition: transform 0.3s;
}

.email-item.expanded .expand-icon {
    transform: rotate(180deg);
}

.send-btn {
    background: #4caf50;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.send-btn:hover {
    background: #45a049;
}

.send-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.sent-status {
    color: #4caf50;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.send-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.email-content {
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: none;
}

.email-item.expanded .email-content {
    display: block;
}

.email-subject {
    font-weight: 600;
    margin-bottom: 10px;
    color: #1a2634;
}

.email-body {
    line-height: 1.6;
    color: #555;
    white-space: pre-wrap;
}

.order-history {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.order-history h4 {
    margin-bottom: 10px;
    color: #333;
}

.order-item {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.9em;
}

.order-item:last-child {
    border-bottom: none;
}

/* Success Message */
.success-message {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid #4caf50;
    margin-bottom: 25px;
    font-weight: 500;
}

/* Error Card */
.error-card {
    border-left: 4px solid #f44336;
}

.error-card h2 {
    color: #f44336;
}

#error-message {
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .wizard-progress {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .wizard-step::after {
        display: none;
    }
    
    .competitor-entry {
        grid-template-columns: 1fr;
    }
    
    .email-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .email-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button-group button {
        width: 100%;
    }
}
