*{
    margin: 0;
    padding: 0;
    list-style: none;
    text-decoration: none;
}

:root{
    --background: #2c2c2c;
    --hover: #383838;
    --aside-color: #202020;
    --aside-color-open: #2d2c2c;
    --chat-search-input: none;
    --chat-user-hover: #515151;
    --main-letter: #fff;
    --chat-letter: #fff;
    --light-letter: #ddd;
    --default-chat-page: #adaaaa;
    --other-msg-bg: #363636;
    --my-msg-bg: #005c4b;

}

body.light{
    --background: #fefefe;
    --chat-user-hover: #ddd;
    --aside-color: #f3f3f3;
    --chat-search-input: transparent;
    --light-letter: #272727;
    --aside-color-open: #f3f3f3;
    --hover: #ededed;
    --main-letter: #181818;
}

body{
    font-family: "Helvetica", "Arial", sans-serif;
    background-color: var(--aside-color);
    display: flex;
    width: 100vw;
    flex-direction: row;
    flex-grow: 1;
    scroll-behavior: smooth;
}

::-webkit-scrollbar{
    width: 6px;
    height: 50px;
}

.material-symbols-outlined{
    cursor: pointer;
    font-size: 20px !important;
}

/* aside section */

aside{
    width: 200px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--light-letter);
    padding: 4px;
    position: fixed;
    z-index: 3;
    transition: .3s;
    background-color: var(--aside-color-open);
}

aside.close{
    background-color: var(--aside-color);
    width: 40px;
}

aside.close ul li p{
    display: none;
}

aside ul{
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

aside ul .spacer{
    flex-grow: 1;
}

aside ul li, .aside-menu{
    padding: 0 10px;
    cursor: pointer;
    height: 40px;
    display: flex;
    align-items: center;
    border-radius: 3px;
    margin:5px 0 5px 0;
    position: relative;
}

aside ul li p{
    text-wrap: nowrap;
    color: var(--light-letter);
}

.aside-menu{
    justify-content: center;
    width: 18px;
    flex-direction: column;
}

.menu-bar{
    width: 16px;
    border-bottom: 2px solid var(--light-letter);
    margin-bottom: 4px;
}

.menu-bar-animation{
    animation: menu-bar .4s;
}

@keyframes menu-bar {
    50%{
        width: 10px;
    }
    100%{
        width: 16px;
    }
}

aside ul .active{
    background-color: var(--hover);
}

aside ul .active::before{
    content: '';
    width: 3px;
    position: absolute;
    left: 0;
    height: 40%;
    border-radius: 5px;
    background-color: #1ea35e;
}

aside ul li span{
    margin-right: 15px;
    font-size: 20px !important;
}

aside ul .line{
    width: 90%;
    border-top: 0.1px solid #dddddd3a;
    margin: auto;
    margin-bottom: 3px;
}

aside ul li img{
    margin-right: 15px;
    width: 20px;
    border-radius: 50%;
}

aside ul li:hover, aside ul .aside-menu:hover{
    background-color: var(--hover);
}

.change-theme span{
    display: none;
}

.change-theme span.mode{
    display: block;
}

/* chat-section */

.container{
    height: 100vh;
    display: flex;
    flex-grow: 1;
    margin-left: 48px;
    border-top-left-radius: 7px;
    left: 48px;
    width: calc(100% - 48px);
    background-color: var(--background);
}

.chat-section .chat-list{
    width: clamp(250px , 400px, 450px);
    color:var(--main-letter);
    border-right: 1px solid black;
    height: 100vh;
}

.chat-list .chat-header{
    width: 100%;
    height: 60px;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.chat-header-icons{
    width: 38px;
    height: 38px;
    border-radius: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 10px;
    transition: .3s;
}

.chat-header-icons:hover{
    background-color: var(--hover);
}

.chat-header .chat-title{
    flex-grow: 1;
    font-size: 25px;
    display: flex;
    font-weight: 600;
    align-items: center;   
    padding-left: 20px; 
}

.chat-search{
    margin-top: 10px;
    width: 100%;
    display: flex;
    height: 50px;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

.chat-search label{
    width: 95%;
    height: 30px;
    border-radius: 5px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: start;
    border: 1px solid #ddd;
    border-bottom: 1px solid var(--light-letter);
    background-color: var(--chat-search-input);
}

.chat-search label span{
    width: 5%;
    font-size: 13px;
    margin-left: 10px;
    color: var(--chat-search-input-color);
}

.chat-search input{
    outline: none;
    width: calc(95% - 20px);
    margin-left: 10px;
    border: none;
    color:var(--main-letter);
    background-color: transparent;
}

.chat-search label.focused {
    background-color: var(--aside-color);
    border: none;
    border-bottom: 2px solid #005c4b;
}

.chat-search input::placeholder{
    color: var(--chat-search-input-color);
}

.user-lists{
    margin: 10px;
    overflow-y: auto;
    flex-grow: 1;
    animation: user-list .3s;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    height: calc(100% - 140px);
}

@keyframes user-list {
    from{
        padding-top: 10px;
    }
    to{
        padding-top: 0px;
    }
}

.user-lists li{
    display: flex;
    flex-direction: row;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
}

.user-lists li:hover{
    background-color: var(--hover);
    transition: .3s;
}

.user-dp{
    width: 55px;
    height: 100%;
    margin-right: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.user-dp img{
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 50%;
}

.user-dets{
    width: calc(100% - 63px);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 15%;
}

.user-dets h4, .user-dets p{
    width: calc(100% - 20px);
    text-wrap: nowrap;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dets .last-msg-time{
    position: absolute;
    right: 0;
    font-size: 12px;
    top: 4px;
}

.last-msg-time, .last-msg{
    color: var(--light-letter);
}

.last-msg-time.new-msg{
    color: #1daa61;
}

.last-msg-time span{
    color: var(--background);
    background-color: #1daa61;
    border-radius: 50%;
    position: absolute;
    top: 20px;
    right: 3px;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 10px;
    height: 10px;
    padding: 3px;

}

/* Chat Page */

.chat-page{
    flex-grow: 1;
    height: 100vh;
}

.wp-icon{
    font-size: 70px;
}

.chat-page h3{
    color:var(--main-letter);
}

.default-chat-page p{
    color: var(--default-chat-page);
    text-align: center;
}

.default-chat-page{
    position: relative;
    padding: 0 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.default-chat-page.hide{
    display: none;
}

.end-to-encrypted{
    position: absolute;
    bottom: 100px;
    color: var(--default-chat-page);
    display: flex;
    align-items: center;
}

.end-to-encrypted span{
    margin-right: 10px;
}

/* user-chat */

.user-chat-page{
    height: 100%;
}

.user-chat-page.hide{
    display: none;
}

.user-chat-header{
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: auto;
    color:var(--main-letter);
    border-bottom: 1px solid black;
    padding-left: 16px;
}

.l-header{
    display: flex;
    font-size: 17px;
    font-weight: 600;
    align-items: center;
    justify-content: center;
}

.r-header span, .go-back{
    padding: 11px;
    border-radius: 6px;
}

.r-header span:nth-child(1), .r-header span:nth-child(2){
    background-color: var(--chat-search-input);
} 

.r-header span:hover, .go-back:hover{
    background-color: var(--chat-user-hover);
}

.r-header{
    display: flex;
    gap: 2px;
}

.r-header div{
    background-color: var(--chat-user-hover);
    border-radius: 8px;
}

.r-header div span:first-child{
    border-right: 1px solid #2a2929;
}

.user-chat{
    background: url('images/dark-chat-bg.jpeg');
    width: calc(100% - 1px);
    height: calc(100vh - 109px);
    overflow-y: auto;
}

body.light .user-chat{
    background: url('images/light-chat-bg.jpg');
}

.user-chat.hide{
    display: none;
}

.user-chat ul{
    margin-top: 20px;
}

.other-msg, .my-msg{
    width: 100%;
    height: auto;
    overflow: hidden;
    position: relative;
}

.msg-div{
    width: fit-content;
    max-width: 80%;
    min-width: 10%;
    border-radius: 5px;
    margin-bottom: 10px;
    position: relative;
}

.other-msg .msg-div{
    background-color: var(--other-msg-bg);
    margin-left: 20px;
}

.other-msg .msg-div.start::before{
    content: '';
    background-color: var(--other-msg-bg);
    width: 10px;
    height: 10px;
    position: absolute;
    left: -4px;
    top: -4px;
    transform: rotate(45deg);
}

.my-msg .msg-div.start::after{
    content: '';
    background-color: var(--my-msg-bg);
    width: 10px;
    height: 10px;
    position: absolute;
    right: -4px;
    top: -4px;
    transform: rotate(45deg);
}

.my-msg .msg-div{
    margin-left: auto;
    margin-right: 20px;
    background-color: var(--my-msg-bg);
}

.other-msg p, .my-msg p{
    color:var(--chat-letter);
    text-align: left;
    padding: 6px;
    width: auto;
}

.other-msg span, .my-msg span{
    color: #dbd6d6;
    position: absolute;
    right: 5px;
    bottom: 5px;
}

.user-send{
    background-color: var(--background);
    height: 45px;
    width: 100%;
    padding: 1px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
}

.user-send span{
    padding: 8px;
    border-radius: 3px;
    color:var(--main-letter);
    width: 15px;
    font-size: 14px;
}

.user-send input{
    flex-grow: 1;
    background-color: transparent;
    outline: none;
    padding: 8px 5px;
    color:var(--main-letter);
    border: none;
}

.user-send span:hover, .user-send input:hover{
    background-color: var(--chat-search-input);
}

.go-back-aside{
    display: none;
}

.mic-btn, .send-btn{
    margin-right: 10px;
}

/* call-section */

.call-section{
    color: var(--main-letter);
}

.call-list-div{
    width: clamp(250px , 400px, 450px);
    border-right: 1px solid black;
    height: 100vh;
}

.call-list-header{
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: calc(100% - 40px);
    padding: 12px 20px;
}

.call-list-header span{
    padding: 10px;
    border-radius: 3px;
    position: relative;
}

.call-list-header span:hover{
    background-color: var(--chat-user-hover);
}

.call-list-search{
    width: 100%;
    display: flex;
    height: 50px;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

.call-list-search label{
    width: 95%;
    height: 30px;
    border-radius: 5px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: start;
    border: 1px solid #ddd;
    border-bottom: 1px solid var(--light-letter);
    background-color: var(--chat-search-input);
}

.call-list-search label span{
    width: 5%;
    font-size: 13px;
    padding: 0 10px;
    color: var(--chat-search-input-color);
}

.call-list-search input{
    outline: none;
    width: 80%;
    border: none;
    color:var(--main-letter);
    background-color: transparent;
}

.call-list-search label.focused {
    background-color: var(--aside-color);
    border: none;
    border-bottom: 2px solid #005c4b;
}

.call-list-search input::placeholder{
    color: var(--chat-search-input-color);
}

.call-symbol.missed {
    color: rgb(238, 108, 108);
}

.create-link{
    font-size: 14px;
    margin-top: 3px;
}

.call-symbol{
    position: relative;
}

.call-symbol span{
    font-size: 12px !important;
}

.call-symbol .arrow-icon{
    position: absolute;
    left: 6px;
    top: 1px;
    font-size: 8px !important;
}

.call-info-div{
    flex-grow: 1;
}

.default-call-info{
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    position: relative;
}




@media all and (max-width:768px) {
    .go-back-aside{
        display: flex;
    }

    .chat-page{
        display: none;
        width: 100%;
    }

    .chat-page.active{
        display: flex;
    }
    
    .chat-list{
        display: none;
    }

    .chat-list.active{
        display: block;
    }

    .chat-section .chat-list{
        width: calc(100% - 1px);
    }

    .default-chat-page{
        display: none;
    }

    .other-msg span, .my-msg span{
        font-size: 12px;
    }

    .msg-div{
        min-width: 20%;
    }

    .msg-div p{
        font-size: 15px;
    }

    .user-chat-header{
        padding-left: 2px;
    }

    .l-header span{
        font-size: 13px;
    }

    .l-header .go-back{
        display: none;
    }
    
    .l-header .user-dp{
        width: 40px;
    }

    .user-dp img{
        width: 100%;
    }

    .l-header .user-name{
        font-size: 13px;
        text-wrap: nowrap;
        width: 100px;
        text-overflow: ellipsis;
        overflow: hidden;
    }

    .chat-section{
        width: calc(100% - 49px);
    }

    .aside{
        width: 30px;
    }

    .r-header span, .go-back{
        padding: 8px;
    }

    .user-send{
        gap: 0;
    }

    /* call-section */

    .call-info-div{
        display: none;
    }

    .call-info-div.active{
        display: flex;
    }

    .call-info-div{
        display: none;
    }

    .call-list-div.active{
        display: block;
        width: calc(100% - 1px);
    }
    
}