/* Maeru AI Chatbot - Widget Styles */

#maeru-chatbot {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Toggle Button */
#maeru-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}
#maeru-chat-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(26,115,232,0.4);
}

/* Chat Window */
#maeru-chat-window {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: 380px;
    max-height: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: maeruSlideUp 0.25s ease;
}
@keyframes maeruSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Header */
#maeru-chat-header {
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: #fff;
    padding: 14px 18px;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#maeru-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

/* Messages Area */
#maeru-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    min-height: 280px;
    max-height: 340px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#maeru-chat-messages .maeru-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: maeruMsgIn 0.3s ease;
}
@keyframes maeruMsgIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
#maeru-chat-messages .maeru-msg.user {
    align-self: flex-end;
    background: #1a73e8;
    color: #fff;
    border-bottom-right-radius: 4px;
}
#maeru-chat-messages .maeru-msg.bot {
    align-self: flex-start;
    background: #fff;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}
.maeru-typing {
    align-self: flex-start;
    padding: 12px 16px;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e0e0e0;
    display: flex;
    gap: 4px;
}
.maeru-typing span {
    width: 8px;
    height: 8px;
    background: #bbb;
    border-radius: 50%;
    animation: maeruBounce 1.4s infinite;
}
.maeru-typing span:nth-child(2) { animation-delay: 0.2s; }
.maeru-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes maeruBounce {
    0%, 80%, 100% { transform: scale(0.6); }
    40% { transform: scale(1); }
}

/* Input Area */
#maeru-chat-input-area {
    display: flex;
    padding: 10px 14px;
    border-top: 1px solid #eee;
    background: #fff;
    gap: 8px;
}
#maeru-chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
#maeru-chat-input:focus {
    border-color: #1a73e8;
}
#maeru-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}
#maeru-chat-send:hover {
    transform: scale(1.1);
}

/* Mobile */
@media (max-width: 480px) {
    #maeru-chat-window {
        width: calc(100vw - 40px);
        right: -4px;
        max-height: 450px;
    }
    #maeru-chatbot {
        bottom: 16px;
        right: 16px;
    }
}
