/* Definições Gerais e Reset */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    height: 100vh;
    width: 100vw;
    overflow: hidden; /* Vital para modo Totem/Kiosk */
    display: flex;
    flex-direction: column;
}

/* Monitor de Diagnóstico (Canto Superior Direito) */
#camera-monitor {
    position: fixed;
    top: 15px;
    right: 15px;
    width: 140px;
    height: 105px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(56, 189, 248, 0.3);
    background: #000;
    z-index: 1000;
    box-shadow: 0 8px 20px rgba(0,0,0,0.6);
}

#video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Efeito espelho */
}

#canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: scaleX(-1);
}

#debug-status {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    font-size: 9px;
    text-align: center;
    padding: 3px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #38bdf8;
}

/* Estrutura Principal Expansiva */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    padding: 4vh 6vw;
    box-sizing: border-box;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 2vh;
}

#logo {
    font-weight: 900;
    font-size: 1.8rem;
    color: #38bdf8;
    letter-spacing: -1px;
}

#indicador-presenca {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ef4444; /* Vermelho padrão */
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
    transition: all 0.4s ease;
}

/* Área Central de Interação */
#content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
}

#avatar-container {
    margin-bottom: 3vh;
}

.avatar-circle {
    width: clamp(100px, 15vh, 180px);
    height: clamp(100px, 15vh, 180px);
    background: rgba(56, 189, 248, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(50px, 8vh, 90px);
    border: 3px solid #38bdf8;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Feedback visual de fala do robô */
.falando {
    animation: pulse-border 1.2s infinite ease-in-out;
    background: rgba(56, 189, 248, 0.15);
}

@keyframes pulse-border {
    0% { transform: scale(1); box-shadow: 0 0 0 0px rgba(56, 189, 248, 0.5); }
    70% { transform: scale(1.08); box-shadow: 0 0 0 25px rgba(56, 189, 248, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0px rgba(56, 189, 248, 0); }
}

/* Tipografia Adaptável */
h1 { 
    font-size: clamp(2.2rem, 6vw, 4.5rem); 
    margin: 0; 
    font-weight: 800;
    line-height: 1.1;
}

#instrucao { 
    font-size: clamp(1.2rem, 2.5vw, 2rem); 
    opacity: 0.6; 
    margin-top: 10px;
    font-weight: 400;
}

#conversa-ativa { 
    margin-top: 3vh; 
    width: 100%; 
    max-width: 900px;
}

#pergunta-cliente {
    font-size: clamp(1.1rem, 2.2vw, 1.8rem);
    color: #94a3b8;
    min-height: 2rem;
    font-style: italic;
    margin-bottom: 15px;
}

/* Bloco de Resposta em Destaque */
#resposta-bot-container {
    padding: clamp(20px, 4vh, 40px);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#resposta-bot {
    font-size: clamp(1.4rem, 4vw, 3rem);
    font-weight: 700;
    color: #f0f9ff;
    line-height: 1.3;
    margin: 0;
}

/* Visualizer (Animação de escuta) */
#visualizer {
    margin-top: 3vh;
    display: none; 
    gap: 8px;
    height: 50px;
    align-items: center;
}

.bar {
    width: 8px;
    height: 15px;
    background: #22c55e;
    border-radius: 10px;
    animation: bar-bounce 0.8s infinite ease-in-out;
}

.bar:nth-child(2) { animation-delay: 0.1s; }
.bar:nth-child(3) { animation-delay: 0.2s; }
.bar:nth-child(4) { animation-delay: 0.3s; }
.bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes bar-bounce {
    0%, 100% { height: 12px; opacity: 0.5; }
    50% { height: 45px; opacity: 1; transform: translateY(-5px); }
}

/* BOTÃO DE MICROFONE MANUAL */
#controls {
    margin-top: 25px;
    display: flex;
    justify-content: center;
}

#btn-microfone {
    background: #38bdf8;
    color: #0f172a;
    border: none;
    padding: clamp(15px, 2.5vh, 25px) clamp(30px, 5vw, 50px);
    border-radius: 50px;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(56, 189, 248, 0.4);
    transition: all 0.3s ease;
    text-transform: uppercase;
}

#btn-microfone.ouvindo {
    background: #22c55e;
    box-shadow: 0 0 25px rgba(34, 197, 94, 0.6);
    animation: btn-pulse 1.5s infinite;
}

@keyframes btn-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

footer {
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.3;
    padding-bottom: 2vh;
    letter-spacing: 2px;
    text-transform: uppercase;
}