/* SoflexoAI v2 — Design Limpo e Profissional (Gemini Style) */

:root {
    /* Força o esquema de cores como claro para anular configurações de Dark Mode do navegador */
    color-scheme: light; 
    
    /* Variáveis de Cores */
    --bg-app: #f4f6f8; /* Fundo levemente cinza para destacar a interface branca */
    --bg-white: #ffffff;
    --bg-sidebar: #f8f8f8; /* Fundo da barra lateral */
    --text-dark: #1f2937; /* Preto suave para texto principal */
    --text-muted: #6b7280; /* Cinza para texto secundário e labels */
    --border: #e0e0e0; /* Linhas de separação */
    --green-primary: #059669; /* Verde para Ação/Ênfase (cor da marca) */
    --green-hover: #047857; /* Verde mais escuro para hover */
    --green-soft: #ecfdf5; /* Cor de fundo da bolha do BOT (alternativa, se usada) */
    --radius: 0.75rem; /* 12px de raio para bordas */
    
    font-size: 16px;
}

/* Reset e Configurações Globais */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; 
}

/* ⚠️ SOLUÇÃO DE DARK MODE: Garante que toda a área da janela seja clara */
html, body { 
    background-color: var(--bg-app); 
    color: var(--text-dark); 
    height: 100%; 
    overflow: hidden; /* O container principal gerencia o scroll */
}

a { color: var(--green-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 1. Estrutura Principal do Aplicativo */
.app-container {
    display: flex;
    max-width: 1400px;
    height: 100vh;
    margin: 0 auto;
    border-radius: var(--radius);
    overflow: hidden; /* Garante que o conteúdo não saia das bordas arredondadas */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background-color: var(--bg-white); 
}

/* 2. Barra Lateral (Sidebar) */
.sidebar {
    width: 300px;
    flex-shrink: 0;
    background: var(--bg-sidebar);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    border-right: 1px solid var(--border);
}

.sidebar-header { margin-bottom: 12px; }

.brand-name { font-size: 1.5rem; font-weight: 700; color: var(--green-primary); }
.brand-sub { font-size: 0.75rem; color: var(--text-muted); }

.sidebar-section h3, .sidebar-section h4 { 
    font-size: 1rem; 
    font-weight: 600; 
    margin-bottom: 8px;
}

/* Botões de Modo */
.mode-btn {
    display: block;
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 6px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    text-align: left;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.mode-btn:hover { background: #e5e7eb; }
.mode-btn.active { 
    background: var(--green-primary); 
    color: var(--bg-white); 
    font-weight: 500;
}
.mode-btn.active:hover { background: var(--green-hover); }

/* Exemplos */
.examples { list-style: none; padding: 0; font-size: 0.875rem; }
.examples li { 
    padding: 4px 0; 
    color: var(--text-muted);
}

/* Footer da Sidebar */
.sidebar-footer { 
    margin-top: auto; 
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Troca de Idioma */
.lang-switch button {
    background: transparent;
    border: 1px solid var(--border);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-dark);
    transition: all 0.2s;
}
.lang-switch button.active {
    background: var(--green-primary);
    border-color: var(--green-primary);
    color: var(--bg-white);
}

/* 3. Área Principal do Chat (Retângulo de Interface) */
.main-chat-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
    border-left: 1px solid var(--border);
}

.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.chat-title { font-size: 1.1rem; font-weight: 600; }
.chat-status { font-size: 0.75rem; color: var(--text-muted); }

.chat-window {
    flex-grow: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg-white); 
}

/* Mensagens de Chat */
.chat-message { display: flex; flex-direction: column; max-width: 85%; }
.chat-message.user { align-self: flex-end; align-items: flex-end; }
.chat-message.bot { align-self: flex-start; align-items: flex-start; }

.chat-label { font-size: 0.7rem; font-weight: 500; color: var(--text-muted); margin-bottom: 4px; }

.chat-bubble {
    padding: 10px 14px;
    border-radius: var(--radius);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
/* Bolha do Usuário (Verde) */
.chat-message.user .chat-bubble {
    background: var(--green-primary);
    color: var(--bg-white);
    border-bottom-right-radius: 4px; 
}
/* Bolha do Bot (Clara, com Borda) */
.chat-message.bot .chat-bubble {
    background: var(--bg-sidebar);
    color: var(--text-dark);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px; 
}
/* Formatação de conteúdo interno (listas, negritos) */
.chat-bubble strong { font-weight: 700; }
.chat-bubble h2, .chat-bubble h3, .chat-bubble h4 { margin-top: 10px; margin-bottom: 5px; font-weight: 600; }
.chat-bubble ul { padding-left: 20px; margin-bottom: 5px; }
.chat-bubble ul li { margin-bottom: 4px; }

/* Input de Chat */
.chat-input-area {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

#chat-input {
    flex-grow: 1;
    padding: 12px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}
#chat-input:focus { border-color: var(--green-primary); }

.btn-send {
    background: var(--green-primary);
    color: var(--bg-white);
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-send:hover { background: var(--green-hover); }

/* Media Queries (para visualização em telas menores) */
@media (max-width: 1000px) {
    .app-container { height: auto; min-height: 100vh; flex-direction: column; }
    .sidebar { 
        width: 100%; 
        border-right: none; 
        border-bottom: 1px solid var(--border); 
        padding-bottom: 16px; 
    }
    .sidebar-footer { 
        border-top: none; 
        justify-content: flex-start; 
        gap: 20px; 
        margin-top: 0; 
    }
    .main-chat-area { border-left: none; }
}