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

:root {
    --bg: #f4f7f6;
    --text: #2d3436;
    --accent: #29c7b4;
    --white: #ffffff;
    --ai-msg: #f1f2f6;
}

body {
    font-family: 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.app-container {
    width: 90%;
    max-width: 450px;
    height: 85vh;
    background: var(--white);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

header { text-align: center; margin-bottom: 10px; }
header h1 { margin: 0; font-size: 1.5rem; color: var(--accent); }
header p { font-size: 0.85rem; color: #636e72; }

.chat-box {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    animation: fadeIn 0.3s ease;
}

.ai { background: var(--ai-msg); align-self: flex-start; color: var(--text); border-bottom-left-radius: 4px; }
.user { background: #29c7b4; color: white; align-self: flex-end; border-bottom-right-radius: 4px; }

.controls { text-align: center; padding-top: 20px; }

.btn-mic {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    border: none;
    background: #29c7b4;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-mic:active { transform: scale(0.9); }


/* Animação quando a IA está "falando" */
.speaking {
    animation: pulse 1.5s infinite;
    box-shadow: 0 0 0 12px rgba(46, 121, 62, 0.2);
}

/* Classe que aplica a animação ao ícone */
.loading i {
    animation: spin 2s linear infinite; /* Gira infinitamente em 2 segundos */
    color: #fff; /* Opcional: muda a cor do ícone para dar mais destaque */
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

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

/* Animação de girar */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
