/* --- VARIÁVEIS LOCAIS (Baseadas no Tema do Site - Hosting Pro) --- */
:root {
    --chat-width: 350px;
    --chat-height: 500px;
    --primary-color: #10b981;
    /* emerald-500 */
    --primary-dark: #059669;
    /* emerald-600 */
    --accent-color: #34d399;
    /* emerald-400 */
    --bg-color: #0f172a;
    /* slate-900 */
    --bg-glass: rgba(15, 23, 42, 0.95);
    --border-color: #1e293b;
    /* slate-800 */
    --text-color: #f8fafc;
    /* slate-50 */
    --text-muted: #94a3b8;
    /* slate-400 */
    --font-family: 'Inter', sans-serif;
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

/* --- 1. TRIGGER FLUTUANTE (Novo Estilo: Clean & Modern) --- */
.cyber-trigger {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    /* Círculo perfeito */
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

/* Removemos os estilos "cyber" antigos (clip-path, before, after complexos) */
.cyber-trigger::before,
.cyber-trigger::after {
    display: none;
}

.cyber-trigger:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.6);
}

.trigger-icon {
    font-size: 1.8rem;
    color: white;
    filter: none;
    /* Remove filtros estranhos */
}

/* Efeito de pulso sutil */
.trigger-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    animation: pulse-ring 2s infinite;
    opacity: 0;
    pointer-events: none;
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}


/* --- 2. JANELA DO CHAT (Estilo Glassmorphism Profissional) --- */
.sci-fi-chat-panel {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: var(--chat-width);
    height: var(--chat-height);

    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    /* Borda arredondada moderna */
    box-shadow: var(--shadow-lg);

    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10000;

    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom right;

    /* Fontes */
    font-family: var(--font-family);
    color: var(--text-color);
}

.sci-fi-chat-panel.hidden {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    pointer-events: none;
}

/* --- HEADER --- */
.chat-header {
    padding: 16px 20px;
    background: rgba(30, 41, 59, 0.5);
    /* Slate-800 com transparência */
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    color: var(--text-color);
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-status {
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.1);
    padding: 4px 8px;
    border-radius: 20px;
}

.blink {
    color: var(--primary-color);
    animation: blink-animation 1.5s infinite;
}

@keyframes blink-animation {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        opacity: 1;
    }
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
    padding: 0;
    margin-left: 10px;
}

.close-btn:hover {
    color: white;
}


/* --- HISTÓRICO DE MENSAGENS --- */
.chat-history {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: transparent;
}

/* Scrollbar Personalizada (Fina e Discreta) */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Estilo das Bolhas */
.message {
    display: flex;
    width: 100%;
}

.msg-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Bot (Alinhado à esquerda) */
.message.bot {
    justify-content: flex-start;
}

.message.bot .msg-bubble {
    background: var(--border-color);
    /* Slate-800 */
    color: var(--text-color);
    border-bottom-left-radius: 4px;
}

.message.bot a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.message.bot a:hover {
    text-decoration: underline;
}


/* Usuário (Alinhado à direita) */
.message.user {
    justify-content: flex-end;
}

.message.user .msg-bubble {
    background: var(--primary-dark);
    /* Emerald-600 */
    color: white;
    border-bottom-right-radius: 4px;
    text-align: left;
}


/* --- ÁREA DE INPUT --- */
.chat-input-zone {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    background: rgba(15, 23, 42, 0.6);
    align-items: flex-end;
}

#chat-input-field {
    flex: 1;
    background: rgba(30, 41, 59, 0.5);
    /* Slate-800 50% */
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 12px 16px;
    border-radius: 24px;
    /* Mais arredondado */
    resize: none;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
    max-height: 100px;
}

#chat-input-field:focus {
    border-color: var(--primary-color);
    background: rgba(30, 41, 59, 0.8);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* Botão Enviar */
.list-btn {
    /* Reutilizando a classe, mas resetando o estilo */
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.btn-send {
    background-color: var(--primary-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    /* Botão circular maior */
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    /* ícone dentro */
    padding: 10px;
}

.btn-send:hover {
    background-color: var(--accent-color);
    transform: scale(1.05);
}

.btn-glitch {
    display: none;
}

/* Remove efeito glitch antigo */

/* Indicador de Digitando */
.typing-indicator {
    padding: 8px 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.typing-indicator.hidden {
    display: none;
}

.typing-indicator span {
    animation: typing-dots 1.4s infinite ease-in-out both;
    margin: 0 1px;
    font-size: 1.2rem;
    line-height: 0;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing-dots {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Responsividade Mobile */
@media (max-width: 480px) {
    .sci-fi-chat-panel {
        width: 100%;
        height: 100dvh;
        /* Altura total da viewport */
        bottom: 0;
        right: 0;
        border-radius: 0;
        border: none;
    }

    .cyber-trigger {
        bottom: 20px;
        right: 20px;
    }

    .chat-header {
        padding-top: env(safe-area-inset-top, 20px);
        /* Respeita notch */
        height: 70px;
    }
}