:root {
    --chat-btn-y-n-color: #ffffff94;
    --chat-toggle-btn-color: white;
    --chat-header-color: #fff;
    --chat-title-color: #ffffff;
    --chat-box-color: #ffffff;
    --chat-msg-bot-color: #2bb837;
    --chat-input-area-border-color: #e6e6e6;
    --chat-status-color: #d4fff9;
    --chat-status-typing-color: #fff8c4;
    --chat-input-area-bg-color: #fafafa;
    --chat-user-input-border-color: #ccc;
    --chat-font-Federo: 'Federo', sans-serif;
    --chat-font-Condensed: 'Roboto Condensed', sans-serif;
}

/* ===== BOTÃO FLUTUANTE ===== */
.chat-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 10px;
    width: 55px;
    height: 55px;
    background: var(--nav-color);
    color: var(--chat-toggle-btn-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    cursor: pointer;
    z-index: 996;
    transition: all 0.3s ease;
    box-shadow: 0px 0px 12px 3px rgba(217,245,243,0.75);
    -webkit-box-shadow: 0px 0px 12px 3px rgba(217,245,243,0.75);
    -moz-box-shadow: 0px 0px 12px 3px rgba(217,245,243,0.75);
}
.chat-toggle-btn:hover {
    transform: scale(1.1);
}

/* ===== ANIMAÇÃO PULSANTE CHATBOT ===== */
.chat-toggle-btn::before,
.chat-toggle-btn::after {
    content: '';
    display: block;
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--nav-color);
    left: -20px;
    right: -20px;
    top: -20px;
    bottom: -20px;
    animation: animateChat 1.5s linear infinite;
    opacity: 0;
    backface-visibility: hidden;
}

/* Delay da segunda onda */
.chat-toggle-btn::after {
    animation-delay: .5s;
}

@keyframes animateChat {
    0%   { transform: scale(0.5); opacity: 0; }
    50%  { opacity: 1; }
    100% { transform: scale(1.2); opacity: 0; }
}

/* ===== WIDGET DO CHAT ===== */
.chat-widget {
    position: fixed;
    bottom: 95px;
    right: 25px;
    width: 340px;
    height: 530px;
    background: var(--chat-toggle-btn-color);
    border-radius: 12px;
    box-shadow: 0px 0px 12px 3px rgba(217,245,243,0.75);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;

    /* MODIFICAÇÕES PARA ANIMAÇÃO SUAVE (NOVO) */
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease-in-out;
    transform-origin: bottom right;
}

.hidden {
    display: none !important;
}

/* ===== HEADER ESTILO WHATSAPP ===== */
.chat-header {
    position: sticky;
    top: 0;
    z-index: 20;

    display: flex;
    align-items: center;
    gap: 8px;

    background: var(--nav-color);
    color: var(--chat-header-color);

    padding: 10px 15px;
    border-radius: 12px 12px 0 0;
}


/* Avatar do bot */
.chat-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--chat-status-color);
    flex-shrink: 0;
}

/* Container para título + status */
.chat-header-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.1;
    margin-right: 25px;
    /* espaço para o X */
}

/* Nome do bot */
.chat-title {
    font-size: 1.12rem;
    font-weight: 600;
    color: var(--chat-title-color);
    font-family: var(--heading-font);
}

/* Status (online / digitando...) */
.chat-status {
    font-size: 14px;
    margin-top: 2px;
    opacity: .9;
    height: 14px;
    /* garante alinhamento */

    /* Correção crucial para alinhamento */
    display: flex;
    align-items: center;
    line-height: 1;
    padding-top: 1px;
    /*font-style: italic;*/
    color: var(--chat-status-color);
}

.chat-status.typing {
    color: var(--chat-status-color);
}

/* Botão fechar (X) */
.chat-close-btn {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 20px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.95);
    font-size: 20px;
    cursor: pointer;
    background-color: rgb(179 187 202 / 41%);
    padding: 1px;
    border-radius: 5px;
    border: 2px solid rgb(179 187 202 / 41%);
}



/* ===== ÁREA DAS MENSAGENS ===== */
.chat-box {
    flex: 1;
    height: 0;              /* ESSENCIAL */
    overflow-y: auto;

    padding: 15px;
    font-size: 14px;

    display: flex;
    flex-direction: column;
    gap: 14px;

    background-image: url('/assets/img/chat-img/bg-chat-box.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}



/* Container geral da mensagem */
.chat-msg {
    display: flex;
    width: 100%;
}

/* Usuário → balão azul, alinhado à direita */
.chat-msg.user {
    justify-content: flex-end;
}

.chat-msg.user .bubble {
    background: color-mix(in srgb, var(--accent-color), transparent 30%);
    color: white;
    align-self: flex-end;
    border-radius: 18px 0px 18px 18px;
    font-size: .8rem;
}

.chat-msg.bot .bubble {
    background: color-mix(in srgb, var(--nav-color), transparent 20%);
    color: white;
    align-self: flex-start;
    border-radius: 0 18px 18px 18px;
    font-size: .8rem;
}

/* Balão base */
.bubble {
    max-width: 80%;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.35;
    display: inline-block;
    position: relative;
    word-wrap: break-word;
    animation: msgDrop 0.12s ease-out;
}

/* Estilização dos balão dos contratos */
.bubble-contract h1, .bubble-contract h2, .bubble-contract p {
    font-family: var(--chat-font-Condensed);
}

.bubble-contract h1 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--chat-status-color);
    font-weight: 600;
}

.bubble-contract h2 {
    font-size: 1rem;
    margin: 10px 0;
    color: var(--chat-status-color);
    font-weight: 400;


}

.bubble-contract p {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--chat-status-color);
    font-weight: 300;
}

/* Estilização dos balão do resumo das cotações */

/* Estilização dos balão dos contratos */
.bubble-cotacao h1, .bubble-cotacao h2, .bubble-cotacao p {
    font-family: var(--chat-font-Condensed);
}

.bubble-cotacao h1 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--chat-status-color);
    font-weight: 600;
}

.bubble-cotacao h2 {
    font-size: 1rem;
    margin: 10px 0;
    color: var(--chat-status-color);
    font-weight: 400;
}

.bubble-cotacao p {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--chat-status-color);
    font-weight: 300;
}

/* Animação suave ao aparecer */
@keyframes msgDrop {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== ÁREA DE INPUT ===== */
.chat-input-area {
    padding: 10px;
    border-top: 1px solid var(--chat-input-area-border-color);
    display: flex;
    gap: 8px;
    background: var(--chat-input-area-bg-color);
    justify-content: center;
}

#user-input {
    flex: 1;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--chat-user-input-border-color);
    font-size: 12px;
}

#send-btn {
    padding: 8px 12px;
    background: var(--nav-color);
    color: var(--chat-toggle-btn-color);
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* ====== EMBED DE OPÇÕES (SIM/NÃO) ====== */

.chat-options-wrapper {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    margin-top: 4px;
    overflow-x: visible;
    background: color-mix(in srgb, var(--nav-color), transparent 90%);
    /* fundo preto translúcido */
    border-radius: 12px;

    animation: fadeSlideUp 0.25s ease-out;

    /*margin: 8px 0;*/
}

/* Botões das opções  do chatbot */
.chat-option-btn {
    flex: 1;
    padding: 5px 0;
    text-align: center;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: 0.18s ease;
    user-select: none;
    background: color-mix(in srgb, var(--nav-color), transparent 20%);
    color: white;
    border-color: color-mix(in srgb, var(--warning-color), transparent 40%);
}

/* colunas ou linhas - Para contratos */

.chat-options-column {
    flex-direction: column !important;
    width: 100%;
    align-items: stretch;
}

.chat-options-column .chat-option-btn {
    width: 100%;
    font-size: 1rem;
    font-family: var(--chat-font-Condensed);
    font-weight: 400;
    letter-spacing: .3px;
}



/* Botão de link de cadastro */

.chat-link-btn {
    padding: 6px 15px;
    margin: 10px 0;
    background: #8da3b885;
    color: var(--chat-status-color);
    border-radius: 5px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: .9rem;
}

.chat-link-btn:hover {
    opacity: 0.9;
}


/* Botão SIM */

.chat-option-btn.yes {
    background: color-mix(in srgb, var(--nav-color), transparent 25%);
    color: color-mix(in srgb, var(--chat-status-color), transparent 10%);
    font-weight: 600;
}

/* Botão NÃO */
.chat-option-btn.no {
    background: color-mix(in srgb, var(--nav-color), transparent 25%);
    color: color-mix(in srgb, var(--chat-status-color), transparent 10%);
    font-weight: 600;
}

.chat-option-btn:hover {
    transform: scale(1.02);
}

/* Animação suave */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ao clicar, desabilita interações */
.chat-option-btn.disabled {
    pointer-events: none;
    opacity: 0.6;
}


/* RESPONSIVIDADE */
@media screen and (max-width: 768px) {
    #user-input {
        font-size: 17px !important;
        flex: 1;
        max-width: 75%;
    }
    
    #send-btn {
        width: 80px;
        flex-shrink: 0;
    }

    div#chat-box {
        font-size: .8rem;
    }


    .chat-option-btn {
        font-size: 1rem;
    }

    .bubble-chat h1 {
        font-size: 1.1rem;
        margin-bottom: 10px;

    }

    .bubble-chat h2 {
        font-size: 1rem;
        margin: 10px 0;
    }

    .bubble-chat p {
        font-size: .9rem;
        margin-bottom: 10px;
    }

    .chat-msg.bot .bubble {
        font-size: 1rem;
        width: 100%;
    }

    .chat-msg.user .bubble {
        font-size: 1rem;
    }
    
    /* Chatbot ocupa toda a tela em mobile */
    .chat-widget {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }
    .chat-header {
        border-radius: 0;
    }
}

/* -------------------------
   MINI-MODAL: wrapper (message-like)
------------------------- */
.mini-modal-msg {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 0;
    margin: 0;
}

.mini-modal-wrapper {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    padding: 6px 0 0 0;
    transition: opacity .22s ease, transform .22s ease;
    opacity: 1;
    transform: translateY(0);
}

.mini-modal-wrapper.entering {
    opacity: 0;
    transform: translateY(6px);
}

.mini-modal-wrapper.exiting {
    opacity: 0;
    transform: translateY(6px);
}

.mini-modal {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: var(--nav-color);
    border-radius: 8px;
    padding: 8px;
    display: inline-block;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.06);
    max-width: 100%;
}

.mini-modal-title {
    font-size: 12px;
    color: var(--chat-status-color);
    margin-bottom: 10px;
    font-weight: 600;
}

.mini-modal-chips {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mini-chip {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: none;
    padding: 2px 10px;
    border-radius: 5px;
    font-size: 11px;
    cursor: pointer;
    transition: transform .12s ease, background .12s ease, opacity .12s ease;
}

.mini-chip:hover {
    transform: translateY(-2px);
}

.mini-chip.disabled {
    opacity: 0.45;
    cursor: default;
}

.mini-chip.yes {
    background: rgba(34, 197, 94, 0.95);
}

.mini-chip.no {
    background: rgba(239, 68, 68, 0.95);
}

/* Ajuste para posicionar o card como "balão" do bot */
.chat-msg.bot.mini-modal-msg {
    padding-left: 6px;
    padding-right: 6px;
    margin-bottom: 10px;
}

/* Responsivo */
@media(max-width:420px) {
    .mini-modal {
        padding: 8px;
    }

    .mini-modal-chips {
        gap: 6px;
    }

    .mini-chip {
        padding: 6px 8px;
        font-size: 12px;
    }
}

/* MINI CALENDAR STYLES */
.mini-calendar {
    display: block;
    width: 100%;
    background: transparent;
}

.mini-cal-row {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.mini-cal-header .mini-cal-cell {
    font-weight: 700;
    font-size: 11px;
    opacity: 0.9;
}

.mini-cal-cell {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--chat-status-color);
    background: rgba(255, 255, 255, 0.02);
}

.mini-cal-empty {
    background: transparent;
    color: rgba(255, 255, 255, 0.2);
}

.mini-cal-day:hover {
    cursor: pointer;
    background: var(--chat-status-color);
    color: var(--nav-color);
}

.mini-cal-today {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12) inset;
}

.mini-cal-selected {
    background: var(--chat-status-color);
    /* destaque alaranjado do anexo */
    color: var(--nav-color);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.mini-cal-cell.mini-cal-day.mini-cal-selected {
    background: var(--chat-status-color);
    color: var(--nav-color);
}

.date-month-select, .date-year-select {
    background: rgba(255, 255, 255, 0.04);
    color: var(--chat-status-color);
    border: none;
    padding: 6px;
    border-radius: 6px;
}

.confirm-date-btn {
    background: var(--chat-status-color);
    color: var(--nav-color);
    padding: 6px 18px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
}

.mini-chip {
    background: rgba(255, 255, 255, 0.04);
    color: var(--chat-status-color);
    border: none;
    padding: 6px 8px;
    border-radius: 6px;
}

/* =========================================
   ANIMAÇÃO DE ABERTURA/FECHAMENTO (NOVO)
   ========================================= */

/* Classe auxiliar para animação de ENTRADA */
.chat-widget.opening {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    display: flex !important;
    /* Garante que o display:none sumiu */
}

/* Classe auxiliar para animação de SAÍDA */
.chat-widget.closing {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
}

/* Quando está ativo e parado (estado normal aberto) */
.chat-widget:not(.hidden):not(.opening):not(.closing) {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* =========================================
   OVERLAY PARA BLOQUEAR FUNDO DO SITE
   ========================================= */

#chatbot-overlay {
    /* Posicionamento fixo cobrindo toda a tela */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    
    /* Visual */
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    
    /* Camadas - abaixo do chatbot mas acima do site */
    z-index: 9998; /* Chatbot é 9999 */
    
    /* Oculto por padrão */
    display: none;
    opacity: 0;
    pointer-events: none;
    
    /* Animação suave */
    transition: opacity 0.3s ease;
}

/* ===== APENAS EM MOBILE 768px ===== */
@media screen and (max-width: 7680px) {
    /* Ativa o overlay em mobile */
    #chatbot-overlay {
        display: block;
    }
    
    /* Overlay visível quando classe .active é adicionada */
    #chatbot-overlay.active {
        opacity: 1;
        pointer-events: all;
    }
}

/* ===== DESKTOP - overlay desabilitado 469px ===== */
@media screen and (min-width: 7680px) {
    #chatbot-overlay {
        display: none !important;
    }
}

