/*
|--------------------------------------------------------------------------
| RESET
|--------------------------------------------------------------------------
*/

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html,
body{
    width:100%;
    height:100%;
    overflow:hidden;
    font-family:Arial, Helvetica, sans-serif;
}

body.light-theme{
    background:#e5ddd5;
}

/*
|--------------------------------------------------------------------------
| APP
|--------------------------------------------------------------------------
*/

.wa-app{
    width:100%;
    height:100vh;
    display:flex;
    overflow:hidden;
}

/*
|--------------------------------------------------------------------------
| SIDEBAR
|--------------------------------------------------------------------------
*/

.wa-sidebar{
    width:340px;
    background:#ffffff;
    border-right:1px solid #d1d7db;
    display:flex;
    flex-direction:column;
    flex-shrink:0;
}

.wa-sidebar-top{
    height:60px;
    background:#f0f2f5;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 16px;
    border-bottom:1px solid #e9edef;
}

.wa-sidebar-header{
    font-size:22px;
    font-weight:600;
    color:#111b21;
}

.wa-sidebar-actions{
    display:flex;
    align-items:center;
    gap:14px;
    color:#54656f;
    font-size:18px;
    font-weight:600;
}

.wa-search-wrapper{
    padding:12px 12px;
}

.wa-search{
    height:38px;
    background:#f0f2f5;
    border-radius:8px;
    display:flex;
    align-items:center;
    padding:0 12px;
    color:#667781;
    font-size:14px;
}

.wa-filters{
    display:flex;
    gap:8px;
    padding:0 12px 12px;
}

.wa-filter{
    padding:7px 14px;
    border-radius:16px;
    background:#f0f2f5;
    color:#54656f;
    font-size:14px;
}

.wa-filter.active{
    background:#d9fdd3;
    color:#008069;
}

/*
|--------------------------------------------------------------------------
| CHAT LIST
|--------------------------------------------------------------------------
*/

.desktop-chat-item{
    display:flex;
    align-items:center;
    padding:12px 16px;
    cursor:pointer;
    transition:.2s;
}

.desktop-chat-item:hover{
    background:#f5f6f6;
}

.desktop-chat-item.active{
    background:#f0f2f5;
}

.desktop-chat-avatar{
    width:50px;
    height:50px;
    border-radius:50%;
    overflow:hidden;
    margin-right:12px;
    flex-shrink:0;
}

.desktop-chat-avatar img{
    width:100%;
    height:100%;
    object-fit:cover;
}

.desktop-chat-info{
    min-width:0;
}

.desktop-chat-name{
    font-size:15px;
    font-weight:600;
    color:#111b21;
    margin-bottom:4px;
}

.desktop-chat-preview{
    font-size:13px;
    color:#667781;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

/*
|--------------------------------------------------------------------------
| RIGHT PANEL
|--------------------------------------------------------------------------
*/

.wa-chat-panel{
    flex:1;
    display:flex;
    flex-direction:column;
    min-width:0;
    position:relative;
}

/*
|--------------------------------------------------------------------------
| HEADER
|--------------------------------------------------------------------------
*/

.wa-header{
    height:60px;
    background:#f0f2f5;
    border-bottom:1px solid #d1d7db;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 16px;
    flex-shrink:0;
    z-index:50;
}

.wa-header-left{
    display:flex;
    align-items:center;
}

.wa-back-button{
    display:none;
}

.chat-header-avatar{
    width:40px;
    height:40px;
    border-radius:50%;
    overflow:hidden;
    flex-shrink:0;
}

.chat-header-avatar img{
    width:100%;
    height:100%;
    object-fit:cover;
}

.chat-header-info{
    margin-left:12px;
}

.chat-header-name{
    font-size:16px;
    font-weight:600;
    color:#111b21;
}

.chat-header-status{
    font-size:13px;
    color:#667781;
    margin-top:2px;
}

.wa-header-actions{
    display:flex;
    gap:18px;
    color:#54656f;
    font-size:18px;
	cursor:pointer;
}
.wa-back-button{
    display:flex;
    align-items:center;
    justify-content:center;
    margin-right:12px;
    color:#54656f;
    font-size:18px;
}

/*
|--------------------------------------------------------------------------
| CHAT AREA
|--------------------------------------------------------------------------
*/

.chat-container{
    flex:1;
    overflow-y:auto;
    background-image:url('../assets/backgrounds/chat_bg.jpg');
    background-size:300px auto;
    background-repeat:repeat;
    background-position:center;
}

.chat-messages{
    padding:18px 14px 90px;
    min-height:100%;
}

/*
|--------------------------------------------------------------------------
| MESSAGE
|--------------------------------------------------------------------------
*/

.message{
    display:flex;
    align-items:flex-start;
    margin-bottom:14px;
    animation:fadeMessage .3s ease;
}

.message-avatar{
    width:40px;
    height:40px;
    border-radius:50%;
    overflow:hidden;
    margin-right:10px;
    flex-shrink:0;
}

.message-avatar img{
    width:100%;
    height:100%;
    object-fit:cover;
}

.message-content{
    background:#ffffff;
    color:#111;
    border-radius:10px;
    padding:10px 12px;
    max-width:420px;
    font-size:15px;
    line-height:1.5;
    box-shadow:0 1px 1px rgba(0,0,0,.08);
}

.message-photo{
    width:100%;
    display:block;
    border-radius:8px;
    margin-top:6px;
}

.upload-progress{
    color:#667781;
    font-size:14px;
    min-width:180px;
}

/*
|--------------------------------------------------------------------------
| TYPING
|--------------------------------------------------------------------------
*/

.typing{
    opacity:.85;
}

.typing-bubble{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:4px;
    min-width:52px;
    min-height:24px;
}

.typing-dot{
    width:7px;
    height:7px;
    border-radius:50%;
    background:#8696a0;
    animation:typingBounce 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(2){
    animation-delay:.2s;
}

.typing-dot:nth-child(3){
    animation-delay:.4s;
}

/*
|--------------------------------------------------------------------------
| INPUT
|--------------------------------------------------------------------------
*/

.fake-input-bar{
    height:62px;
    background:#f0f2f5;
    border-top:1px solid #d1d7db;
    display:flex;
    align-items:center;
    gap:8px;
    padding:8px 10px;
    flex-shrink:0;
}

.fake-input-inner{
    flex:1;
    height:46px;
    background:#ffffff;
    border-radius:24px;
    display:flex;
    align-items:center;
    padding:0 14px;
}

.fake-input-placeholder{
    flex:1;
    color:#667781;
    font-size:15px;
    padding:0 10px;
}

.fake-input-icon{
    font-size:18px;
}

.fake-send-button{
    width:46px;
    height:46px;
    border-radius:50%;
    background:#00a884;
    color:#ffffff;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:20px;
    flex-shrink:0;
}

/*
|--------------------------------------------------------------------------
| POPUPS
|--------------------------------------------------------------------------
*/

.popup-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.75);
    display:none;
    align-items:center;
    justify-content:center;
    z-index:99999;
}

.popup-box{
    width:90%;
    max-width:380px;
    background:#ffffff;
    border-radius:16px;
    padding:24px;
    text-align:center;
    color:#111;
}

.popup-box h3{
    margin-bottom:10px;
}

.popup-buttons{
    margin-top:20px;
}

.popup-buttons button{
    border:none;
    background:#25d366;
    color:#fff;
    padding:12px 18px;
    border-radius:8px;
    margin:5px;
    cursor:pointer;
    font-weight:600;
}

.register-btn{
    display:inline-block;
    margin-top:18px;
    background:#25d366;
    color:#fff;
    text-decoration:none;
    padding:13px 22px;
    border-radius:8px;
    font-weight:600;
}

/*
|--------------------------------------------------------------------------
| MOBILE
|--------------------------------------------------------------------------
*/

@media(max-width:900px){

    .wa-sidebar{
        display:none;
    }

    .wa-back-button{
        display:flex;
        align-items:center;
        justify-content:center;
        margin-right:12px;
        font-size:24px;
        color:#54656f;
    }

    .chat-messages{
        padding:14px 10px 85px;
    }

    .message-content{
        max-width:80vw;
        font-size:15px;
    }
}

/*
|--------------------------------------------------------------------------
| ANIMATIONS
|--------------------------------------------------------------------------
*/

@keyframes typingBounce{

    0%,80%,100%{
        transform:scale(.7);
        opacity:.5;
    }

    40%{
        transform:scale(1);
        opacity:1;
    }
}

@keyframes fadeMessage{

    from{
        opacity:0;
        transform:translateY(8px);
    }

    to{
        opacity:1;
        transform:translateY(0);
    }
}