/* Chat Widget Styles */
#chat-fab {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #009933;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 9998;
    transition: transform 0.2s, background 0.2s;
}
#chat-fab:hover {
    transform: scale(1.08);
    background: #30cb32;
}

#chat-popup {
    position: fixed;
    bottom: 88px;
    left: 20px;
    width: 370px;
    max-height: 520px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: chatSlideUp 0.25s ease-out;
}
@keyframes chatSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

#chat-header {
    background: linear-gradient(135deg, #009933, #007a29);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
#chat-header-info {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 15px;
}
#chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.8;
}
#chat-close:hover { opacity: 1; }

#chat-disclaimer {
    background: #f0f7f0;
    color: #555;
    font-size: 11px;
    padding: 8px 14px;
    border-bottom: 1px solid #e5e5e5;
    line-height: 1.4;
    flex-shrink: 0;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    min-height: 0;
}
.chat-msg {
    margin-bottom: 12px;
    display: flex;
}
.chat-msg-user {
    justify-content: flex-end;
}
.chat-msg-bot {
    justify-content: flex-start;
}
.chat-bubble {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}
.chat-msg-user .chat-bubble {
    background: #009933;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-msg-bot .chat-bubble {
    background: #f1f1f1;
    color: #333;
    border-bottom-left-radius: 4px;
}
.chat-msg-bot .chat-bubble a {
    color: #009933;
    text-decoration: underline;
}

#chat-typing {
    padding: 4px 14px 8px;
    flex-shrink: 0;
}
.typing-dots {
    display: inline-flex;
    gap: 4px;
    padding: 8px 14px;
    background: #f1f1f1;
    border-radius: 14px;
}
.typing-dots span {
    width: 7px;
    height: 7px;
    background: #999;
    border-radius: 50%;
    animation: typingBounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

#chat-form {
    display: flex;
    padding: 10px;
    border-top: 1px solid #e5e5e5;
    background: #fafafa;
    flex-shrink: 0;
}
#chat-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
#chat-input:focus {
    border-color: #009933;
}
#chat-send {
    background: #009933;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    margin-left: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s;
    flex-shrink: 0;
}
#chat-send:hover { background: #30cb32; }
#chat-send:disabled { background: #ccc; cursor: default; }

/* User info form */
#chat-user-form { flex: 1; overflow-y: auto; }
.chat-field { margin-bottom: 10px; }
.chat-field input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.chat-field input:focus { border-color: #009933; }
#chat-start-btn {
    width: 100%;
    padding: 11px;
    background: #009933;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 4px;
}
#chat-start-btn:hover { background: #30cb32; }

#chat-area { display: flex; flex-direction: column; flex: 1; min-height: 0; }

/* Mobile */
@media (max-width: 480px) {
    #chat-popup {
        left: 8px;
        right: 8px;
        bottom: 80px;
        width: auto;
        max-height: 70vh;
    }
}
