/**
 * Bloom Hosting AI Chatbot Styles
 */

/* Chatbot Container */
#bloom-chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Toggle Button */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color, #6c5ce7) 0%, var(--secondary-color, #a855f7) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.4);
    transition: all 0.3s ease;
    position: relative;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(108, 92, 231, 0.5);
}

.chatbot-toggle.active {
    transform: scale(0.9);
}

.chatbot-toggle i {
    color: white;
    font-size: 24px;
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 12px;
    font-weight: 600;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 550px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    overflow: hidden;
}

.chatbot-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--primary-color, #6c5ce7) 0%, var(--secondary-color, #a855f7) 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-avatar i {
    font-size: 22px;
}

.chatbot-header-text h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chatbot-status i {
    font-size: 8px;
    color: #4ade80;
}

.chatbot-header-actions {
    display: flex;
    gap: 8px;
}

.chatbot-action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: white;
}

.chatbot-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chatbot-action-btn i {
    font-size: 14px;
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* Welcome Screen */
.chatbot-welcome {
    text-align: center;
    padding: 30px 20px;
}

.chatbot-welcome-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color, #6c5ce7) 0%, var(--secondary-color, #a855f7) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.chatbot-welcome-icon i {
    font-size: 32px;
    color: white;
}

.chatbot-welcome h3 {
    margin: 0 0 10px;
    color: #1e293b;
    font-size: 18px;
}

.chatbot-welcome p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

/* Quick Actions */
.chatbot-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px 0;
}

.quick-action-btn {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 12px 10px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: #475569;
    transition: all 0.2s ease;
}

.quick-action-btn:hover {
    border-color: var(--primary-color, #6c5ce7);
    background: rgba(108, 92, 231, 0.05);
    color: var(--primary-color, #6c5ce7);
}

.quick-action-btn i {
    font-size: 14px;
    color: var(--primary-color, #6c5ce7);
}

/* Messages */
.chatbot-message {
    display: flex;
    max-width: 85%;
}

.chatbot-message.user-message {
    align-self: flex-end;
}

.chatbot-message.bot-message {
    align-self: flex-start;
}

.message-content {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.bot-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color, #6c5ce7) 0%, var(--secondary-color, #a855f7) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bot-avatar i {
    font-size: 14px;
    color: white;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    position: relative;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, var(--primary-color, #6c5ce7) 0%, var(--secondary-color, #a855f7) 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.bot-message .message-bubble {
    background: white;
    color: #1e293b;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.message-bubble p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.message-bubble a {
    color: var(--primary-color, #6c5ce7);
    text-decoration: none;
    font-weight: 500;
}

.user-message .message-bubble a {
    color: white;
    text-decoration: underline;
}

.message-bubble a:hover {
    text-decoration: underline;
}

.message-time {
    font-size: 10px;
    opacity: 0.7;
    display: block;
    margin-top: 6px;
}

/* Typing Indicator */
.typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

/* Input Area */
.chatbot-input-area {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.chatbot-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
    background: #f1f5f9;
    border-radius: 25px;
    padding: 6px 6px 6px 18px;
}

#chatbot-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
    color: #1e293b;
}

#chatbot-input::placeholder {
    color: #94a3b8;
}

.chatbot-send-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color, #6c5ce7) 0%, var(--secondary-color, #a855f7) 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: white;
}

.chatbot-send-btn:hover {
    transform: scale(1.05);
}

.chatbot-send-btn i {
    font-size: 14px;
}

/* Powered By */
.chatbot-powered {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 10px;
    font-size: 11px;
    color: #94a3b8;
}

.messenger-link {
    color: #0084ff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.messenger-link:hover {
    text-decoration: underline;
}

.messenger-link i {
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #bloom-chatbot {
        bottom: 15px;
        right: 15px;
    }

    .chatbot-toggle {
        width: 55px;
        height: 55px;
    }

    .chatbot-window {
        width: calc(100vw - 30px);
        height: calc(100vh - 120px);
        max-height: 550px;
        bottom: 70px;
        right: -8px;
    }

    .chatbot-quick-actions {
        grid-template-columns: 1fr;
    }

    .quick-action-btn {
        padding: 10px;
        font-size: 12px;
    }
}

/* Facebook Messenger Plugin Styles */
.fb-customerchat {
    display: none; /* Hidden by default, we use custom widget */
}

/* Animation for chat opening */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chatbot-window.open {
    animation: slideIn 0.3s ease forwards;
}

/* Message animations */
.chatbot-message {
    animation: messageSlide 0.3s ease forwards;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .chatbot-window {
        background: #1e1e1e;
    }

    .chatbot-messages {
        background: #121212;
    }

    .chatbot-welcome h3 {
        color: #fff;
    }

    .chatbot-welcome p {
        color: #a0a0a0;
    }

    .quick-action-btn {
        background: #2d2d2d;
        border-color: #404040;
        color: #e0e0e0;
    }

    .quick-action-btn:hover {
        background: rgba(108, 92, 231, 0.2);
    }

    .bot-message .message-bubble {
        background: #2d2d2d;
        color: #e0e0e0;
    }

    .chatbot-input-area {
        background: #1e1e1e;
        border-top-color: #333;
    }

    .chatbot-input-wrapper {
        background: #2d2d2d;
    }

    #chatbot-input {
        color: #e0e0e0;
    }

    #chatbot-input::placeholder {
        color: #666;
    }
}
