/* =========================================
   VARIÁVEIS E RESET (Identidade Visual)
   ========================================= */
:root {
    --bg-dark: #0f172a;
    --neon-cyan: #00f3ff;
    --neon-hover: #00c4cf;
    --glass-bg: rgba(15, 23, 42, 0.75);
    --glass-border: rgba(0, 243, 255, 0.2);
    --text-white: #ffffff;
    --text-gray: #94a3b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    background-color: var(--bg-dark); /* Cor de fallback */
    background-image: url('brain-background.png'); /* COLOQUE O NOME DA SUA IMAGEM AQUI */
    background-size: cover; /* Faz a imagem preencher a tela toda */
    background-position: center; /* Centraliza a imagem */
    background-attachment: fixed; /* Deixa a imagem fixa ao rolar a página */
    background-repeat: no-repeat; /* Evita que a imagem se repita */
    color: var(--text-white);
    min-height: 100vh;
    overflow-x: hidden;
}
/* =========================================
   BACKGROUND DE VÍDEO (Login)
   ========================================= */
.bg-video {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: -2;
}

.video-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.85); /* Escurece o vídeo */
    z-index: -1;
}

/* =========================================
   ESTILO GLASSMORPHISM (Reutilizável)
   ========================================= */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.05);
}

/* =========================================
   PÁGINA DE LOGIN
   ========================================= */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
}

.logo-area img {
    width: 160px;
    margin-bottom: 15px;
}

.login-card h2 {
    font-size: 1.5rem;
    color: var(--text-white);
    margin-bottom: 5px;
}

.subtitle {
    color: var(--text-gray);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

/* Inputs */
.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-bottom: 8px;
    font-weight: 600;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--neon-cyan);
}

.input-wrapper input {
    width: 100%;
    padding: 12px 12px 12px 45px; /* Espaço pro ícone */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    outline: none;
    transition: 0.3s;
}

.input-wrapper input:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}

/* Botão Neon Principal */
.btn-neon-cyan {
    width: 100%;
    padding: 14px;
    background: var(--neon-cyan);
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-neon-cyan:hover {
    background: var(--neon-hover);
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.6);
    transform: scale(1.02);
}

.error-msg {
    color: #ff4d4d;
    font-size: 0.85rem;
    margin-top: 15px;
    display: none;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    color: rgba(255,255,255,0.3);
    font-size: 0.8rem;
}

/* =========================================
   PÁGINA DASHBOARD
   ========================================= */
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dash-logo img {
    height: 35px;
}

.dash-user {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-gray);
}

.status-online {
    color: #00ff88;
    font-size: 0.7rem;
    animation: blink 2s infinite;
}

@keyframes blink { 50% { opacity: 0.5; } }

.btn-logout {
    background: transparent;
    border: 1px solid #ff4d4d;
    color: #ff4d4d;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-logout:hover {
    background: #ff4d4d;
    color: white;
}

/* Layout Grid Dashboard */
.dash-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
    width: 100%;
}

.welcome-section {
    text-align: center;
    margin-bottom: 50px;
}

.welcome-section h1 {
    color: var(--neon-cyan);
    font-size: 2.2rem;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

/* Card do Agente */
.agent-card {
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.agent-card:hover {
    transform: translateY(-10px);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.15);
}

.icon-box {
    font-size: 3.5rem;
    color: var(--neon-cyan);
    margin-bottom: 20px;
}

.agent-card h3 {
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.agent-card p {
    color: var(--text-gray);
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Botão Secundário (Outline) */
.btn-outline-cyan {
    display: inline-block;
    padding: 12px 30px;
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    text-decoration: none;
    font-weight: 700;
    border-radius: 6px;
    transition: 0.3s;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.agent-card:hover .btn-outline-cyan {
    background: var(--neon-cyan);
    color: #000;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
}




/* =========================================
   UI DO CHATBOT (cognitium-chatbot.html)
   ========================================= */
.chat-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.chat-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    height: calc(100vh - 80px); /* Desconta o header */
}

.chat-container {
    width: 100%;
    max-width: 900px;
    height: 100%;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
}

/* Header do Chat */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.agent-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.agent-avatar {
    width: 45px;
    height: 45px;
    background: var(--neon-cyan);
    color: #000;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
}

.agent-info h2 {
    font-size: 1.1rem;
    margin-bottom: 3px;
}

.agent-status {
    font-size: 0.8rem;
    color: var(--text-gray);
    display: flex;
    align-items: center;
    gap: 5px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-gray);
    font-size: 1.5rem;
    cursor: pointer;
    transition: 0.3s;
}

.icon-btn:hover {
    color: #ff4d4d;
}

/* Área de Mensagens */
.chat-messages {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
}

/* Custom Scrollbar para o Chat */
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(0, 243, 255, 0.2); border-radius: 10px; }

.message {
    display: flex;
    max-width: 80%;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    align-self: flex-end;
}

.message.bot {
    align-self: flex-start;
}

.msg-bubble {
    padding: 15px 20px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.user .msg-bubble {
    background: var(--neon-cyan);
    color: #000;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 243, 255, 0.2);
}

.message.bot .msg-bubble {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    border-bottom-left-radius: 4px;
}

/* Área de Input */
.chat-input-area {
    padding: 20px 30px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 5px;
    transition: 0.3s;
}

.chat-input-wrapper:focus-within {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
}

.chat-input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    padding: 12px 15px;
    font-size: 1rem;
    outline: none;
}

.btn-send {
    background: var(--neon-cyan);
    color: #000;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 10px;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: 0.3s;
}

.btn-send:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
}

.btn-send:disabled {
    background: #555;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Animação Digitanto (Typing Indicator) */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 10px 5px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--neon-cyan);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}



/* =========================================
   CORREÇÕES DE BUG DA UI DO CHATBOT
   ========================================= */

/* 1. CORREÇÃO DO HEADER (Logo, Botões e Menu de Idioma) */
.chat-layout .dash-logo img {
    height: 40px; /* Aumenta a logo que estava minúscula */
    width: auto;
}

.chat-layout .header-actions {
    display: flex;
    align-items: center;
    gap: 20px; /* Separa o botão Voltar do seletor de idioma */
}

.chat-layout .btn-outline-cyan {
    padding: 8px 20px;
    font-size: 0.85rem; /* Ajusta o botão Voltar para caber melhor no header */
}

/* Conserta o menu de idiomas vazando na tela */
.chat-layout .language-dropdown {
    position: relative;
}

.chat-layout .lang-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 15px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
}

.chat-layout .lang-menu {
    display: none; /* Esconde o menu por padrão */
    position: absolute;
    top: 120%;
    right: 0;
    background: var(--bg-dark);
    border: 1px solid var(--neon-cyan);
    border-radius: 8px;
    padding: 10px;
    min-width: 150px;
    flex-direction: column;
    gap: 5px;
    z-index: 1000;
}

.chat-layout .lang-menu.show {
    display: flex; /* Exibe quando recebe a classe .show via JS */
}

.chat-layout .lang-menu a {
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 4px;
    transition: 0.3s;
}

.chat-layout .lang-menu a:hover {
    background: rgba(0, 243, 255, 0.1);
    color: var(--neon-cyan);
}


/* 2. CORREÇÃO DO INPUT DE MENSAGEM (O vilão da sobreposição) */
/* Retira as formatações forçadas da tela de login */
.chat-layout .chat-input-wrapper.input-wrapper {
    padding: 5px 5px 5px 15px;
    display: flex;
    align-items: center;
}

/* Destrava o ícone de enviar (para ele ficar dentro do botão ciano e não à esquerda) */
.chat-layout .chat-input-wrapper.input-wrapper i {
    position: static !important;
    transform: none !important;
    color: #000 !important; /* Garante que o ícone fique preto no fundo ciano */
    font-size: 1.5rem;
}

/* Remove o espaço em branco gigante na esquerda do texto */
.chat-layout .chat-input-wrapper.input-wrapper input {
    padding: 10px !important; 
    background: transparent !important;
    border: none !important;
    flex: 1;
}

.chat-layout .chat-input-wrapper.input-wrapper input:focus {
    box-shadow: none !important; /* Tira o brilho extra interno quando digita */
}

/* Arredonda perfeitamente o botão de enviar */
.chat-layout .btn-send {
    border-radius: 8px;
    margin-left: 10px;
}