/* ============================================
   Alchimist Chatbot Widget
   Dark theme matching website (black/orange)
   ============================================ */

/* Floating bubble */
.chatbot-bubble {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6a00, #e85d04);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 106, 0, 0.4);
    z-index: 9998;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    outline: none;
}
.chatbot-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(255, 106, 0, 0.6);
}
.chatbot-bubble svg {
    width: 28px;
    height: 28px;
    fill: #fff;
}
.chatbot-bubble .chatbot-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid #111;
}

/* Chat window */
.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 28px;
    width: 380px;
    height: 520px;
    background: #12121a;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    animation: chatbot-slideUp 0.3s ease;
}
.chatbot-window.active {
    display: flex;
}

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

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}
.chatbot-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.chatbot-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6a00, #e85d04);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.chatbot-header-info h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}
.chatbot-header-info span {
    font-size: 11px;
    color: #22c55e;
}
.chatbot-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
    line-height: 1;
}
.chatbot-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Messages area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}
.chatbot-messages::-webkit-scrollbar {
    width: 4px;
}
.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Message bubbles */
.chatbot-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
}
.chatbot-msg.bot {
    align-self: flex-start;
    background: #1e1e2e;
    color: #e0e0e0;
    border-bottom-left-radius: 4px;
}
.chatbot-msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #ff6a00, #e85d04);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chatbot-msg.bot a {
    color: #ff6a00;
    text-decoration: underline;
}

/* Typing indicator */
.chatbot-typing {
    align-self: flex-start;
    padding: 10px 14px;
    background: #1e1e2e;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    display: none;
}
.chatbot-typing.active {
    display: flex;
}
.chatbot-typing span {
    width: 7px;
    height: 7px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: chatbot-bounce 1.4s infinite;
}
.chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatbot-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Input area */
.chatbot-input-area {
    padding: 12px 14px;
    background: #0e0e16;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.chatbot-input {
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #1a1a2a;
    color: #e0e0e0;
    padding: 10px 14px;
    border-radius: 20px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
.chatbot-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}
.chatbot-input:focus {
    border-color: rgba(255, 106, 0, 0.4);
}
.chatbot-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #ff6a00, #e85d04);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, opacity 0.2s;
    flex-shrink: 0;
}
.chatbot-send:hover {
    transform: scale(1.05);
}
.chatbot-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}
.chatbot-send svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

/* Quick action chips */
.chatbot-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.chatbot-chip {
    padding: 6px 12px;
    background: rgba(255, 106, 0, 0.12);
    color: #ff6a00;
    border: 1px solid rgba(255, 106, 0, 0.25);
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.chatbot-chip:hover {
    background: rgba(255, 106, 0, 0.25);
    border-color: rgba(255, 106, 0, 0.5);
}

/* Powered by footer */
.chatbot-powered {
    text-align: center;
    padding: 6px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.15);
    background: #0e0e16;
    flex-shrink: 0;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 120px);
        bottom: 80px;
        right: 10px;
        border-radius: 12px;
    }
    .chatbot-bubble {
        bottom: 16px;
        right: 16px;
        width: 54px;
        height: 54px;
    }
}
