:root {
    --text-color-dark: #202124;
    --text-color-light: #e3e3e3;
    --ai-message-bg: #f1f3f4;
    --border-color: #dcdcdc;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    height: 100%;
}

body {
    color: var(--text-color-dark);
    /* Background padrão para desktop */
    background-image: url('fundo.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
}

header {
    padding: 1rem;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    position: relative;
}

header img {
    max-height: 200px;
    transition: max-height 0.3s ease;
}

#new-chat-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    
    background-color: #ffffff;
    color: var(--text-color-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.2s ease;
}
#new-chat-btn:hover {
    background-color: #f7f7f7;
}
#new-chat-btn svg {
    width: 20px;
    height: 20px;
}

.chat-container {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem 1rem 1rem;
    box-sizing: border-box;
    overflow: hidden;
}

#chat-box {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background-color: #ffffff;
    border-radius: 12px;
    color: var(--text-color-dark);
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    line-height: 1.6;
    max-width: 100%;
}

.ai-message .text-container {
    background-color: var(--ai-message-bg);
    border-radius: 8px;
    padding: 0.5rem 1rem;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    flex-shrink: 0;
    padding: 3px;
    box-sizing: border-box;
    background-color: #f0f4f9;
}

.message .text {
    padding-top: 4px;
    white-space: pre-wrap;
    word-break: break-word;
}

.loading-indicator {
    padding: 0.5rem 1rem;
}
.loading-indicator .dot {
    background-color: #888;
}
@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

.input-area {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 0 1rem 0;
}

#user-input {
    flex-grow: 1;
    background-color: #ffffff;
    color: var(--text-color-dark);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 12px 20px;
    font-size: 16px;
    resize: none;
    font-family: inherit;
    line-height: 1.5;
    outline: none;
}

#send-btn {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: #5f6368;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    flex-shrink: 0;
}
#send-btn:hover {
    background-color: #f1f3f4;
}

/* --- REGRAS PARA RESPONSIVIDADE (TELAS MENORES QUE 768px) --- */
@media (max-width: 768px) {
    body {
        font-size: 16px;
        /* ALTERADO: Define o background específico para celular */
        background-image: url('fundo_mobile.png'); 
    }

    header {
        padding: 0.75rem;
    }

    header img {
        max-height: 150px;
    }

    #new-chat-btn span {
        display: none;
    }
    #new-chat-btn {
        width: 40px;
        height: 40px;
        padding: 0;
        top: 25%;
        gap: 0;
        border-radius: 50%;
        right: 0.75rem;
    }

    .chat-container {
        padding: 0 0.5rem 0.5rem 0.5rem;
    }

    #chat-box {
        padding: 1rem;
        gap: 1.25rem;
    }

    .input-area {
        gap: 0.5rem;
        padding: 1rem 0;
    }

    #user-input {
    flex-grow: 1;
    background-color: #ffffff;
    color: var(--text-color-dark);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 12px 20px;
    font-size: 16px;
    font-family: inherit;
    line-height: 1.5;
    outline: none;
    /* --- ADICIONE AS DUAS LINHAS ABAIXO --- */
    resize: none; /* Impede o redimensionamento manual pelo usuário */
    max-height: 200px; /* Define uma altura máxima */
    }

    #send-btn {
        width: 42px;
        height: 42px;
    }
}