/* SassAI Chat Widget Styles - IMG Version (V2) */
#sassai-chat-root {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    pointer-events: none;
}

/* Chat Button */
#sassai-chat-root .sassai-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 30px;
    background: linear-gradient(135deg, #9333ea, #7e22ce) !important;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(126, 34, 206, 0.4);
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: auto;
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 999999;
}

#sassai-chat-root .sassai-chat-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(126, 34, 206, 0.5);
}

#sassai-chat-root .sassai-chat-button.open {
    transform: rotate(90deg);
    background: #ef4444 !important;
    /* Red */
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

/* Chat Window */
#sassai-chat-root .sassai-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 120px);
    background: white !important;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transform-origin: bottom right;
    transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: none;
    border: 1px solid #e5e7eb;
}

#sassai-chat-root .sassai-chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Header */
#sassai-chat-root .sassai-chat-header {
    background: white !important;
    padding: 16px 20px;
    color: #1f2937;
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f3f4f6;
}

#sassai-chat-root .sassai-chat-title {
    font-weight: 700;
    font-size: 16px;
    display: flex !important;
    align-items: center;
    gap: 10px;
    color: #111827;
}

#sassai-chat-root .sassai-chat-close {
    background: #f3f4f6 !important;
    border: none;
    border-radius: 50%;
    width: 40px;
    /* Increased size for better touch target */
    height: 40px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

#sassai-chat-root .sassai-chat-close:hover {
    background: #fee2e2 !important;
}

/* Messages */
#sassai-chat-root .sassai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: white !important;
}

#sassai-chat-root .sassai-message {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

#sassai-chat-root .sassai-message.bot {
    align-self: flex-start;
    background: #f3f4f6 !important;
    color: #1f2937 !important;
    border-bottom-left-radius: 4px;
}

#sassai-chat-root .sassai-message.user {
    align-self: flex-end;
    background: #9333ea !important;
    color: white !important;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(147, 51, 234, 0.25);
}

/* Input Area */
#sassai-chat-root .sassai-chat-input-area {
    padding: 16px;
    background: white !important;
    border-top: 1px solid #f3f4f6;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#sassai-chat-root .sassai-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s;
    resize: none;
    height: 48px;
    line-height: 1.5;
    background: #f9fafb !important;
    color: #1f2937 !important;
}

#sassai-chat-root .sassai-chat-input:focus {
    border-color: #9333ea;
    background: white !important;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

#sassai-chat-root .sassai-chat-send {
    width: 48px;
    height: 48px;
    border-radius: 24px;
    background: #f3f4f6 !important;
    border: none;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

#sassai-chat-root .sassai-chat-send:not(:disabled) {
    background: #9333ea !important;
}

/* Typing & Misc */
#sassai-chat-root .sassai-typing {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

#sassai-chat-root .sassai-dot {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: sassai-bounce 1.4s infinite ease-in-out;
}