/* Chatbot Container */
#chatbot-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* 
   Greeting Bubble (Modern iOS/WhatsApp Style) 
   Minimalist & Clean
*/
#chatbot-greeting {
    background-color: #ffffff;
    color: #333333;
    padding: 14px 20px;
    border-radius: 24px 24px 4px 24px; /* Formato bolha orgânica */
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    position: absolute;
    right: 86px;
    bottom: 20px;
    
    /* Animation Control */
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    visibility: hidden;
    
    display: flex;
    align-items: center;
    max-width: 260px;
    line-height: 1.5;
    pointer-events: none;
    border: 1px solid rgba(0,0,0,0.04);
}

#chatbot-greeting.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
    pointer-events: auto;
}

/* Tail subtle effect */
#chatbot-greeting::after {
    display: none; /* Removendo a cauda clássica para um look mais "pill" flutuante moderno, ou mantendo sutil */
}

/* Floating Button (Avatar) */
#chatbot-toggle-btn {
    width: 64px;
    height: 64px;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    /* Adicionando um "ring" sutil ou sombra para destacar a imagem */
    filter: drop-shadow(0 8px 20px rgba(0, 86, 179, 0.25));
}

#chatbot-toggle-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    /* Borda branca fina para separar do fundo */
    border: 3px solid #ffffff; 
}

#chatbot-toggle-btn:hover {
    transform: scale(1.08) translateY(-2px);
}

/* Chat Window (Glassmorphism & Minimalist) */
#chatbot-window {
    width: 380px;
    height: 600px;
    max-height: 80vh;
    background-color: #ffffff;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    bottom: 90px;
    right: 0;
    
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    transform-origin: bottom right;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    
    border: 1px solid rgba(0,0,0,0.05);
}

#chatbot-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, #0056b3 0%, #004494 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.chat-header .chat-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header .chat-profile img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    background: white;
    border: 2px solid rgba(255,255,255,0.8);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.chat-header .chat-profile-info {
    display: flex;
    flex-direction: column;
}

.chat-header .chat-profile-info h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.chat-header .chat-profile-info span {
    font-size: 12px;
    opacity: 0.85;
    font-weight: 400;
}

#minimize-chat-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex; /* Centralizar icone */
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#minimize-chat-btn:hover {
    background: rgba(255,255,255,0.3);
}

#minimize-chat-btn i {
    font-size: 14px;
}

/* Chat Body */
.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #F8F9FA; /* Off-white bem claro */
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.chat-body::-webkit-scrollbar {
    width: 6px;
}
.chat-body::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}

/* Messages */
.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14.5px;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.bot-message {
    background-color: #ffffff;
    color: #444;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    border: 1px solid rgba(0,0,0,0.03);
}

.user-message {
    background: linear-gradient(135deg, #0056b3 0%, #004494 100%);
    color: white;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
    box-shadow: 0 4px 10px rgba(0, 86, 179, 0.2);
}

/* Options/Buttons */
.chat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.option-btn {
    background-color: white;
    border: 1px solid #E0E0E0;
    color: #0056b3;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 13.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.option-btn:hover {
    background-color: #0056b3;
    color: white;
    border-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 86, 179, 0.2);
}

/* Links (Actions) specific styling */
a.option-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Input Area */
.chat-footer {
    padding: 16px;
    background-color: white;
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

#chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #E0E0E0;
    border-radius: 24px;
    outline: none;
    font-size: 14.5px;
    background: #FAFAFA;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: #333;
}

#chat-input:focus {
    border-color: #0056b3;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

#chat-input::placeholder {
    color: #AAA;
}

#send-btn {
    background: linear-gradient(135deg, #0056b3 0%, #004494 100%);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 10px rgba(0, 86, 179, 0.3);
}

#send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 86, 179, 0.4);
}

#send-btn i {
    font-size: 16px;
    margin-left: -2px; /* Visual adjustment for the icon */
}

#send-btn:disabled {
    background: #E0E0E0;
    box-shadow: none;
    cursor: default;
}

/* Link warning style */
.link-warning {
    font-size: 11px;
    color: #999;
    margin-top: 6px;
    display: block;
    font-weight: 500;
}

/* Typing Indicator (Dot Pulse) */
#typing-indicator {
    color: #888;
    font-style: normal;
    font-size: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 2px;
}
/* Could add real dot animation here if desired, but sticking to requested changes first */

/* Responsive Mobile */
@media (max-width: 480px) {
    #chatbot-window {
        width: 100%;
        height: 100%;
        max-height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
        position: fixed;
        z-index: 10001; /* Above toggle button */
    }
    
    #chatbot-container {
        right: 0;
        bottom: 0;
        z-index: 10001;
    }

    #chatbot-toggle-btn {
        margin-right: 20px;
        margin-bottom: 20px;
    }

    /* Hide greetings on mobile to save space or adjust pos */
    #chatbot-greeting {
        display: none; 
    }

    /* Full screen header adjustment */
    .chat-header {
        border-radius: 0;
        padding-top: max(16px, env(safe-area-inset-top)); /* Safe area for mobiles */
    }
}
