﻿/* ===========================================================
   LARISSA CHAT
   WhatsApp Inspired UI
   Version 1.0
=========================================================== */

:root {
    --wa-green: #00a884;
    --wa-green-light: #d9fdd3;
    --wa-bg: #efeae2;
    --wa-panel: #ffffff;
    --wa-hover: #f5f6f6;
    --wa-selected: #f0f2f5;
    --wa-border: #e9edef;
    --wa-text: #111b21;
    --wa-text-secondary: #667781;
    --wa-shadow: 0 1px 2px rgba(0,0,0,.15);
}


/* ===========================================================
   LAYOUT
=========================================================== */

.chat-layout {
    display: flex;
    height: 100vh;
    background: var(--wa-bg);
    overflow: hidden;
}

.sidebar {
    width: 370px;
    background: white;
    border-right: 1px solid var(--wa-border);
    display: flex;
    flex-direction: column;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--wa-bg);
}


/* ===========================================================
   SIDEBAR HEADER
=========================================================== */

.sidebar-header {
    height: 70px;
    padding: 15px;
    border-bottom: 1px solid var(--wa-border);
    background: white;
}

.sidebar-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--wa-text);
}

.sidebar-subtitle {
    font-size: 13px;
    color: var(--wa-text-secondary);
}


/* ===========================================================
   SEARCH
=========================================================== */

.room-search {
    padding: 10px;
    background: #f0f2f5;
    border-bottom: 1px solid var(--wa-border);
}

    .room-search input {
        width: 100%;
        height: 40px;
        border: none;
        border-radius: 8px;
        background: white;
        padding: 0 15px;
        outline: none;
        font-size: 14px;
    }


/* ===========================================================
   ROOM LIST
=========================================================== */

.room-list {
    flex: 1;
    overflow-y: auto;
    background: white;
}

    .room-list::-webkit-scrollbar {
        width: 8px;
    }

    .room-list::-webkit-scrollbar-thumb {
        background: #d3d3d3;
        border-radius: 10px;
    }




/* ===========================================================
   ROOM ITEM
=========================================================== */

.room-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    cursor: pointer;
    transition: background-color .15s ease;
    border-bottom: 1px solid #f5f5f5;
    user-select: none;
}

    .room-item:hover {
        background: var(--wa-hover);
    }

    .room-item.active {
        background: var(--wa-selected);
        background: #f0f2f5;
    }

/* ===========================================================
   AVATAR
=========================================================== */

.avatar {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 50%;
    background: #dfe5e7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    color: #54656f;
    margin-right: 14px;
}

/* ===========================================================
   ROOM CONTENT
=========================================================== */

.room-content {
    flex: 1;
    min-width: 0;
}

.room-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.room-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--wa-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-time {
    margin-left: 10px;
    font-size: 12px;
    color: var(--wa-text-secondary);
    white-space: nowrap;
}

/* ===========================================================
   LAST MESSAGE
=========================================================== */

.room-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.room-preview {
    flex: 1;
    color: var(--wa-text-secondary);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===========================================================
   UNREAD BADGE
=========================================================== */

.unread-badge {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 50%;
    margin-left: 8px;
    background: #25d366;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
}


/* ===========================================================
   CHAT HEADER
=========================================================== */


.chat-header {
    height: 68px;
    background: white;
    border-bottom: 1px solid var(--wa-border);
    display: flex;
    align-items: center;
    padding: 0 18px;
}




.typing-text {
    color: #25D366;
    font-weight: 500;
}

.chat-header-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #dfe5e7;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-weight: bold;
}

.chat-header-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--wa-text);
}

.chat-header-status {
    font-size: 13px;
    color: var(--wa-text-secondary);
    margin-top: 2px;
}


.chat-header-actions {
    display: flex;
    gap: 6px;
}

.header-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: .15s;
    font-size: 18px;
}

    .header-btn:hover {
        background: rgba(0,0,0,.08);
    }
/* ===========================================================
   CHAT BODY
=========================================================== */

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 48px;    
    scroll-behavior: smooth;
    background: #efeae2;
    background-image: radial-gradient(rgba(255,255,255,.15) 1px, transparent 1px);
    background-size: 24px 24px;
}

    .chat-body::-webkit-scrollbar {
        width: 8px;
    }

    .chat-body::-webkit-scrollbar-thumb {
        background: #bcbcbc;
        border-radius: 10px;
    }

/* ===========================================================
   CHAT ROW
=========================================================== */

.message-row {
    display: flex;
    margin: 8px 0;
}

    .message-row.left {
        justify-content: flex-start;
    }

    .message-row.right {
        justify-content: flex-end;
    }


/* ===========================================================
   CHAT BUBBLE
=========================================================== */

.message-bubble {
/*    max-width: 55%;
    min-width: 90px;*/
    padding: 8px 12px;
    border-radius: 10px;
    box-shadow: var(--wa-shadow);
    position: relative;
    animation: bubblePop .12s ease-out;
    word-break: break-word;
    display: inline-block;
    max-width: 280px;
    overflow: hidden;
}


    .message-bubble.customer {
        background: white;
        color: var(--wa-text);
        border-top-left-radius: 4px;
    }


    .message-bubble.agent {
        background: var(--wa-green-light);
        color: var(--wa-text);
        border-top-right-radius: 4px;
    }



    .message-bubble.customer::before {
        content: "";
        position: absolute;
        left: -6px;
        top: 8px;
        border-right: 8px solid white;
        border-top: 6px solid transparent;
        border-bottom: 6px solid transparent;
    }

    .message-bubble.agent::after {
        content: "";
        position: absolute;
        right: -6px;
        top: 8px;
        border-left: 8px solid var(--wa-green-light);
        border-top: 6px solid transparent;
        border-bottom: 6px solid transparent;
    }


.message-text {
    font-size: 15px;
    line-height: 1.45;
    white-space: pre-wrap;
}



.message-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
    font-size: 11px;
    color: #667781;
}


.message-status {
    font-size: 13px;
    font-weight: bold;
}


    .message-status.sent {
        color: #8696a0;
    }
    .message-status.delivered {
        color: #999;
    }
/*    .message-status.read {
        color: #53bdeb;
    }*/
    .message-status.read {
        color: #4fc3f7;
    }

@keyframes bubblePop {

    from {
        transform: scale(.96);
        opacity: .6;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}


/* ===========================================================
   CHAT INPUT
=========================================================== */

.chat-input {
    height: 68px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #f0f2f5;
    border-top: 1px solid var(--wa-border);
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.chat-input-box {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    color: var(--wa-text);
    min-width: 0;
}
.chat-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 24px;
    padding: 0 8px 0 16px;
    height: 46px;
}
    .chat-input-box::placeholder {
        color: #8696a0;
    }

.chat-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: #54656f;
    transition: .15s;
    font-size: 22px;
    flex-shrink: 0;
}

    .chat-icon:hover {
        background: rgba(0,0,0,.08);
    }

.chat-send {
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: var(--wa-green);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: .15s;
}


    .chat-send:hover {
        transform: scale(1.05);
    }

.chat-tool {
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    color: #54656f;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: .15s;
}

    .chat-tool:hover {
        background: rgba(0,0,0,.08);
    }

.date-separator {
    display: flex;
    justify-content: center;
    margin: 16px 0;
}

    .date-separator span {
        background: #e1f3fb;
        color: #54656f;
        font-size: 12px;
        padding: 6px 12px;
        border-radius: 8px;
    }



.empty-chat {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: #667781;
    gap: 10px;
}


.mine {
    margin-left: auto;
    background: #DCF8C6;
}

.other {
    margin-right: auto;
    background: white;
}

.chat-image {
    max-width: 260px;
    max-height: 360px;
    width: auto;
    height: auto;
    border-radius: 12px;
    display: block;
}


