.chat{
    position:fixed;
    width:300px;
    height:350px;
    background:rgba(255, 255, 255, 0.1);
    border-radius: 5px 5px 0 5px;
    right: 4.5rem;
    bottom: 9.5rem;
    box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.33);
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-left: 1px solid rgba(255,255,255,0.1);
    border-top: 1px solid rgba(255,255,255,0.1);
}

.chat-top{
    display: flex;
    flex-direction: column;
    height: 85%;
    overflow-y:auto;
    scrollbar-width: none;
}

.chat-top .mobile-header {
    display: none;
}

.message{
    background: white;
    max-width: 75%;
    min-width: 33%;
    width: fit-content;
    border-radius: 10px 10px 10px 0;
    margin: 0.5rem;
    padding: 0.5rem;
    font-family: "Open Sans", sans-serif;
    font-size: 0.9rem;
    white-space: break-spaces;
    -webkit-box-shadow: 0px 0px 3px 0px rgba(0,0,0,0.3);
    -moz-box-shadow: 0px 0px 3px 0px rgba(0,0,0,0.3);
    box-shadow: 0px 0px 3px 0px rgba(0,0,0,0.3);
}

.message-right{
    border-radius: 10px 10px 0 10px;
    align-self: flex-end;
    background: #FFF8E1;
}
.message-right .sender {
	color: var(--main-color);
}

.sender{
    font-weight: bold;
    font-size: small;
    margin: 0;
    color: rgb(48,112,2);
}

.content {
	padding-right: 1.75rem;
}

.time{
    font-size: xx-small;
    color: #757575;
    text-align: right;
    margin-top: -1em;
}

.chat-bottom{
    display:flex;
    justify-content:space-between;
    background: white;
    height: 20%;
    border-top: 1px solid var(--light-gray);
    border-radius: 0 0 0 5px;
    -webkit-box-shadow: -1px 0 0 white;
    -moz-box-shadow: -1px 0 0 white;
    box-shadow: -1px 0 0 white;
    max-height: 90px;
}

button.send{
    border-radius: 0;
    background: transparent;
    margin:0;
    width:auto;
}

button.send .material-icons{
    color: var(--main-color);
}

.chat input{
    border: none;
    background: transparent;
    margin:0;
    width:85%;
}

.chat::after{
    content: "";
    width: 0;
    height: 0;
    border-style: solid solid solid none;
    border-width: 20px 20px 20px;
    border-color: transparent white transparent transparent;
    position: absolute;
    bottom: 0;
    right: 0;
    transform: translateY(50%);
}

.fab2{
    z-index: 2;
    position: fixed;
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    right: 2rem;
    bottom: 2rem;
    cursor:pointer;
    -webkit-box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.66);
    -moz-box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.66);
    box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.66);
}

.fab2:disabled{
    background-color:var(--gray);
    cursor:not-allowed;
}

.fab2.has-messages:disabled::after{
    display: none;
}

.fab2 i{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-65%,-50%);
    user-select:none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

.fab2.has-messages::after{
    font-family: "Open Sans", sans-serif;
    display:flex;
    justify-content: center;
    align-items: center;
    content:attr(data-message-count);
    position:absolute;
    left: 70%;
    top:0;
    width:20px;
    height:20px;
    background:var(--red);
    border-radius:3px;
    color:white;
    font-size: 1rem;
}

.smiley{
    display: flex;
    justify-content: center;
    align-items: center;
    color: #AeAeAe;
    padding: 0 0.3rem 0 0.5rem;
    cursor:pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

.emojis-container{
    position:relative;
    display:flex;
    justify-content: center;
    align-items:center;
}

.emojis-container .emojis{
    display: grid;
    overflow:auto;
    grid-template-columns: repeat(6,1fr);
    grid-template-rows: auto;
    position:absolute;
    bottom: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    background: white;
    margin-bottom: 24px;
    border-radius: 10px;
    box-shadow: 0 0 5px 0 rgba(0,0,0,0.66);
    -webkit-box-shadow: 0 0 5px 0 rgba(0,0,0,0.66);
    -moz-box-shadow: 0 0 5px 0 rgba(0,0,0,0.66);
    scrollbar-width: none;
    padding: 0.2rem;
}

.emojis::-webkit-scrollbar{
    width:0;
}

.emojis-container .emojis span{
    display:flex;
    justify-content: center;
    align-items:center;
    font-size: 1.5rem;
    cursor:pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

@media screen and (max-width: 850px), screen and (max-height: 600px){
    .fab2{
        width: 4rem;
        height: 4rem;
    }
}

@media screen and (max-width: 915px), (max-height: 608px) {
    .chat{
        inset: 0;
        background: white;
        box-sizing:border-box;
        height: auto;
        width:auto;
        border-radius:0;
        border: none;
    }
    .chat::after{
        display:none;
    }

    .chat-top .mobile-header {
        display: flex;
        padding: 0 1rem;
        font-family: "Open Sans Light", sans-serif;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        background: white;
        -webkit-box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.3);
        -moz-box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.3);
        box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.3);
        margin-bottom: 0.5rem;
    }
    .chat-top .mobile-header h1 {
        font-size: 1.5rem;
        margin: 0;
        width: 100%;
    }
    .chat-top .mobile-header h1::before, .chat-top .mobile-header h1::after {
        content: "";
        background-image: url("../img/laub.png");
        background-size: 32px 32px;
        display: inline-block;
        width: 32px;
        height: 32px;
        margin: 1rem;
        vertical-align: middle;
    }
    .chat-top .mobile-header .material-icons {
        -webkit-user-select: none;
        -moz-user-select: none;
        user-select: none;
    }

    .message{
        margin-left: 2rem;
        margin-right: 2rem;
        box-sizing:border-box;
        -webkit-box-shadow: 0px 0px 2px 0px rgba(0,0,0,0.2);
        -moz-box-shadow: 0px 0px 2px 0px rgba(0,0,0,0.2);
        box-shadow: 0px 0px 2px 0px rgba(0,0,0,0.2);
    }

   .time{
       margin-top: -0.5em;
   }

   .message-right .sender{
       color:var(--main-color);
   }
}

@media screen and (max-width: 500px){
    .message {
        margin: 0.5rem;
    }
}

@media screen and (max-width: 440px){
    .chat-top .mobile-header h1 {
        font-size: 22px;
    }
    .chat-top .mobile-header h1::before, .chat-top .mobile-header h1::after {
        background-size: 24px 24px;
        width: 24px;
        height: 24px;
    }
}


@media screen and (max-height: 608px){
    .fab2.small.chat-button{
        bottom:6.5rem;
    }
}

@media screen and (max-height: 493px){

    .fab2.small.chat-button{
        left: 8rem;
        bottom: 9rem;
    }
}

@media screen and (max-height: 457px){
    .fab2.small.chat-button{
        bottom: 6rem;
    }
}

@media screen and (max-height: 260px){
    .chat-top{
        height: 60%;
    }

    .chat-bottom:{
        height: 40%;
    }

    .chat{
        padding-top:0;
    }
}
