/* 
    chatbot.css - ULTRA PREMIUM NEON (v7 - Bulletproof Invisible)
*/

:root {
    --rz-primary: #60a5fa;
    --rz-gradient: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    --rz-bg: #0f0f13;
    --rz-border: rgba(255, 255, 255, 0.08);
    --rz-text: #f8fafc;
    --rz-text-dim: #94a3b8;
}

/* FAB - Botão Flutuante */
.blest-chatbot-fab {
    position: fixed !important;
    bottom: 25px !important;
    right: 25px !important;
    width: 60px !important;
    height: 60px !important;
    background: var(--rz-gradient) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: 0 10px 25px rgba(96, 165, 250, 0.4) !important;
    z-index: 999999 !important;
    transition: 0.3s !important;
}

.blest-chatbot-fab img { width: 28px !important; height: 28px !important; filter: brightness(0) invert(1) !important; }

/* Janela do Chat - TOTALMENTE ESCONDIDA POR PADRÃO */
.blest-chatbot-window {
    position: fixed !important;
    bottom: 100px !important;
    right: 25px !important;
    width: 380px !important;
    height: 600px !important;
    max-height: calc(100vh - 150px) !important;
    background: #0f0f13 !important;
    border: 1px solid var(--rz-border) !important;
    border-radius: 28px !important;
    z-index: 999998 !important;
    display: none !important; /* FORÇA O DESAPARECIMENTO */
    visibility: hidden !important;
    opacity: 0 !important;
    flex-direction: column !important;
}

/* Estado Aberto - MOSTRA A JANELA */
.blest-chatbot-window.open {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: all !important;
    animation: rzIn 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

@keyframes rzIn { from { transform: translateY(30px) scale(0.95); } to { transform: translateY(0) scale(1); } }

/* Se o chat abrir, esconde o FAB */
.blest-chatbot-window.open ~ .blest-chatbot-fab {
    display: none !important;
}

/* Header */
.blest-chatbot-header { flex-shrink: 0 !important; padding: 18px 20px !important; background: rgba(255, 255, 255, 0.02) !important; border-bottom: 1px solid var(--rz-border) !important; display: flex !important; align-items: center !important; justify-content: space-between !important; }
.blest-header-info { display: flex !important; align-items: center !important; gap: 12px !important; }
.blest-bot-avatar { width: 38px !important; height: 38px !important; background: var(--rz-gradient) !important; border-radius: 12px !important; display: flex !important; align-items: center !important; justify-content: center !important; color: white !important; }
.blest-header-text { display: flex !important; flex-direction: column !important; }
.blest-bot-name { font-size: 0.95rem !important; color: #fff !important; font-weight: 700 !important; }
.blest-bot-status { font-size: 0.7rem !important; color: #10b981 !important; display: flex !important; align-items: center !important; gap: 4px !important; }
.blest-bot-status::before { content: '' !important; width: 6px !important; height: 6px !important; background: #10b981 !important; border-radius: 50% !important; box-shadow: 0 0 8px #10b981 !important; }

/* Botões de Ação do Header */
.blest-action-btn { background: transparent !important; border: none !important; color: var(--rz-text-dim) !important; width: 32px !important; height: 32px !important; cursor: pointer !important; font-size: 0.9rem !important; border-radius: 8px !important; display: flex !important; align-items: center !important; justify-content: center !important; }
.blest-action-btn:hover { background: rgba(255,255,255,0.05) !important; color: #fff !important; }

/* Mensagens */
.blest-chatbot-messages { flex-grow: 1 !important; padding: 20px !important; overflow-y: auto !important; display: flex !important; flex-direction: column !important; gap: 15px !important; }
.message-bubble { max-width: 85% !important; padding: 12px 16px !important; font-size: 0.9rem !important; line-height: 1.5 !important; }
.chat-btn-link { 
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--rz-gradient);
    color: #fff !important;
    padding: 10px 20px;
    border-radius: 12px;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 0.85rem;
    margin-top: 10px;
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
    transition: 0.3s;
}
.chat-btn-link:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4); filter: brightness(1.1); }
.chat-btn-link i { font-size: 0.8rem; }
.message-bubble.bot { align-self: flex-start !important; background: #1c1c21 !important; color: #e2e8f0 !important; border-radius: 18px 18px 18px 4px !important; border: 1px solid var(--rz-border) !important; }
.message-bubble.user { align-self: flex-end !important; background: var(--rz-gradient) !important; color: #fff !important; border-radius: 18px 18px 4px 18px !important; }

/* Opções */
.options-container { display: flex !important; flex-direction: column !important; gap: 8px !important; margin-top: 5px !important; align-items: flex-start !important; }
.option-btn { background: rgba(255, 255, 255, 0.05) !important; border: 1px solid var(--rz-border) !important; color: #fff !important; padding: 10px 18px !important; border-radius: 14px !important; font-size: 0.85rem !important; cursor: pointer !important; }

/* Input */
.blest-chatbot-input-area { flex-shrink: 0 !important; padding: 20px !important; background: rgba(0, 0, 0, 0.2) !important; border-top: 1px solid var(--rz-border) !important; display: flex !important; gap: 12px !important; }
.blest-chatbot-input-area input { flex-grow: 1 !important; background: rgba(255, 255, 255, 0.03) !important; border: 1px solid var(--rz-border) !important; padding: 12px 18px !important; border-radius: 14px !important; color: #fff !important; outline: none !important; }
.blest-send-btn { width: 45px !important; height: 45px !important; background: var(--rz-gradient) !important; border: none !important; border-radius: 12px !important; color: white !important; cursor: pointer !important; display: flex !important; align-items: center !important; justify-content: center !important; }

/* Helpers */
.hidden { display: none !important; }
.blest-chat-options-menu { position: absolute !important; top: 45px !important; right: 0 !important; width: 200px !important; background: #18181b !important; border: 1px solid var(--rz-border) !important; border-radius: 15px !important; padding: 8px !important; display: none !important; flex-direction: column !important; z-index: 101 !important; }
.blest-chat-options-menu.show { display: flex !important; }
.blest-chat-options-menu button { width: 100% !important; padding: 10px !important; text-align: left !important; background: transparent !important; border: none !important; color: var(--rz-text-dim) !important; font-size: 0.85rem !important; border-radius: 10px !important; cursor: pointer !important; display: flex !important; align-items: center !important; gap: 10px !important; }

/* Custom Confirmation Popup */
.blest-chatbot-confirmation-popup {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(8px) !important;
    display: none; /* Começa escondido, sem !important para a classe hidden funcionar */
    align-items: center !important;
    justify-content: center !important;
    z-index: 1000 !important;
    border-radius: 28px !important;
}

.blest-chatbot-confirmation-popup.active {
    display: flex !important;
}

.blest-popup-content {
    background: #1c1c21 !important;
    padding: 30px !important;
    border-radius: 20px !important;
    text-align: center !important;
    width: 85% !important;
    border: 1px solid var(--rz-border) !important;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5) !important;
}

.blest-popup-title { font-size: 1.2rem !important; font-weight: 700 !important; color: #fff !important; margin-bottom: 10px !important; }
.blest-popup-text { font-size: 0.9rem !important; color: var(--rz-text-dim) !important; margin-bottom: 25px !important; }
.blest-popup-buttons { display: flex !important; flex-direction: column !important; gap: 10px !important; }
.blest-btn-confirm { background: #ef4444 !important; color: white !important; border: none !important; padding: 12px !important; border-radius: 12px !important; font-weight: 600 !important; cursor: pointer !important; }
.blest-btn-cancel { background: rgba(255,255,255,0.05) !important; color: white !important; border: none !important; padding: 12px !important; border-radius: 12px !important; font-weight: 600 !important; cursor: pointer !important; }

/* Evaluation Area - PREMIUM REDESIGN */
.blest-chatbot-evaluation-area {
    padding: 30px 20px !important;
    text-align: center !important;
    background: rgba(255, 255, 255, 0.02) !important;
    border-top: 1px solid var(--rz-border) !important;
    border-bottom: 1px solid var(--rz-border) !important;
    animation: fadeIn 0.4s ease-out !important;
}

.blest-eval-title {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #fff !important;
    margin-bottom: 20px !important;
    letter-spacing: 0.5px !important;
}

.blest-stars {
    display: flex !important;
    justify-content: center !important;
    gap: 12px !important;
    margin-bottom: 15px !important;
}

.blest-stars button {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--rz-border) !important;
    width: 50px !important;
    height: 50px !important;
    border-radius: 14px !important;
    color: var(--rz-text-dim) !important;
    font-size: 1.4rem !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.blest-stars button:hover {
    transform: scale(1.15) translateY(-5px) !important;
    background: rgba(255, 215, 0, 0.1) !important;
    border-color: #FFD700 !important;
    color: #FFD700 !important;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.2) !important;
}

.blest-stars button.active i {
    color: #FFD700 !important;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5) !important;
}

.blest-feedback-sent {
    font-size: 0.9rem !important;
    color: #10b981 !important;
    font-weight: 600 !important;
    margin-top: 15px !important;
    animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* Typing Indicator */
.typing-indicator {
    display: flex !important;
    gap: 5px !important;
    padding: 12px 18px !important;
    background: #1c1c21 !important;
    border-radius: 18px 18px 18px 4px !important;
    width: fit-content !important;
    align-self: flex-start !important;
    border: 1px solid var(--rz-border) !important;
    margin-bottom: 10px !important;
}

.typing-dot {
    width: 6px !important;
    height: 6px !important;
    background: var(--rz-text-dim) !important;
    border-radius: 50% !important;
    animation: typingBounce 1.4s infinite ease-in-out !important;
}

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

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}
@keyframes bounceIn { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

@media (max-width: 480px) {
    .blest-chatbot-fab {
        bottom: 85px !important;
        right: 20px !important;
        width: 55px !important;
        height: 55px !important;
    }
    .blest-chatbot-fab img {
        width: 26px !important;
        height: 26px !important;
    }
    .blest-chatbot-window {
        width: 100vw !important;
        height: 100vh !important;
        height: -webkit-fill-available !important;
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        top: 0 !important;
        border-radius: 0 !important;
        max-height: none !important;
        border: none !important;
        margin: 0 !important;
    }
    .blest-chatbot-window.open {
        animation: rzInMobile 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) forwards !important;
    }
    @keyframes rzInMobile {
        from { transform: translateY(100%); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }
    .blest-chatbot-header {
        padding: 15px !important;
        border-radius: 0 !important;
    }
    .blest-chatbot-messages {
        padding: 15px !important;
    }
    .message-bubble {
        max-width: 92% !important;
        font-size: 1rem !important;
    }
    .blest-chatbot-input-area {
        padding: 15px !important;
        padding-bottom: calc(15px + env(safe-area-inset-bottom)) !important;
        border-radius: 0 !important;
    }
    .option-btn {
        width: 100% !important;
        text-align: center !important;
        padding: 14px !important;
        font-size: 0.95rem !important;
    }
    .blest-chatbot-confirmation-popup { 
        border-radius: 0 !important; 
    }
    .blest-chatbot-evaluation-area {
        padding: 40px 20px !important;
    }
    .blest-stars {
        gap: 15px !important;
    }
    .blest-stars button {
        width: 55px !important;
        height: 55px !important;
        font-size: 1.6rem !important;
    }
}
