/* Container principal */
.whatsapp-chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    /* Estado inicial - oculto */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.6s ease, visibility 0.6s ease, transform 0.6s ease;
}

/* Classe para mostrar o container após scroll */
.whatsapp-chat-container.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Estilo para o botão */
.whatsapp-chat-btn {
    display: flex;
    align-items: center;
    background: linear-gradient(145deg, #C0BD30, #f0ec05);
    color: white;
    border-radius: 30px;
    padding: 1em;
    box-shadow: 0 8px 20px rgba(192, 189, 48, 0.18);
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    position: relative;
    z-index: 999;
}

.whatsapp-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    text-decoration: none;
    color: white;
}

.whatsapp-button-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-text {
    font-weight: 500;
    font-size: 15px;
    transition: transform 0.3s ease;
    white-space: nowrap;
}

.whatsapp-chat-btn:hover .chat-text {
    transform: scale(1.02);
}

/* Estilo para o robô */
.robot-container {
    position: relative;
    width: 60px;
    height: 60px;
    min-width: 60px;
    min-height: 60px;
    overflow: hidden;
    border-radius: 50%;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.robot-img {
    object-fit: contain;
    object-position: center;
    position: absolute;
    transition: opacity 0.3s ease;
    margin-left: 5px;
    width: 50px;
    height: 50px;
}

.robot-normal {
    opacity: 1;
}

.robot-waving {
    opacity: 0;
}

.whatsapp-chat-btn:hover .robot-normal {
    opacity: 0;
}

.whatsapp-chat-btn:hover .robot-waving {
    opacity: 1;
}

/* Balão de mensagem */
.whatsapp-message-bubble {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    margin-bottom: 16px;
    max-width: 220px;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.4s ease, transform 0.4s ease;
    position: relative;
    display: none;
    z-index: 1000;
}

.whatsapp-message-bubble.active {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.whatsapp-message-bubble:after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 25px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.96) transparent transparent;
}

.close-bubble {
    position: absolute;
    top: 5px;
    right: 8px;
    font-size: 18px;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-bubble:hover {
    color: #555;
    background-color: rgba(0, 0, 0, 0.05);
}

.message-content {
    margin-right: 15px;
}

#dynamic-message {
    margin: 0 0 4px 0;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
}

/* Indicador de digitação */
.typing-indicator {
    display: flex;
    align-items: center;
    margin-top: 5px;
    height: 10px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    margin-right: 4px;
    border-radius: 50%;
    background-color: #C0BD30;
    display: inline-block;
    opacity: 0.6;
}

.typing-indicator span:nth-child(1) {
    animation: typing 1s infinite 0.1s;
}
.typing-indicator span:nth-child(2) {
    animation: typing 1s infinite 0.3s;
}
.typing-indicator span:nth-child(3) {
    animation: typing 1s infinite 0.5s; 
}

/* Oculta a âncora do Google reCAPTCHA */
.grecaptcha-badge {
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    z-index: -9999 !important;
}

/* Oculta também o iframe do reCAPTCHA */
iframe[src*="google.com/recaptcha/api2/"] {
    display: none !important;
}

/* Oculta o container do reCAPTCHA */
.rc-anchor-normal {
    display: none !important;
    visibility: hidden !important;
}

/* Garante que o elemento g-recaptcha */
.g-recaptcha {
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

@keyframes typing {
    0% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0); }
}

/* Animação de tremida */
@keyframes trembling {
0% { 
transform: translate(0, 0) rotate(0deg);
border-radius: 30px;
}
10% { 
    transform: translate(-3px, -2px) rotate(-3deg);
    border-radius: 40px;
}
20% { 
    transform: translate(3px, 2px) rotate(4deg);
    border-radius: 50px;
}
30% { 
    transform: translate(-4px, 2px) rotate(-5deg);
    border-radius: 60px;
}
40% { 
    transform: translate(4px, -2px) rotate(5deg);
    border-radius: 70px;
}
50% { 
    transform: translate(-4px, 2px) rotate(-6deg);
    border-radius: 80px;
}
60% { 
    transform: translate(4px, 2px) rotate(5deg);
    border-radius: 70px;
}
70% { 
    transform: translate(-3px, -2px) rotate(-4deg);
    border-radius: 60px;
}
80% { 
    transform: translate(3px, 2px) rotate(3deg);
    border-radius: 50px;
}
90% { 
    transform: translate(-2px, -1px) rotate(-2deg);
    border-radius: 40px;
}
100% { 
    transform: translate(0, 0) rotate(0deg);
    border-radius: 30px;
}
}

/* Responsividade */
@media (max-width: 768px) {
    .whatsapp-chat-container {
        right: 16px;
        bottom: 16px;
    }

    .whatsapp-chat-btn {
        width: 56px;
        height: 56px;
        padding: 0;
        border-radius: 50%;
        background: #C0BD30;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
        justify-content: center;
    }

    .robot-container {
        width: 56px;
        height: 56px;
        min-width: 56px;
        min-height: 56px;
        padding: 0;
        background: #fff;
        box-shadow: none;
    }

    .robot-img {
        width: 44px;
        height: 44px;
        margin-left: 0;
    }

    .chat-text {
        display: none;
    }

    .whatsapp-message-bubble {
        max-width: 220px;
        margin-bottom: 12px;
        bottom: 0;
        right: 0;
    }

    #dynamic-message {
        font-size: 13px;
    }
}

/* breakpoint para telas muito pequenas */
@media (max-width: 480px) {
    .whatsapp-chat-container {
        bottom: 12px !important;
        right: 12px !important;
    }

    .whatsapp-chat-btn {
        width: 48px;
        height: 48px;
    }

    .robot-container {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
    }

    .robot-img {
        width: 36px;
        height: 36px;
    }
}
