:root {
    /* Paleta Principal Aura */
    --cor-primaria: #10A37F;
    --cor-primaria-hover: #0E8F6F;
    
    /* Tema Escuro (Padrão do Manifesto) */
    --fundo: #0D0D0D;
    --superficie: #1A1A1A;
    --borda: #2A2A2A;
    --texto-p: #EDEDED;
    --texto-s: #A0A0A0;
    --msg-sistema: #1F1F1F;
    --msg-usuario: #123C33;
    
    /* Estados Semânticos */
    --sucesso: #10A37F;
    --erro: #D93025;
    --aviso: #F59E0B;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background: var(--fundo);
    color: var(--texto-p);
    font-family: 'Outfit', sans-serif;
    overflow: auto; /* permite scroll interno */
}

#app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    flex: 1;
    position: relative;
}

/* Tema Claro (Inversão) */
body.light-mode {
    --fundo: #FFFFFF;
    --superficie: #F7F7F7;
    --borda: #E5E5E5;
    --texto-p: #1A1A1A;
    --texto-s: #666666;
    --msg-sistema: #F0F0F0;
    --msg-usuario: #D1E7E2;
}

/* Reset Minimalista */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--fundo);
    color: var(--texto-p);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

/* --- ESTRUTURA PRINCIPAL (SINGLE PAGE) --- */

#app-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    position: relative;
}

header#aura-header {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--borda);
    background: var(--fundo);
    z-index: 10;
}

.topo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.aura-logo {
    display: flex;
    align-items: center;
}

.aura-logo img {
    height: 28px;
    width: auto;
}

.acoes-topo {
    display: flex;
    gap: 1rem;
    align-items: center;
}

#btn-sair {
    background: transparent;
    border: 1px solid var(--borda);
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--texto-s);
    cursor: pointer;
    transition: all 0.2s ease;
}

#btn-sair:hover {
    color: var(--texto-p);
    border-color: var(--texto-s);
    background: rgba(255, 255, 255, 0.05);
}

/* --- ROLAGEM GLOBAL (Aura Scroll) --- */
#chat-stream {
    flex: 1;
    overflow-y: scroll; /* Força a barra a existir sempre */
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    scroll-behavior: smooth;
    
    /* Custom Scrollbar for Chrome/Edge/Safari */
    scrollbar-width: thin;
    scrollbar-color: var(--cor-primaria) transparent;
}

#chat-stream::-webkit-scrollbar {
    width: 14px;
    display: block !important;
}

#chat-stream::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

#chat-stream::-webkit-scrollbar-thumb {
    background: var(--cor-primaria); /* Use primary accent color */
    border: 2px solid rgba(0,0,0,0);
    background-clip: padding-box;
    border-radius: 10px;
}

#chat-stream::-webkit-scrollbar-thumb:hover {
    background: #888888; /* Destaque ao passar o mouse */
}

#interacao-container {
    padding: 1.2rem;
    background: var(--fundo);
    border-top: 1px solid var(--borda);
    margin-bottom: 40px; /* Espaço para o footer */
}

/* --- BOLHAS E MENSAGENS --- */

.bubble {
    max-width: 85%;
    padding: 1.2rem;
    line-height: 1.6;
    font-size: 1rem;
    border-radius: 18px;
    animation: bubbleUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

/* Timestamp style */
.timestamp {
    align-self: flex-end;
    font-size: 0.7rem;
    color: var(--texto-s);
    margin-top: 8px;
    opacity: 0.7;
    font-weight: 300;
}

.bubble.system {
    align-self: flex-start;
    background-color: rgba(31, 31, 31, 0.7);
    color: var(--texto-p);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom-left-radius: 4px;
}

.bubble.user {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(16, 163, 127, 0.2), rgba(16, 163, 127, 0.4));
    color: var(--texto-p);
    border: 1px solid rgba(16, 163, 127, 0.3);
    border-bottom-right-radius: 4px;
    backdrop-filter: blur(12px);
}

/* --- BLOCOS DE AÇÃO (INTERAÇÃO) --- */

#acao-blocos {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

button {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--texto-p);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.9rem 1.6rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 400;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.7rem;
    backdrop-filter: blur(5px);
}

button:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--cor-primaria);
}

button.primario {
    background: linear-gradient(135deg, var(--cor-primaria), var(--cor-primaria-hover));
    color: white;
    border: none;
    font-weight: 600;
}

button.primario:hover {
    filter: brightness(1.1);
}

input {
    background: var(--superficie);
    border: 1px solid var(--borda);
    color: var(--texto-p);
    padding: 0.7rem 1rem;
    border-radius: 10px;
    width: 100%;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--cor-primaria);
}

/* --- ANIMAÇÕES E EFEITOS --- */

@keyframes bubbleUp {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.typing::after {
    content: '|';
    animation: blink 1s infinite;
}

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

/* Imagens (Logo) no Chat */
.bubble img {
    max-width: 100px;
    height: auto;
    display: block;
    margin: 0 auto;
}

#btn-config {
    background: transparent;
    border: none;
    padding: 0.5rem;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
}

#btn-config:hover {
    opacity: 1;
    transform: rotate(45deg);
}

.aura-footer {
    position: fixed;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.75rem;
    color: var(--texto-s);
    opacity: 0.5;
    pointer-events: none;
    z-index: 100;
}
