/* CHATBOT PREMIUM DESIGN - HIDROMÁTICA */

:root {
    --chat-primary: #007eb2;
    --chat-accent: #f97316;
    --chat-bg: #ffffff;
    --chat-text: #1f2937;
}

#chatbot-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

/* Floating Button */
#chatbot-toggle {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chat-primary) 0%, #009edf 100%);
    box-shadow: 0 10px 25px rgba(0, 158, 223, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: white;
    border: none;
    position: relative;
}

#chatbot-toggle:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 30px rgba(0, 158, 223, 0.6);
}

#chatbot-toggle i {
    width: 32px;
    height: 32px;
    display: block;
}

/* Attention Badge */
.chat-badge {
    position: absolute;
    right: 80px;
    bottom: 12px;
    background: white;
    padding: 10px 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
    color: var(--chat-primary);
    pointer-events: none;
    animation: badgeFloat 3s infinite ease-in-out;
    border: 1px solid rgba(0, 126, 178, 0.1);
}

.chat-badge::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 8px solid white;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

@keyframes badgeFloat {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-10px); }
}

/* Chat Window */
#chatbot-window {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 380px;
    height: 550px;
    background: var(--chat-bg);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

#chatbot-window.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, var(--chat-primary) 0%, #005f86 100%);
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header .avatar {
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 14px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-header .title-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.chat-header .title-info span {
    font-size: 12px;
    opacity: 0.8;
}

/* Messages Area */
#chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f8fafc;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.bot {
    align-self: flex-start;
    background: white;
    color: var(--chat-text);
    border-bottom-left-radius: 2px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.message.user {
    align-self: flex-end;
    background: var(--chat-primary);
    color: white;
    border-bottom-right-radius: 2px;
}

/* Typing Indicator */
.typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    width: fit-content;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.dot {
    width: 6px;
    height: 6px;
    background: #cbd5e1;
    border-radius: 50%;
    animation: typingPulse 1s infinite alternate;
}

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingPulse {
    from { opacity: 0.3; transform: scale(1); }
    to { opacity: 1; transform: scale(1.2); }
}

/* Footer / Input */
.chat-footer {
    padding: 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    background: #f1f5f9;
    padding: 5px 5px 5px 15px;
    border-radius: 30px;
    align-items: center;
}

#chat-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 10px 0;
    color: var(--chat-text);
}

#chat-send {
    width: 40px;
    height: 40px;
    background: var(--chat-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

#chat-send:hover {
    background: var(--chat-accent);
}

/* Markdown styling in messages */
.message.bot p { margin: 0 0 10px 0; }
.message.bot p:last-child { margin-bottom: 0; }
.message.bot strong { color: var(--chat-primary); }

/* Responsive */
@media (max-width: 480px) {
    #chatbot-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 80px;
    }
}
