@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400&display=swap');

:root {
    --font-primary: poppins;
    --colour-theme: #cc5eff;
    --visible: none;
    --invisible: block;
}

.theme-light {
    --text: #000;
    --background: #fafafa;
    --background-nav: #fff;
    --hover-background: #ddd;
    --msg-shadow: 0 0 7px 1px rgba(0,0,0,0.08);
}

.theme-dark {
    --text: #fff;
    --background: #252525;
    --background-nav: #494949;
    --hover-background: #161616;
    --msg-text: #fff;
    --msg-shadow: 0 0 7px 1px rgba(255, 255, 255, 0.08);
}

.user {
    --background: #cc5eff;
    --text: #fff;
    --border-color: #bb57e9;
    --username-background: #fff;
    --username-color: #000;
}

.you {
    --background: var(--background-nav);
    --msg-text: #cc5eff;
    --border-color: #ddd;
    --username-background: #cc5eff;
    --username-color: #fff;
}

.userclicked {
    --visible: block;
}

.invisible {
    --invisible: none;
}

.show {
    display: block !important;
}


.animated-slide-off {
    animation: slideoff 5s cubic-bezier(0.175, 2, 0.32, 1.275);
}

@keyframes slideoff {

    0% {
        top: 0%
    }
    9% {
        top: -5%
    }
    40% {
        top: 100%;
        display: none;
    }
}

::-webkit-scrollbar {
    border-radius: 20px;
    background-color: var(--background-nav);
    box-shadow: 0 0 8px 1px rgba(0,0,0,0.12);
}

::-webkit-scrollbar-thumb {
    box-shadow: 0 0 7px 0 rgba(0,0,0,0.12);
    background-color: var(--hover-background);
}


html, body {
    color: var(--text);
    margin: 0;
    font-family: var(--font-primary);
    font-weight: 400;
}

body {
    background-color: var(--background);
    height: 100%;
    width: 100%;
    
}

.popup {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background-color: var(--background);
    position: fixed;
    z-index: 3;
    top: 0;
    left: 0;
    display: block;
}



.popup-info {
    transform: translate(-50%,-50%);
    left: 50%;
    top: 50%;
    text-align: center;
    position: absolute;
    
}

.popup-info h4 {
    font-weight: 300;
}

.popup-info input#username {
    height: 60px;
    width: 50%;
    font-size: 1.5em;
    font-family: var(--font-primary);
    border: var(--background-nav) 2px solid;
    box-shadow: 0 0 7px 1px rgba(0,0,0,0.12);
    outline: none;
    background-color: var(--background-nav);
    color: var(--text);
}

.popup-info button {
    height: 60px;
    border-radius: 10px;
    width: 30%;
    background-color: var(--background-nav);
    box-shadow: var(--msg-shadow);
    color: var(--text);
    font-family: var(--font-primary);
    border: none;
    outline: none;
    cursor: pointer;
    transition: 0.5s cubic-bezier(0.165, 2, 0.44, 1);
}

.popup-info button:hover {
    width: 40%;
}

.nav {
    box-shadow: 0 0 6px 0px rgba(0,0,0,0.2);
    background-color: var(--background-nav);
    text-align: center;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    position: fixed;
    width: 100%;
    z-index: 2;
}

.nav h1 {
    margin-left: 20px;
}

.nav .theme-button {
    margin-right: 20px;
}

.menu {
    height: 50px;
    width: 50px;
    display: none;
}

main {
    padding-top: 2px;
    display: flex;
}

main img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 2px solid var(--colour-theme);
}

.contacts {
    border-right: 3px solid var(--colour-theme);
    background-color: var(--background-nav);
    padding: 3px;
    text-align: center;
    position: fixed;
    margin-top: 80px;
    width: 280px;
    height: 100%;
}

.contacts .contact-list {
    padding: 6px 0 0 0;
}

.contacts .contact {
    height: 100px;
    display: flex;
    align-items: center;
    padding: 7px;
    transition-duration: 0.5s;
    cursor: pointer;
}

.contacts .contact:hover {
    background-color: var(--hover-background);
}

.contacts .contact h2 {
    margin-left: 4px;
}

.messages {
    padding: 3px;
    background-color: var(--background);
    margin-left: 290px;
    margin-top: 80px;
}

.messages h1 {
    text-align: center;
}

.messages .message-box {

    height: 100%;
    display: var(--visible);
}


.profile {
    display: flex;
}

.message {
    display: flex;
    margin-left: 20px;
}


.textmessage {
    min-height: 60px;
    border-radius: 10px;
    border-bottom-left-radius: 0;
    padding: 8px;
    margin: 5px;
    color: var(--msg-text);
    background-color: var(--background);
    border: var(--border-color);
    box-shadow: var(--msg-shadow);
    max-width: 800px;
    min-width: 70px;
    overflow-wrap: break-word;
}


.username-box {
    background-color: var(--background-nav);
    padding: 7px;
    border-radius: 10px;
    margin: 0;
    box-shadow: 0 0 4px 0 rgba(0,0,0,0.12);
}

footer {
    display: flex;
    position: fixed;
    bottom: 0;
}

.messageinput {
    font-size: 1.4em;
    border: 2px solid var(--colour-theme);
    outline: none;
    overflow: hidden;
    cursor: auto;
    max-width: 900px;
    display: block;
    background-color: var(--background-nav);
    border-radius: 50px;
    padding: 10px 60px 10px 10px;
    min-width: 900px;
}

.messageinput:empty::before {
    content: "Enter your message";
    color: gray;
  }

.send-button {
    background-color: var(--background-nav);
    margin-left: -60px;
    margin-bottom: 7px;
    border: none;
    outline: none;
    margin-top: 7px;
    align-items: center;
    border-radius: 20px;
    cursor: pointer;
}


@media screen and (max-width: 700px) {
    .menu {
        display: block;
    }
    .contacts {
        display: none;
        width: 100%;
        height: 100%;
        z-index: 2;
    }

    .messages {
        margin-left: 0px;
        margin-top: 80px;
        width: 100%;

    }

    .messageinput {
        font-size: 1.4em;
        border: 2px solid var(--colour-theme);
        outline: none;
        overflow: hidden;
        cursor: auto;
        max-width: 100%;
        display: block;
        background-color: var(--background-nav);
        border-radius: 0px;
        padding: 10px 60px 10px 10px;
        min-width: 80%;
    }


    .send-button {
        background-color: var(--background-nav);
        margin-left: -60px;
        margin-bottom: 0px;
        border: none;
        outline: none;
        margin-top: 7px;
        align-items: center;
        border-radius: 20px;
        cursor: pointer;
    }

    img {
        width: 20px;
        height: 20px;
    }

    footer {
        width: 100%;
    }
}