/* =====================================================
   FAQ CHATBOT WIDGET - EMBEDDABLE STYLES
   ===================================================== */

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

/* Container */
#chatbot-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
}

/* Chat Button */
.chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chatbot-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.chatbot-button svg {
    width: 28px;
    height: 28px;
    fill: white;
}

/* Chat Window */
.chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

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

/* Header */
.chatbot-header {
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

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

.chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.chatbot-title h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

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

.chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9fafb;
}

/* Message Bubbles */
.message {
    margin-bottom: 16px;
    display: flex;
    gap: 8px;
    animation: fadeIn 0.3s ease-out;
}

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

.message.bot {
    justify-content: flex-start;
}

.message.user {
    justify-content: flex-end;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 14px;
}

.message.bot .message-content {
    background: white;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.message.user .message-content {
    background: var(--primary-color, #4F46E5);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Lead Collection Form */
.lead-form {
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.lead-form-field {
    margin-bottom: 12px;
}

.lead-form-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #374151;
}

.lead-form-field input,
.lead-form-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.lead-form-field input:focus,
.lead-form-field textarea:focus {
    outline: none;
    border-color: var(--primary-color, #4F46E5);
}

.lead-form-field textarea {
    resize: vertical;
    min-height: 60px;
}

.lead-form-submit {
    width: 100%;
    padding: 12px;
    background: var(--primary-color, #4F46E5);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.lead-form-submit:hover {
    opacity: 0.9;
}

.lead-form-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Input Area */
.chatbot-input {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
}

.chatbot-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 24px;
    font-size: 14px;
    font-family: inherit;
}

.chatbot-input input:focus {
    outline: none;
    border-color: var(--primary-color, #4F46E5);
}

.chatbot-input button {
    padding: 12px 20px;
    background: var(--primary-color, #4F46E5);
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.chatbot-input button:hover {
    opacity: 0.9;
}

.chatbot-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
    animation: typing 1.4s infinite;
}

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

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

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

/* Powered By */
.chatbot-footer {
    padding: 8px 20px;
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
    background: #f9fafb;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chatbot-window {
        width: 100%;
        height: 100%;
        max-height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    #chatbot-container {
        bottom: 0;
        right: 0;
    }
}

/* Scrollbar Styling */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
/* Suggested Question Buttons */
.suggestion-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.suggestion-btn {
    padding: 10px 16px;
    background: white;
    border: 2px solid var(--primary-color, #4F46E5);
    color: var(--primary-color, #4F46E5);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.suggestion-btn:hover {
    background: var(--primary-color, #4F46E5);
    color: white;
    transform: translateX(4px);
}

.suggestion-btn:active {
    transform: scale(0.98);
}