/* ============================================
   LaundryGo AI Chatbot Widget
   ============================================ */

#laundrygo-chatbot {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

/* Toggle Button */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, #3b82f6 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 16px rgba(95, 163, 217, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 2;
}

.chatbot-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(95, 163, 217, 0.5);
}

.chatbot-toggle svg {
    width: 28px;
    height: 28px;
    transition: transform 0.3s;
}

.chatbot-toggle.active svg.icon-open {
    display: none;
}

.chatbot-toggle.active svg.icon-close {
    display: block !important;
}

.chatbot-toggle svg.icon-close {
    display: none;
}

/* Chatbot Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: bottom right;
    border: 1px solid #e2e8f0;
}

.chatbot-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, #3b82f6 100%);
    color: white;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
}

.chatbot-title h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.chatbot-title p {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.9;
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #f8fafc;
}

.chat-msg {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-msg.bot {
    background: white;
    color: var(--color-text-primary);
    border: 1px solid #e2e8f0;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-msg.user {
    background: var(--color-primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    align-items: center;
    height: 36px;
    box-sizing: border-box;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #cbd5e1;
    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 {
    padding: 1rem;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 0.5rem;
}

.chatbot-input input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.chatbot-input input:focus {
    border-color: var(--color-primary);
}

.chatbot-input button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.chatbot-input button:hover {
    background: var(--color-primary-dark, #4b8bc0);
}

.chatbot-input button:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #laundrygo-chatbot {
        bottom: 16px;
        right: 16px;
    }

    .chatbot-window {
        width: calc(100vw - 32px);
        height: 80vh;
        bottom: 70px;
    }
}