/* ==========================================
   NEKOHUB CLEAN 🐾 - WHITE MODE (V1.0)
   ========================================== */

:root {
    --bg: #ffffff;
    --text: #1a1a1a;
    --msg-mine: #000000;
    --msg-other: #f2f2f2;
    --accent: #007aff;
    --border: #f0f0f0;
}

* {
    margin: 0; 
    padding: 0; 
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background: var(--bg);
    color: var(--text);
    height: 100dvh; /* Dynamic viewport height para mobile */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Evita scroll na página toda, foca só no chat */
}

/* Telas */
.screen { 
    display: flex; 
    flex-direction: column; 
    height: 100%; 
    width: 100%; 
}

/* LOGIN */
#login { 
    justify-content: center; 
    align-items: center; 
    text-align: center; 
    padding: 20px;
}

#login h1 { 
    font-size: 2.5rem; 
    margin-bottom: 20px; 
    letter-spacing: -1px;
}

#loginBtn {
    background: #000; 
    color: #fff; 
    border: none;
    padding: 16px 32px; 
    border-radius: 50px;
    font-weight: bold; 
    font-size: 1rem;
    cursor: pointer; 
    transition: transform 0.2s;
}

#loginBtn:active { transform: scale(0.95); }

/* NAVBAR */
.navbar {
    padding: 10px 20px;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: #fff;
    min-height: 60px;
}

.user-info { display: flex; align-items: center; gap: 10px; }
#userAvatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
#userNameShort { font-weight: 600; font-size: 0.9rem; }

#logoutBtn { 
    background: none; 
    border: none; 
    color: #ff3b30; 
    font-weight: bold; 
    cursor: pointer; 
}

/* AREA DE CHAT (Onde a mágica acontece) */
#chat {
    flex: 1;
    overflow-y: auto; /* Permite o rolamento */
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg);
    scroll-behavior: smooth; /* Rolagem suave */
}

/* Estilização da barra de rolagem (opcional, fica mais bonito) */
#chat::-webkit-scrollbar { width: 4px; }
#chat::-webkit-scrollbar-thumb { background: #ddd; border-radius: 10px; }

/* MENSAGENS */
.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
    animation: slideUp 0.3s ease-out;
    word-wrap: break-word; /* Impede que o texto saia do balão */
    word-break: break-word;
}

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

/* Mensagem dos outros */
.message.other {
    background: var(--msg-other);
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

/* Mensagem sua */
.message.mine {
    background: var(--msg-mine);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.msg-user {
    display: block;
    font-size: 0.75rem;
    margin-bottom: 4px;
    opacity: 0.7;
    font-weight: bold;
}

/* INPUT AREA */
.input-area {
    padding: 10px 15px 30px 15px; /* Padding extra embaixo para o teclado mobile */
    background: #fff;
    border-top: 1px solid var(--border);
}

.input-box {
    display: flex;
    align-items: center;
    background: #f2f2f2;
    padding: 4px 12px;
    border-radius: 24px;
    max-width: 900px;
    margin: 0 auto;
}

#msg {
    flex: 1; 
    border: none; 
    background: none;
    padding: 10px; 
    font-size: 1rem; 
    outline: none;
    color: var(--text);
}

#sendBtn {
    background: none; 
    border: none; 
    color: var(--accent);
    font-weight: bold; 
    cursor: pointer; 
    padding: 10px;
    font-size: 1rem;
}

#sendBtn:active { opacity: 0.5; }
