/* =============================================================================
   AFIXCODE CHATBOT — CSS STYLES
   Extraído e organizado a partir do snippet_wordpress.txt
   Versão: 1.0.0
   ============================================================================= */

/* --- VARIÁVEIS DE COR AFIXCODE --- */
:root {
    --afix-blue:   #2b4f76;
    --afix-yellow: #FFC107;
    --afix-bg:     #f4f6f8;
    --error-red:   #ff4d4d;
}

/* --- TIPOGRAFIA: Importada via PHP (enqueue no WordPress) --- */
.chat-window,
.chat-launcher,
.chat-callout {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

/* --- BOTÃO FLUTUANTE --- */
.chat-launcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    padding: 0;
    overflow: visible !important;
    transition: transform 0.2s;
    background-color: var(--afix-blue);
    display: none;
    align-items: center;
    justify-content: center;
}
.chat-launcher:hover { transform: scale(1.05); }
.chat-launcher img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* --- BALÃO DE CONVITE --- */
.chat-callout {
    position: fixed;
    bottom: 35px;
    right: 100px;
    background-color: white;
    color: #4a4a4a;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
    padding: 18px 22px;
    max-width: 300px;
    width: max-content;
    border-radius: 12px;
    border-bottom-right-radius: 2px;
    border: 1px solid #e1e4e8;
    border-left: 5px solid var(--afix-yellow);
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.15), 0 4px 10px -2px rgba(0, 0, 0, 0.05);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-15px);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    display: none;
}
.chat-callout:hover {
    transform: translateY(-3px) translateX(0) !important;
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.2);
}
.chat-callout.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
    display: block !important;
}

/* --- JANELA DO CHAT --- */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 360px;
    height: 520px;
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    overflow: hidden;
    font-size: 15px;
}
.chat-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* --- CABEÇALHO --- */
.chat-header {
    background-color: var(--afix-blue) !important;
    color: white !important;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 3px solid var(--afix-yellow);
}
.chat-window .header-info h4 {
    margin: 0 !important; padding: 0 !important;
    font-size: 16px !important; color: white !important;
    line-height: 1.2 !important; text-transform: none !important;
}
.chat-window .header-info p {
    margin: 0 !important; padding: 0 !important;
    font-size: 12px !important; opacity: 0.8 !important;
    color: white !important; display: flex !important;
    align-items: center !important; gap: 6px !important;
    line-height: 1.2 !important;
}
.avatar-container { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; border: 2px solid var(--afix-yellow); background: white; }
.avatar-container img { width: 100%; height: 100%; object-fit: cover; }
.header-info { flex: 1; }
.close-btn { background: none; border: none; color: white; cursor: pointer; font-size: 20px; padding: 5px; }

/* Online indicator */
.chat-window .header-info p::before {
    content: ''; width: 8px; height: 8px;
    background-color: #2ecc71; border-radius: 50%;
    display: inline-block; box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
    animation: pulse-green 2s infinite;
}
@keyframes pulse-green {
    0%   { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); }
    70%  { transform: scale(1);    box-shadow: 0 0 0 5px rgba(46, 204, 113, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

/* --- MENSAGENS --- */
.chat-messages {
    flex: 1; padding: 20px; overflow-y: auto;
    background-color: var(--afix-bg);
    display: flex; flex-direction: column; gap: 12px;
}
.message { max-width: 80%; padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 1.5; word-wrap: break-word; }
.message.user  { align-self: flex-end; background-color: var(--afix-blue); color: white; border-bottom-right-radius: 2px; }
.message.bot   { align-self: flex-start; background-color: white; color: #333; border: 1px solid #e0e0e0; border-bottom-left-radius: 2px; }
.message.error { align-self: center; background-color: #ffe6e6; color: var(--error-red); font-size: 12px; padding: 5px 10px; border: 1px solid var(--error-red); }

/* Garantir que negrito funcione */
.message strong, .message b {
    font-weight: 700 !important;
}

.loading { font-size: 12px; color: #888; margin-left: 10px; display: none; font-style: italic; }

/* --- BOTÕES DE OPÇÃO --- */
.btn-employee {
    background-color: white; color: var(--afix-blue);
    border: 1px solid var(--afix-blue); padding: 10px 15px;
    border-radius: 8px; font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all 0.2s ease-in-out;
    text-align: left; width: 100%; display: block;
}
.btn-employee:hover:not(:disabled) { background-color: var(--afix-blue); color: white; }

/* BOTÕES DE REAPROVEITAMENTO */
.btn-reuse { transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important; position: relative; }
.btn-reuse:hover:not(:disabled) { transform: translateY(-3px) !important; box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15) !important; filter: brightness(1.05) !important; }
.btn-reuse:active:not(:disabled) { transform: translateY(-1px) !important; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important; }
.btn-reuse:disabled { opacity: 0.5 !important; cursor: not-allowed !important; }

/* --- RODAPÉ / INPUT --- */
.chat-footer {
    background: white !important; border-top: 1px solid #eee !important;
    min-height: 70px !important; padding: 0 !important;
    display: flex !important; flex-direction: column !important;
    justify-content: center !important;
}
.input-screen {
    display: none; padding: 10px 15px !important;
    align-items: center !important; justify-content: space-between !important;
    gap: 10px !important; width: 100% !important;
    box-sizing: border-box !important; position: relative !important;
}

/* --- COUNTRY SELECTOR --- */
.country-selector-container { display: none; position: relative; height: 40px; }
.country-selector-btn { background: #f5f5f5 !important; border: 1px solid #ddd !important; padding: 0 10px !important; border-radius: 8px !important; font-size: 13px !important; cursor: pointer !important; display: flex !important; align-items: center !important; gap: 5px !important; color: #333 !important; height: 100% !important; }
.country-selector-btn:hover { background: #eaeaea !important; }
.country-dropup { display: none; position: absolute; bottom: 120%; left: 0; background: white; border: 1px solid #ddd; border-radius: 8px; box-shadow: 0 -4px 10px rgba(0,0,0,0.1); width: 200px; max-height: 200px; overflow-y: auto; z-index: 1000; padding: 5px 0; }
.country-dropup.show { display: block; }
.country-option { padding: 8px 12px; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.country-option:hover { background: #f0f0f0; }
.country-option .code { font-weight: bold; color: #555; }
.country-option .name { flex: 1; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.input-screen input { flex: 1 !important; padding: 10px 15px !important; border: 1px solid #ddd !important; border-radius: 8px !important; outline: none !important; background-color: white !important; color: #333333 !important; font-size: 14px !important; line-height: 1.2 !important; height: 40px !important; margin: 0 !important; box-shadow: none !important; box-sizing: border-box !important; }
.input-screen input:focus { border-color: var(--afix-blue) !important; }
.input-screen button { background-color: var(--afix-blue) !important; color: #FFFFFF !important; border: none !important; width: 44px !important; height: 44px !important; border-radius: 12px !important; cursor: pointer !important; display: flex !important; align-items: center !important; justify-content: center !important; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15) !important; transition: transform 0.2s ease, filter 0.2s !important; }
.input-screen button:hover { background-color: var(--afix-blue) !important; filter: brightness(0.85) !important; transform: scale(1.05) !important; }

/* --- START SCREEN --- */
.start-screen { display: flex; flex-direction: column; padding: 15px; text-align: center; gap: 8px; }
.chat-window .btn-start { background-color: var(--afix-blue) !important; color: white !important; border: none !important; padding: 14px !important; border-radius: 8px !important; font-weight: bold !important; font-size: 15px !important; cursor: pointer !important; width: 100% !important; transition: all 0.3s ease !important; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important; }
.chat-window .btn-start:hover { background-color: var(--afix-blue) !important; filter: brightness(0.85) !important; transform: translateY(-1px) !important; }
.legal-text { font-size: 10px; color: #888; line-height: 1.3; padding: 0 5px; }

/* --- PULSE RING --- */
.pulse-ring { position: absolute; width: 100%; height: 100%; border-radius: 50%; background-color: var(--afix-yellow); z-index: -1; }
.pulse-active { animation: launcher-pulse 2s infinite; }
@keyframes launcher-pulse {
    0%   { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* --- TIMESTAMPS --- */
.message-time { float: right; font-size: 10px; margin-left: 8px; margin-top: 8px; vertical-align: bottom; line-height: 1; }
.message.user .message-time { color: rgba(255, 255, 255, 0.7); }
.message.bot  .message-time { color: #999; }
.message::after { content: ""; display: table; clear: both; }
.message-status-icon { width: 14px; height: 14px; margin-left: 4px; vertical-align: text-bottom; transition: fill 0.3s ease; }
.icon-sent { fill: #999; }
.icon-read { fill: #4fc3f7; }

/* --- BOTÃO SCROLL DOWN --- */
.scroll-bottom-btn { position: absolute; bottom: 85px; right: 20px; width: 35px; height: 35px; background-color: var(--afix-blue); color: white; border-radius: 50%; border: 2px solid white; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); cursor: pointer; display: none; align-items: center; justify-content: center; z-index: 1001; transition: all 0.3s ease; font-size: 18px; }
.scroll-bottom-btn:hover { background-color: var(--afix-blue); filter: brightness(0.85); transform: scale(1.1); }

/* --- BOTÕES OPTION AFIX --- */
.chat-window .btn-option-afix { transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); border: 1px solid rgba(255, 255, 255, 0.1) !important; background-color: var(--afix-blue) !important; }
.chat-window .btn-option-afix:hover { transform: translateY(-3px) !important; box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2) !important; background-color: var(--afix-blue) !important; filter: brightness(0.85) !important; }

/* --- NOTIFICATION BADGE --- */
.notification-badge { position: absolute; top: -2px; right: -2px; width: 22px; height: 22px; background-color: var(--error-red); color: white; border-radius: 50%; font-size: 12px; font-weight: bold; display: flex; align-items: center; justify-content: center; border: 2px solid white; z-index: 1002; transform: scale(0); opacity: 0; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.notification-badge.visible { transform: scale(1); opacity: 1; }

/* --- CARDS RICOS (YouTube/Artigos) --- */
.bot-card { position: relative; background-color: white; border: 1px solid #e1e4e8; border-radius: 12px; overflow: hidden; margin-top: 10px; margin-bottom: 5px; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); display: flex; flex-direction: column; }
.bot-card img { max-width: 100%; height: auto; display: block; }
.bot-card .video-container { position: relative; width: 100%; padding-top: 56.25%; background-color: #000; }
.bot-card .video-container iframe,
.bot-card .video-container img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; object-fit: cover; }
.bot-card-content { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.bot-card-title { font-size: 14px; font-weight: 600; color: var(--afix-blue); line-height: 1.3; }
.bot-card-btn { display: inline-block; align-self: flex-start; background-color: var(--afix-yellow); color: var(--afix-blue); font-size: 12px; font-weight: 600; text-decoration: none; padding: 8px 12px; border-radius: 6px; transition: filter 0.2s ease; }
.bot-card-btn:hover { filter: brightness(0.9); color: var(--afix-blue); text-decoration: none; }

/* --- RESPONSIVO --- */
@media (max-height: 600px) {
    .chat-window { height: 80vh; bottom: 80px; }
}
