
.main-container {
    display: grid;
    grid-template-columns: 2.2fr 4fr;
    width: 100vw;
}

.room-sidebar {
    justify-self: left;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 59px 89px 60px repeat(auto-fit, minmax(60px, 60px));
    width:100%;
    border-right:.75px solid #CCC;
}

.room-sidebar-header {
    background-color: #f0f0f0ff;
    display: grid;
    grid-template-columns: 48px auto 37px 37px 37px;
    grid-template-areas: "sb-avatar . sb-status sb-new-chat sb-menu" ;
    gap: 1rem;
    align-items:center;
    padding:.5rem;
}


.sb-avatar {
    grid-area: sb-avatar;
}

.sb-avatar img {
    width:48px;
    height: 48px;
    object-fit: cover;
    border-radius: 50%;
}

.sb-status {
    grid-area: sb-status;
}

.sb-new-chat {
    grid-area: sb-new-chat;
}

.sb-menu {
    grid-area: sb-menu;
}

.room-sidebar-get-notified {
    display:grid;
    grid-template-columns: 50px auto;
    background-color: #9DE1FE;
    align-items: center;
    padding: .5rem;
}

.room-sidebar-get-notified-alert {
    justify-self: center;
}

.room-sidebar-get-notified-msg {
    padding:.5rem;
    justify-self: left;
    display: grid;
    grid-template-columns: auto;
    grid-template-rows: 1fr 1fr;
    gap: .20rem;
    max-width: 442px;
}

.room-sidebar-get-notified-msg1 {
    font-size: 1rem;
    color: #303030F5;
    white-space: nowrap;
}

.room-sidebar-get-notified-msg2 {
    font-size: .87rem;
    display: grid;
    grid-template-columns: auto 20px;
    gap: .25rem;
    white-space: nowrap;
}

.room-sidebar-get-notified-arrow {
    align-self: end;
}

.room-sidebar-get-notified-msg2 a {
    text-decoration: none;
    color: #303030D9;
}

.room-sidebar-get-notified-msg2 a:hover {
    text-decoration: underline;
}

/* room side bar search or new chat */
.room-sidebar-search-new-chat {
    display: grid;
    align-items: center;
    background-color: #f0f0f0ff; 
    width: 100%;
    padding: 0.40rem .62rem ;
}

.room-sidebar-search-new-chat2 {
    display:grid;
    grid-template-columns: 50px auto;
    box-sizing: border-box;  
    outline:none;
    border-radius: 15px; 
    background-color: white;
}

.room-sidebar-search {
    align-self: end;
    justify-self: center;
}

.room-sidebar-new-chat ::placeholder {
    font-size:.90rem;
    color: #a6a6a6;
}

.room-sidebar-new-chat input[type=text] {
    width: 90%;    
    box-sizing: border-box;  
    outline:none;
    border:0;
    padding: 9px 6px;
}
/* room side bar search or new chat */


/* room side bar groups */
.room-sidebar-groups {
    display:grid;
    grid-template-columns: 49px auto 65px;
    grid-template-areas: "g-img g-msg g-time";
    height:60px;
    border-bottom:.85px solid #EEE;
    padding: .5rem;
    align-items: center;
    cursor: pointer;
}

.room-sidebar-groups-g-img {
    grid-area: g-img;
}

.room-sidebar-groups-g-img img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 50%;
}

.room-sidebar-groups-g-msg {
    grid-area: g-msg;
    display:grid;
    padding: .5rem;
}

.room-sidebar-groups-g-msg1 {
    font-size: 1.062rem;
    color: #303030F5;
}

.room-sidebar-groups-g-msg2 {
    font-size: .87rem;
    white-space: nowrap;
    text-overflow: ellipsis; 
    overflow:hidden;
}

.room-sidebar-groups-g-time {
    grid-area: g-time;
    font-size: .70rem;
    color: #a2a2a2;
    align-self: start;
    justify-self: end;
    padding: .5rem;
}
/* room side bar groups */

.room-container__msg { 
    display:grid;
    width: 100%;
    min-height: 99vh;
    height:99vh;
    grid-template-columns: 1fr;
    grid-template-rows: 59px auto 62px;
    grid-template-areas: "msg-header"
                         "msg-box"
                         "msg-input";
}

.room-container__preview-img {
    display:grid;
    width: 100%;
    height:99vh;
    grid-template-rows: 59px auto;
    grid-template-areas: "msg-header"
                         "preview-msg-box";
}

.preview-img-box {
    grid-area: preview-msg-box;
}

.msg-header {
    grid-area: msg-header;
    background-color: #EDEDED;
    display: grid;
    grid-template-columns: 42px auto 37px 37px 37px;
    grid-template-areas: "h-avatar h-users h-search h-attach h-menu" ;
    align-items:center;
    gap: .7rem;
    padding: 0 1rem;
    border-bottom:.5px solid #CCC;
}

.h-avatar {
    grid-area: h-avatar;
}

.h-avatar img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 50%;
}

.h-users {
    grid-area: h-users;
    display:grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
    grid-template-areas: "h-user-group"
                         "h-user-member";
    white-space: nowrap;
}

.h-user-group {
    grid-area: h-user-group;
    font-size: 1rem;
    overflow:hidden; 
    text-overflow: ellipsis;
}

.h-user-member {
    grid-area: h-user-member;
    font-size: .812rem;
    color: #606060ff;
    overflow:hidden; 
    text-overflow: ellipsis;
}

.h-search {
    grid-area: h-search;
}

svg {
    fill: #919191ff;
    cursor: pointer;
}

.h-attach {
    grid-area: h-attach;
}

.h-menu {
    grid-area: h-menu;
}

.msg-box {
    grid-area: msg-box;
    padding-left:4rem;
    padding-right:4rem;
}

.msg-box--background {
    background: #efe7dd /*url("https://cloud.githubusercontent.com/assets/398893/15136779/4e765036-1639-11e6-9201-67e728e86f39.jpg") repeat*/;
    overflow-y: scroll;
}

.preview-img {
    background-color: #EEE;
    display: grid;
    padding:0;
    grid-template-rows: 49px 1fr 60px 120px;
    gap: 2rem;
}

.preview-img__header {
    background-color: #00bfa5ff;
    display: grid;
    grid-template-columns: 42px auto;
    align-items: center;
    align-content: center;
    padding: 1.5rem;
}

.preview-img__header__close {
    display: grid; /* need this to remove svg padding bottom */
}

.preview-img__header__label {
    font-size: 19px;
    /* overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis; */
    font-weight: 500;
    color: white;
}

.preview-img__snipped-big {
    width: 100%;
    height: 100%;
    display: grid;
    justify-content: center;
}

.preview-img__snipped-big__border {
    display:grid;
    justify-content: center;
}

.preview-img__snipped-big__border img {
    height:100%;
    object-fit: cover; 
}


.preview-img__caption {
    justify-self: center;
    align-self: end;
    width: 75%;
    display: grid;
    grid-template-columns: auto 50px;
    padding-right: .5rem;
    margin-bottom:.75rem;
    border-bottom: 2px solid #00bfa5ff;
}

.preview-img__caption input[type="text"] {
    width: 100%;
    padding: 0px 0px 3px;
    margin: 6px 0px;
    box-sizing: border-box;  
    outline:none;
    border:0;
    background-color:inherit;
    font-size: 1rem;
}

.preview-img__caption__emoji {
    justify-self: right;
}

.preview-img__footer {
    background-color: #d9d9d9ff;
    display: grid;
    grid-template-columns: 1fr 78px 78px 1fr;
    grid-template-areas: ". img-small add-file btn-img-send";
    gap: .25rem;
    padding-top: 1.5rem;
    padding-left: 1.5rem;
    padding-bottom: 1.5rem;
    padding-right: 2.5rem;
    position: relative;
}

.preview-img__footer__img-small {
    background-color: white;
    padding:5px;
    grid-area: img-small;
    width: 100%;
    height: 100%;
}

.preview-img__footer__img-small img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.preview-img__footer__addfile {
    background-color: white;
    padding:8px;
    width: 100%;
    grid-area: add-file;
    display: grid;
    align-items: center;
    justify-self: center;
    gap: .2rem;
}

.preview-img__footer__addfile__img {
    justify-self: center;
    align-self: end;
    display: grid;
}

.preview-img__footer__addfile__label {
    justify-self: center;
    align-self: start;
    font-size: .68rem;
    font-weight: 600;
    color: #00A5F4;
}

.preview-img__footer__button {
    justify-self: end;
    grid-area: btn-img-send;
    padding: 0;
    background-color: #09e85eff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,.4);
    width: 60px;
    height: 60px;
    display:grid;
    align-items: center;
    justify-items: center;
    position:absolute;
    top: -55px;

}

.preview-img__footer__button-arrow {
    display: grid;
}


.msg-input {
    grid-area: msg-input;
    padding: 1rem;
    display: grid;
    grid-template-columns: 40px auto 40px;
    grid-template-areas: "emoji type-a-message mic";
    align-content: center;
    background-color: #f0f0f0ff;
}

.emoji {
    grid-area: emoji;
    padding: 0.5rem;
    justify-self: center;
    align-self:center;
}


.type-a-message {
    grid-area: type-a-message;
    padding: 0.5rem;
}

.mic {
    grid-area: mic;
    padding: 0.5rem;
    justify-self: center;
    align-self:center;
}


.right-msg-container {
    display:grid;
    grid-template-columns: 1fr 8px;
    padding: .3rem;
}

.left-msg-container {
    display:grid;
    grid-template-columns: 8px 1fr;
    padding: .3rem;
}

.s-tail {
    display: grid; /* tail need to be align start */
}

.r-tail {
   /* justify-self:left; */
    display: grid; /* tail need to be align start */
}

.s-message {
    padding: 0.5rem;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 20px;
    grid-template-areas: "s-msg"
                         "s-time";

    justify-self:right;
    background-color: #dcf8c6ff;
    border-radius: 7.5px;
    border-top-right-radius: 0;
    /*box-shadow: 0 1px .5px rgb(31, 30, 30),.13); */
    box-shadow: 0 1px .5px rgba(0,0,0,.2);
}

.r-message {
    padding: 0.5rem;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 20px 1fr;
    grid-template-areas: "r-user"
                         "r-msg"
                         "r-time";

    justify-self:left;
    background-color: white;
    border-radius: 7.5px;
    border-top-left-radius: 0;
    /*box-shadow: 0 1px .5px rgb(31, 30, 30),.13); */
    box-shadow: 0 1px .5px rgba(0,0,0,.2);
}

.s-msg {
    grid-area: s-msg;
    font-size: .90rem;
}

.s-msg img {
    max-width: 330px;
    max-height: 249px;
}

.s-time {
    grid-area: s-time;
    font-size: .70rem;
    justify-self: right;
    color: #a2a2a2;
}

.r-user a {
  text-decoration: none;
  color: #72dbb5ff;
}

.r-user a:hover {
  text-decoration: underline;
  color: #72dbb5ff;
}

.r-user {
    grid-area: r-user;
    font-size: .9rem;
    font-weight: bold;
}

.r-msg {
    grid-area: r-msg;
    font-size: .90rem;
}

.r-msg img {
    max-width: 330px;
    max-height: 249px;
}

.r-time {
    grid-area: r-time;
    font-size: .70rem;
    justify-self: right;
    color: #a2a2a2;
}


.type-a-message input[type="text"] {
    width: 100%;
    padding: 9px 12px 11px;
    box-sizing: border-box;  
    outline:none;
    border-radius: 15px;
    border:0;
    font-size: .93rem;
}

.date_weekday {
    display: grid;
    justify-self: center;
    padding: 5px 12px 6px;
    font-size: 0.78rem;
    background-color: #e1f3faff;
    border-radius: 7.5px;
    width: fit-content;
    box-shadow: 0 1px .5px rgba(0,0,0,.13);
    line-height: 21px;
}

/* ChatCrush: WhatsApp-inspired conversation shell, desktop and mobile. */
.chatcrush { --chat-green: #00a884; --chat-header: #f0f2f5; --chat-line: #e9edef; --chat-ink: #111b21; --chat-muted: #667781; display: grid; grid-template-columns: minmax(320px, 390px) minmax(0, 1fr); width: 100%; height: 100dvh; overflow: hidden; background: #fff; color: var(--chat-ink); font-family: Segoe UI, Helvetica Neue, Arial, sans-serif; }
.chatcrush__sidebar { min-width: 0; display: grid; grid-template-rows: 72px 60px minmax(0, 1fr); border-right: 1px solid var(--chat-line); background: #fff; }
.chatcrush__sidebar-header, .chatcrush-room__header { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px 16px; background: var(--chat-header); }
.chatcrush__brand { display: inline-flex; min-width: 0; align-items: center; gap: 10px; color: var(--chat-ink); font-size: 1.05rem; font-weight: 700; text-decoration: none; }
.chatcrush__brand img, .chatcrush__conversation > img, .chatcrush-room__avatar { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; object-fit: cover; }
.chatcrush__header-actions, .chatcrush-room__actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.chatcrush__icon-button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: #54656f; font-size: 1.35rem; line-height: 1; cursor: pointer; }
.chatcrush__icon-button:hover, .chatcrush__icon-button:focus-visible { background: #e1e7eb; outline: none; }
.chatcrush__search { display: flex; align-items: center; gap: 10px; margin: 8px 12px; padding: 0 12px; border-radius: 8px; background: #f0f2f5; color: #54656f; }
.chatcrush__search input { width: 100%; height: 40px; border: 0; outline: 0; background: transparent; color: var(--chat-ink); font-size: .88rem; }
.chatcrush__conversation-list { overflow-y: auto; }
.chatcrush__conversation { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 72px; padding: 10px 16px; color: var(--chat-ink); text-decoration: none; border-bottom: 1px solid var(--chat-line); }
.chatcrush__conversation:hover, .chatcrush__conversation.is-active { background: #f0f2f5; }
.chatcrush__conversation > img { width: 50px; height: 50px; flex-basis: 50px; }
.chatcrush__conversation-main { min-width: 0; display: grid; gap: 4px; }
.chatcrush__conversation-main strong, .chatcrush__conversation-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chatcrush__conversation-main small, .chatcrush__conversation-meta { color: var(--chat-muted); font-size: .78rem; }
.chatcrush__conversation-meta { display: grid; justify-items: end; gap: 6px; min-width: 32px; }
.chatcrush__unread-count { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--chat-green); color: #fff; font-size: .72rem; line-height: 1; }
.chatcrush__empty-list { padding: 28px 24px; color: var(--chat-muted); font-size: .9rem; text-align: center; }
.chatcrush__main { min-width: 0; min-height: 0; background: #f7f8fa; }
.chatcrush__empty-state { height: 100%; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 24px; text-align: center; color: var(--chat-muted); border-bottom: 6px solid var(--chat-green); }
.chatcrush__empty-state h1 { margin: 12px 0 0; color: #41525d; font-size: 2rem; font-weight: 400; }
.chatcrush__empty-state p { margin: 0; max-width: 360px; }
.chatcrush__empty-icon { display: grid; place-items: center; width: 104px; height: 104px; border-radius: 50%; background: #d9fdd3; color: var(--chat-green); font-size: 4rem; }
.chatcrush-room { height: 100%; display: grid; grid-template-rows: 72px minmax(0, 1fr) 72px; }
.chatcrush-room__back { display: none; color: #54656f; font-size: 2.25rem; line-height: .6; text-decoration: none; }
.chatcrush-room__identity { min-width: 0; display: grid; gap: 2px; }
.chatcrush-room__identity strong, .chatcrush-room__identity span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chatcrush-room__identity span { color: var(--chat-muted); font-size: .78rem; }
.msg-box { grid-area: auto; overflow-y: auto; padding: 18px clamp(16px, 6vw, 90px); background-color: #efeae2; }
.msg-box--background { background-color: #efeae2; background-image: radial-gradient(rgba(84,110,122,.08) 1px, transparent 1px); background-size: 18px 18px; }
#new-message-chat { display: grid; gap: 0; }
.chatcrush-message + .chatcrush-message { margin-top: 3px; }
.chatcrush-message--outgoing + .chatcrush-message--incoming,
.chatcrush-message--incoming + .chatcrush-message--outgoing { margin-top: 24px; }
.chatcrush-message { display: flex; max-width: 72%; }
.chatcrush-message--outgoing { justify-self: end; }
.chatcrush-message--incoming { justify-self: start; }
.chatcrush-message__bubble { display: inline-flex; align-items: end; gap: 8px; min-width: 0; padding: 7px 8px 6px 10px; border-radius: 8px; box-shadow: 0 1px .5px rgba(11,20,26,.13); background: #fff; overflow-wrap: anywhere; }
.chatcrush-message--outgoing .chatcrush-message__bubble { background: #d9fdd3; }
.chatcrush-message__sender { align-self: start; color: #00a884; font-size: .78rem; }
.chatcrush-message__text { font-size: .9rem; line-height: 1.35; white-space: pre-wrap; }
.chatcrush-message__time { flex: 0 0 auto; color: #667781; font-size: .68rem; line-height: 1.2; }
.chatcrush-room__composer { display: grid; grid-template-columns: 40px 40px minmax(0, 1fr) 44px; align-items: center; gap: 4px; padding: 8px 12px; background: var(--chat-header); }
.chatcrush-emoji { position: relative; }
.chatcrush-emoji__picker { position: absolute; z-index: 10; bottom: calc(100% + 10px); left: 0; display: grid; grid-template-columns: repeat(5, 40px); gap: 4px; width: max-content; max-width: min(300px, calc(100vw - 24px)); padding: 8px; border: 1px solid var(--chat-line); border-radius: 12px; background: #fff; box-shadow: 0 6px 22px rgba(11,20,26,.2); }
.chatcrush-emoji__picker[hidden] { display: none; }
.chatcrush-emoji__choice { width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; font-size: 1.75rem; cursor: pointer; }
.chatcrush-emoji__choice:hover, .chatcrush-emoji__choice:focus-visible { background: #e1e7eb; outline: 2px solid var(--chat-green); outline-offset: 1px; }
.chatcrush-room__composer input { width: 100%; height: 44px; padding: 0 14px; border: 0; border-radius: 9px; outline: none; color: var(--chat-ink); background: #fff; font-size: .95rem; }
.chatcrush-room__send { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--chat-green); color: #fff; cursor: pointer; font-size: 1.1rem; }
.chatcrush-room__send:hover, .chatcrush-room__send:focus-visible { background: #008f72; outline: 2px solid #006c58; outline-offset: 2px; }
@media (max-width: 767.98px) { .chatcrush { display: block; height: 100dvh; } .chatcrush__sidebar { height: 100%; grid-template-rows: 64px 60px minmax(0, 1fr); border: 0; } .chatcrush--room-open .chatcrush__sidebar { display: none; } .chatcrush--room-open .chatcrush__main { display: block; height: 100%; } .chatcrush__main { display: none; } .chatcrush__sidebar-header, .chatcrush-room__header { min-height: 64px; padding: 10px 12px; } .chatcrush-room { grid-template-rows: 64px minmax(0, 1fr) 64px; } .chatcrush-room__back { display: inline-block; } .chatcrush__header-actions .chatcrush__icon-button:first-child, .chatcrush-room__actions .chatcrush__icon-button:first-child { display: none; } .chatcrush__conversation { min-height: 76px; padding-inline: 14px; } .msg-box { padding: 14px 30px; } .chatcrush-message { max-width: 86%; } .chatcrush-room__composer { grid-template-columns: 40px minmax(0, 1fr) 44px; padding: 8px; } .chatcrush-room__composer .chatcrush__icon-button:nth-child(2) { display: none; } }
