:root { 
    --wa-teal: #005c4b; --wa-green: #25D366; --wa-light-green: #d9fdd3; 
    --white: #ffffff; --bg-gray: #f0f2f5; --text-main: #111b21; 
    --text-secondary: #667781; --font-inter: 'Inter', sans-serif;
}

html, body { height: 100%; margin: 0; padding: 0; background-color: #dadbd3; overflow: hidden; }
* { box-sizing: border-box; font-family: var(--font-inter); -webkit-tap-highlight-color: transparent; }
body { display: flex; justify-content: center; align-items: center; }

#app { 
    width: 100%; max-width: 450px; height: 100%; background: white; 
    display: flex; flex-direction: column; position: relative; 
    box-shadow: 0 0 30px rgba(0,0,0,0.1); 
}

/* Footer Nav */
.footer { 
    position: absolute; bottom: 0; width: 100%; height: 65px; 
    background: #fff; border-top: 1px solid #f0f0f0; 
    display: none; justify-content: space-around; align-items: center; z-index: 1000; 
}
.nav-item { text-align: center; color: var(--text-secondary); cursor: pointer; flex: 1; font-size: 11px; font-weight: 500; }
.nav-item i { font-size: 20px; display: block; margin-bottom: 4px; transition: 0.3s; }
.nav-item.active { color: var(--wa-teal); }

/* Screens Logic */
.screen { display: none; flex-direction: column; height: 100%; background: white; overflow: hidden; }
.screen.active { display: flex; }
.no-footer { padding-bottom: 0 !important; }
.auth-container { flex: 1; display: flex; flex-direction: column; padding: 30px; justify-content: space-between; }
.center-area { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.bottom-area { padding-bottom: env(safe-area-inset-bottom, 20px); width: 100%; }

/* Form Elements */
input, textarea { 
    width: 100%; padding: 12px; border: none; border-bottom: 2px solid #e9edef; 
    font-size: 18px; outline: none; text-align: center; background: transparent; transition: 0.3s;
}
input:focus { border-bottom-color: var(--wa-teal); }
.btn { 
    width: 100%; padding: 16px; background: var(--wa-green); color: white; 
    border: none; border-radius: 30px; font-weight: 600; font-size: 15px; 
    cursor: pointer; text-transform: uppercase; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.btn:active { transform: scale(0.98); background: #20bd5c; }
.link-label { margin-top:20px; color:var(--wa-teal); font-weight:600; text-align:center; cursor:pointer; font-size:14px; }

/* Header & Lists */
.header { background: var(--wa-teal); color: white; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 19px; flex-shrink: 0; z-index: 100; }
.search-box { padding: 10px 15px; background: white; position: sticky; top: 0; z-index: 90; border-bottom: 1px solid #f0f0f0; flex-shrink: 0; }
.search-box input { border-radius: 20px; background: var(--bg-gray); text-align: left; font-size: 14px; padding: 10px 20px; border: none; width: 100%; outline: none; }

.list-container { flex: 1; overflow-y: auto; background: white; -webkit-overflow-scrolling: touch; }
.item-row { padding: 14px 18px; border-bottom: 1px solid #f5f5f5; cursor: pointer; display: flex; align-items: center; user-select: none; }
.item-row:active { background: #f0f2f5; }
.item-row i.icon { font-size: 44px; margin-right: 15px; color: #ced4da; }
.item-info { flex: 1; overflow: hidden; }
.item-msg { color: var(--text-secondary); font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section-title { background: #f0f2f5; padding: 10px 20px; font-size: 12px; font-weight: 700; color: var(--wa-teal); }

/* Chat Bubbles */
.chat-area { flex: 1; overflow-y: auto; background: #efeae2; padding: 15px; display: flex; flex-direction: column; scroll-behavior: smooth; }
.msg { max-width: 85%; padding: 8px 12px; border-radius: 12px; margin-bottom: 6px; font-size: 14.5px; position: relative; box-shadow: 0 1px 2px rgba(0,0,0,0.05); word-wrap: break-word; }
.sent { align-self: flex-end; background: #d9fdd3; border-top-right-radius: 2px; }
.received { align-self: flex-start; background: white; border-top-left-radius: 2px; }
.msg-sender { font-size: 11px; font-weight: 700; color: var(--wa-teal); margin-bottom: 2px; display: block; }
.msg-time { font-size: 10px; color: #667781; text-align: right; display: block; margin-top: 4px; }
.input-box { display: flex; padding: 10px 15px; background: #f0f0f0; align-items: center; flex-shrink: 0; }
.input-box input { flex: 1; border: none; border-radius: 25px; padding: 10px 18px; background: white; outline: none; text-align: left; font-size: 15px; }

/* Profile Card */
.profile-card { background: white; border-radius: 20px; padding: 20px; margin: 15px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.profile-field { display: flex; align-items: center; border-bottom: 1px solid #f0f0f0; padding: 12px 0; }
.profile-field i { color: var(--wa-teal); width: 35px; font-size: 18px; text-align: center; }
.profile-field div { flex: 1; }
.profile-field label { font-size: 11px; font-weight: 700; color: var(--text-secondary); display: block; text-align: left; }
.profile-field input { border: none; text-align: left; font-size: 15px; padding: 4px 0; width: 100%; color: var(--text-main); margin-bottom: 0; }
.avatar-lg { width: 85px; height: 85px; background: #e9edef; border-radius: 50%; margin: 0 auto 15px; display: flex; align-items: center; justify-content: center; font-size: 35px; color: var(--wa-teal); border: 3px solid var(--wa-teal); }

.logout-icon { cursor: pointer; font-size: 18px; }
#search-results { display: none; }
