/* 
   Custom Chatbot Premium CSS
   Design: Glassmorphism Dark Theme
*/

/* Floating Button */
#custom-chatbot-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8a2be2, #4a00e0);
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.5);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: chatbotPulse 2s infinite;
}

#custom-chatbot-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(138, 43, 226, 0.8);
}

#custom-chatbot-btn svg {
    fill: #ffffff;
    width: 30px;
    height: 30px;
}

@keyframes chatbotPulse {
    0% { box-shadow: 0 0 0 0 rgba(138, 43, 226, 0.6); }
    70% { box-shadow: 0 0 0 15px rgba(138, 43, 226, 0); }
    100% { box-shadow: 0 0 0 0 rgba(138, 43, 226, 0); }
}

/* Preview Message Tooltip */
#custom-chatbot-preview {
    position: fixed;
    bottom: 30px;
    right: 90px;
    background: #ffffff;
    color: #111;
    padding: 12px 18px;
    border-radius: 12px 12px 0 12px;
    font-size: 0.9rem;
    font-weight: 600;
    max-width: 250px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    z-index: 9998;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
}

#custom-chatbot-preview.show {
    opacity: 1;
    transform: translateX(0);
}

/* Chat Window */
#custom-chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: #0a0a0f;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8), 0 0 20px rgba(138, 43, 226, 0.15);
    border: 1px solid rgba(138, 43, 226, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    overflow: hidden;
}

#custom-chatbot-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
#chatbot-header {
    background: linear-gradient(90deg, #150a25, #2a0845);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-avatar {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #8a2be2, #00ffcc);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.chatbot-title h4 {
    color: #fff;
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.chatbot-title span {
    color: #00ffcc;
    font-size: 0.75rem;
}

#chatbot-close {
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

#chatbot-close:hover {
    color: #fff;
}

/* Messages Area */
#chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#chatbot-messages::-webkit-scrollbar {
    width: 6px;
}
#chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(138, 43, 226, 0.3);
    border-radius: 3px;
}

.chat-msg {
    max-width: 85%;
    padding: 12px 16px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
    animation: msgFadeIn 0.3s ease;
}

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

.chat-msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #8a2be2, #4a00e0);
    color: #fff;
    border-radius: 16px 16px 0 16px;
}

.chat-msg-ai {
    align-self: flex-start;
    background: #1a1a24;
    color: #e4e6eb;
    border-radius: 16px 16px 16px 0;
    border: 1px solid rgba(255,255,255,0.05);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #1a1a24;
    border-radius: 16px 16px 16px 0;
    align-self: flex-start;
    width: max-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #8a2be2;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

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

/* Input Area */
#chatbot-input-area {
    padding: 15px;
    background: #0f1015;
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    gap: 10px;
}

#chatbot-input {
    flex: 1;
    background: #1a1a24;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 10px 15px;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s;
}

#chatbot-input:focus {
    border-color: #8a2be2;
}

#chatbot-send {
    background: #8a2be2;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
}

#chatbot-send:hover {
    background: #00ffcc;
    transform: scale(1.05);
}

#chatbot-send svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    margin-left: 2px;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    #custom-chatbot-window {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        border: none;
    }
    #custom-chatbot-btn {
        bottom: 15px;
        right: 15px;
    }
}
