/* MyShop Enterprises AI Widget Styles */
#mse-ai-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    max-height: 750px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.3s ease;
}

#mse-ai-widget.mse-widget-closed .mse-widget-chat {
    display: none;
}

#mse-ai-widget.mse-widget-closed .mse-widget-toggle {
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.mse-widget-toggle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 18px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    box-shadow: 0 2px 15px rgba(102, 126, 234, 0.25);
    transition: all 0.3s ease;
    position: relative;
}

.mse-widget-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.35);
}

.mse-widget-icon {
    font-size: 24px;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.mse-widget-text {
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mse-widget-subtitle {
    font-size: 12px;
    opacity: 0.9;
    font-weight: 400;
}

.mse-widget-chat {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    max-height: 720px;
}

.mse-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mse-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mse-header-logo {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mse-logo-icon {
    color: #667eea;
    font-weight: bold;
    font-size: 18px;
}

.mse-header-text h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.mse-status {
    font-size: 12px;
    opacity: 0.9;
}

/* Form View Styles */
.mse-form-view {
    padding: 25px;
}

.mse-welcome-message {
    margin-bottom: 25px;
}

.mse-welcome-message h4 {
    font-size: 18px;
    color: #333;
    margin: 0 0 12px 0;
    line-height: 1.4;
    font-weight: 600;
}

.mse-welcome-message p {
    color: #666;
    font-size: 15px;
    margin: 0;
}

.mse-form-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mse-form-input, .mse-form-select {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.mse-form-input:focus, .mse-form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.mse-form-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 40px;
    appearance: none;
}

.mse-analyze-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mse-analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

/* No Website Options */
.mse-no-website-options {
    margin-top: 20px;
    text-align: center;
}

.mse-no-website-text {
    font-size: 13px;
    color: #666;
    margin: 0 0 12px 0;
    font-weight: 500;
}

.mse-no-website-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.mse-secondary-btn {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #e9ecef;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
}

.mse-secondary-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.mse-btn-icon {
    font-size: 20px;
}

.mse-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.mse-chat-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.mse-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 300px;
    max-height: 680px;
}

.mse-message {
    margin-bottom: 15px;
}

.mse-message-content {
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
}

.mse-ai-message .mse-message-content {
    background: #f1f3f4;
    color: #333;
    margin-right: auto;
}

.mse-user-message .mse-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: auto;
}

/* Suggestion Chips */
.mse-suggestion-chips {
    padding: 10px 20px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    border-top: 1px solid #f0f0f0;
}

.suggestion-chip {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #495057;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.suggestion-chip:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-1px);
}

.mse-chat-input {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    border-radius: 0 0 15px 15px;
}

#mse-message-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

#mse-message-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#mse-send-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

#mse-send-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.mse-typing-message {
    margin-bottom: 15px;
}

.mse-typing-indicator {
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f1f3f4 100%);
    border-left: 4px solid #667eea;
    border-radius: 18px;
    max-width: 150px;
    display: inline-flex;
    gap: 6px;
    align-items: center;
    position: relative;
}

.mse-typing-indicator::before {
    content: "MyShop is typing";
    color: #667eea;
    font-size: 12px;
    font-weight: 600;
    margin-right: 8px;
}

.mse-typing-indicator span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.mse-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.mse-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Contact Form Styling */
.mse-contact-form {
    background: rgba(102, 126, 234, 0.05);
    border: 2px solid #667eea;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
}

.mse-contact-form h4 {
    color: #667eea;
    margin: 0 0 8px 0 !important;
    font-size: 14px !important;
    border: none !important;
    padding: 0 !important;
}

.mse-contact-form p {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #555;
}

.mse-contact-form .mse-form-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mse-contact-form .mse-form-input {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
}

.mse-contact-buttons {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.mse-submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
}

.mse-cancel-btn {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    flex: 1;
}

.mse-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.mse-cancel-btn:hover {
    background: #e9ecef;
}

/* Roadmap Button Styling */
.mse-roadmap-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    margin: 8px 0 !important;
    transition: all 0.2s ease !important;
}

.mse-roadmap-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3) !important;
}

/* Revenue Options Styling */
.revenue-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.revenue-option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    color: #495057;
    padding: 10px 15px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    text-align: center;
}

.revenue-option:hover {
    background: #e9ecef;
    border-color: #667eea;
    color: #667eea;
}

/* AI Response Formatting */
.mse-ai-message .mse-message-content {
    background: linear-gradient(135deg, #f8f9ff 0%, #f1f3f4 100%);
    border-left: 4px solid #667eea;
    padding: 16px 18px;
    border-radius: 12px;
    position: relative;
}

/* Introduction paragraph styling */
.mse-ai-message .mse-message-content > p:first-child {
    background: rgba(102, 126, 234, 0.08);
    padding: 12px 16px;
    border-radius: 8px;
    margin: -2px -4px 16px -4px;
    font-style: italic;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
    border-left: 3px solid #667eea;
}

.mse-ai-message .mse-message-content h3 {
    color: #667eea;
    font-size: 15px;
    margin: 0 0 12px 0;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mse-ai-message .mse-message-content h4 {
    color: #667eea;
    font-size: 13px;
    margin: 12px 0 8px 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 4px;
}

.mse-ai-message .mse-message-content h4:first-of-type {
    margin-top: 8px;
}

.mse-ai-message .mse-message-content ul {
    margin: 8px 0 12px 0;
    padding-left: 0;
    list-style: none;
}

.mse-ai-message .mse-message-content li {
    margin: 8px 0;
    padding-left: 16px;
    position: relative;
    color: #555;
    font-size: 13px;
    line-height: 1.5;
    display: list-item;
    list-style: none;
}

.mse-ai-message .mse-message-content li:before {
    content: "•";
    color: #667eea;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.mse-ai-message .mse-message-content p {
    margin: 8px 0;
    font-size: 13px;
    line-height: 1.5;
}

/* Solution highlight styling - styling moved to main AI Response section above */

/* Mobile responsiveness */
@media (max-width: 480px) {
    #mse-ai-widget {
        width: 300px;
        right: 10px;
        bottom: 10px;
        max-height: 95vh; /* Ensure widget doesn't exceed viewport height */
    }
    
    .mse-widget-text {
        display: none;
    }
    
    /* Reduce form view padding on mobile */
    .mse-form-view {
        padding: 16px;
    }
    
    .mse-welcome-message {
        margin-bottom: 16px;
    }
    
    .mse-welcome-message h4 {
        font-size: 16px;
        margin: 0 0 8px 0;
        line-height: 1.3;
    }
    
    .mse-welcome-message p {
        font-size: 14px;
        margin: 0;
    }
    
    .mse-form-inputs {
        gap: 12px;
    }
    
    .mse-form-input, .mse-form-select {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .mse-analyze-btn {
        padding: 12px 20px;
        font-size: 15px;
        margin-top: 4px;
    }
    
    .mse-chat-messages {
        min-height: 225px;
        max-height: 450px;
        padding: 15px;
    }
    
    .mse-message-content {
        font-size: 13px;
        max-width: 90%;
        padding: 10px 14px;
    }
    
    /* Ensure chat header isn't too tall */
    .mse-chat-header {
        padding: 12px 16px;
    }
    
    .mse-header-logo {
        width: 35px;
        height: 35px;
    }
    
    .mse-header-text h3 {
        font-size: 15px;
    }
    
    /* Adjust chat input for mobile */
    .mse-chat-input {
        padding: 15px;
    }
}

/* Extra small mobile devices (iPhone, etc.) */
@media (max-width: 380px) {
    #mse-ai-widget {
        width: 280px;
        max-height: 90vh;
        bottom: 15px;
        right: 15px;
    }
    
    .mse-form-view {
        padding: 12px;
    }
    
    .mse-welcome-message {
        margin-bottom: 12px;
    }
    
    .mse-welcome-message h4 {
        font-size: 15px;
        line-height: 1.2;
    }
    
    .mse-form-inputs {
        gap: 10px;
    }
    
    .mse-form-input, .mse-form-select {
        padding: 9px 12px;
        font-size: 13px;
    }
    
    .mse-analyze-btn {
        padding: 11px 18px;
        font-size: 14px;
        margin-top: 2px;
    }
    
    .mse-no-website-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .mse-secondary-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* Landscape mobile orientation */
@media (max-width: 767px) and (orientation: landscape) {
    #mse-ai-widget {
        max-height: 85vh;
        right: 15px;
        bottom: 15px;
    }
    
    .mse-form-view {
        padding: 12px;
    }
    
    .mse-welcome-message {
        margin-bottom: 10px;
    }
    
    .mse-form-inputs {
        gap: 8px;
    }
}