/* AI Chatbot Pro - Frontend Styles */

.ai-chatbot-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.ai-chatbot-widget.bottom-right {
    bottom: 20px;
    right: 20px;
}

.ai-chatbot-widget.bottom-left {
    bottom: 20px;
    left: 20px;
}

.ai-chatbot-widget.top-right {
    top: 20px;
    right: 20px;
}

.ai-chatbot-widget.top-left {
    top: 20px;
    left: 20px;
}

.ai-chatbot-trigger {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.ai-chatbot-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.ai-chatbot-trigger.active {
    background: #ff6b6b;
}

.ai-chatbot-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e1e5e9;
}

.ai-chatbot-container.active {
    display: flex;
    animation: slideUp 0.3s ease-out;
}

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

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

.ai-chatbot-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ai-chatbot-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

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

.ai-chatbot-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-chatbot-status .status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ai-chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8fafc;
}

.ai-chatbot-message {
    margin-bottom: 16px;
    display: flex;
    animation: messageIn 0.3s ease-out;
}

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

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

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

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

.ai-chatbot-message.user .ai-chatbot-message-content {
    background: #007cba;
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-chatbot-message.bot .ai-chatbot-message-content {
    background: white;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}

.ai-chatbot-message-time {
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
    text-align: center;
}

.ai-chatbot-actions {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ai-chatbot-action-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ai-chatbot-action-btn:hover {
    background: #005a87;
}

.ai-chatbot-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 13px;
    font-style: italic;
}

.ai-chatbot-typing-dots {
    display: flex;
    gap: 4px;
}

.ai-chatbot-typing-dots span {
    width: 6px;
    height: 6px;
    background: #6b7280;
    border-radius: 50%;
    animation: typingDot 1.4s infinite ease-in-out;
}

.ai-chatbot-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.ai-chatbot-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingDot {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.ai-chatbot-input-area {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.ai-chatbot-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    outline: none;
    resize: none;
    min-height: 36px;
    max-height: 100px;
    transition: border-color 0.2s ease;
}

.ai-chatbot-input:focus {
    border-color: #007cba;
}

.ai-chatbot-send {
    background: #007cba;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.ai-chatbot-send:hover:not(:disabled) {
    background: #005a87;
}

.ai-chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-chatbot-lead-form {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 16px;
    margin-top: 8px;
}

.ai-chatbot-lead-form h4 {
    margin: 0 0 12px 0;
    color: #0369a1;
    font-size: 14px;
}

.ai-chatbot-lead-form input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

.ai-chatbot-lead-form button {
    background: #0369a1;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
}

/* Embedded chatbot styles */
.ai-chatbot-embedded {
    width: 100%;
    height: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .ai-chatbot-container {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
        position: fixed;
    }
    
    .ai-chatbot-widget.bottom-right,
    .ai-chatbot-widget.bottom-left {
        bottom: 20px;
        right: 20px;
        left: auto;
    }
}

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

.ai-chatbot-messages::-webkit-scrollbar-track {
    background: #f1f5f9;
}

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

.ai-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}