﻿
#chatbox {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: calc(100vw - 20px);
    z-index: 95;
    transition: all 0.3s;
}

@media all and (min-width: 768px) {
    #chatbox {
        bottom: 20px;
        right: 20px;
        width: 360px;
    }
}

#chatbox:before {
    content: '';
    position: absolute;
    width: 100vw;
    height: 100vh;
    bottom: -30px;
    right: -30px;
    background: url(../images/chatbox/chat-limb.png);
    background-size: 100% 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s;
    background-repeat: no-repeat;
}

#chatbox.opened:before {
    opacity: 1;
}

    #chatbox.z-index-hidden {
        opacity: 0 !important;
        visibility: hidden;
        pointer-events: none;
    }

#chatbox > button {
    position: relative;
    right: 0;
    bottom: 0;
    height: 40px;
    width: 150px;
    display: flex;
    align-items: center;
    outline: none;
    border: none;
    background-color: #01FFFF;
    border-radius: 12px;
    color: #000;
    padding: 0 15px 0 10px;
    cursor: pointer;
    box-shadow: 0 0 6px rgb(0, 0, 0, 50%);
}

@media all and (min-width: 768px) {
    #chatbox > button {
        height: 60px;
        width: 190px;
    }
}

#chatbox.opened > button {
	background-color: #01ffff;
}

#chatbox > button figure {
    width: 60px;
    height: 60px;
    margin-right: 10px;
    background-image: url(../images/chatbox/chatline.png);
    background-repeat: no-repeat;
    background-size: 800%;
    background-position-x: 71.4%;
    background-position-y: center;
    cursor: pointer;
}

#chatbox > button:hover figure {
    background-position-x: 28.5%;
}

#chatbox.opened > button figure {
    background-position-x: 14.3%;
}

#chatbox > button > div {

}

#chatbox > button > div span {
	display: block;
	width: 100%;
	text-align: left;
}

#chatbox > button > div span:nth-child(1) {
	font-family: 'Metropolis', sans-serif;
	font-size: 100%;
	line-height: 100%;
}

@media all and (min-width: 768px) {
    #chatbox > button > div span:nth-child(1) {
        font-size: 1rem;
        line-height: 1rem;
    }
}

#chatbox > button > div span:nth-child(2) {
	font-family: 'Metropolis', sans-serif;
    font-size: 100%;
    line-height: 100%;
}

@media all and (min-width: 768px) {
    #chatbox > button > div span:nth-child(2) {
        font-size: 1.2rem;
        line-height: 1.2rem;
    }
}

#chatbox > .chat-container {
    position: absolute;
    width: 100%;
    bottom: -70vh;
    right: 0;
    transition: all 0.6s;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 0 20px 0px #00000000;
}

#chatbox.opened .chat-container {
    bottom: 70px;
}


#chatbox > .chat-container:hover {
    box-shadow: 0 0 20px 0px #00000085;
}

#chatbox .chat-container:before {
	content: '';
	position: absolute;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
	background: linear-gradient(to bottom, #02252c, #021114);
	border-radius: 12px;
	border: 2px solid #02252c;
    box-sizing: border-box;
    opacity: 0;
    transition: all 0.3s;
}

#chatbox .chat-container:hover:before {
    opacity: 1;
}

#chatbox.interacted .chat-container:before {
    opacity: 1;
}

#chatbox .chat-container .header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	position: relative;
	font-family: 'Metropolis', sans-serif;
	font-size: 1rem;
	color: #fff;
	height: 0px;
	padding: 0 20px;
	opacity: 0;
	transition: all 0.3s;
	overflow: hidden;
}

#chatbox .chat-container .header strong {
	color: #00ff7f;
}

#chatbox .chat-container .header button.chat-close {
	display: block;
	width: 20px;
	height: 20px;
	background: url('../images/chatbox/close.png');
	background-size: 200% 100%;
	background-position: 0 0;
	border: none;
	outline: none;
	cursor: pointer;
}

#chatbox .chat-container .header button.chat-close:hover {
	background-position: 100% 0;
}

#chatbox.opened .chat-container .header {
	height: 40px;
	opacity: 0;
}

#chatbox.opened .chat-container:hover .header,
#chatbox.opened.interacted .chat-container .header {
	opacity: 1;
}


#chatbox .chat-container .chat-container2 {
    position: relative;
    width: calc(100% + 20px);
    max-height: calc(70vh - 100px);
    overflow-y: scroll;
    transition: max-height 0.6s;
}

#chatbox .chat-rail {
	position: relative;
    width: 100%;
    padding: 0 60px;
    box-sizing: border-box;
}

#chatbox .chat-rail > ul {
	position: relative;
	margin-bottom: 20px;
}

#chatbox .chat-rail > ul:first-child {
	margin-top: 20px;
}

#chatbox .chat-rail > ul.hype:before,
#chatbox .chat-rail > ul.player:before {
	position: absolute;
	content: '';
	display: block;
	width: 40px;
	height: 40px;
	background-size: 100%;
	bottom: 3px;
	animation-name: avatar-surge;
    animation-timing-function: cubic-bezier(.37,1.38,.79,1.23);
	animation-iteration-count: 1;
	animation-duration: 0.3ss;
	animation-fill-mode: forwards;
    overflow: hidden;
}

#chatbox .chat-rail > ul.hype:before {
	background-image: url(../images/chatbox/avatar-hype.png);
	right: 100%;
}

#chatbox .chat-rail > ul.player:before {
	background-image: url(../images/chatbox/avatar-player.png);
	left: 100%;
}

#chatbox .chat-rail > ul > li {
	display: block;
	width: 100%;
	margin-bottom: 10px;
	transition: all 0.3s;
	max-height: 140px;
	animation-name: chat-surge;
    animation-timing-function: ease-out;
	animation-iteration-count: 1;
	animation-duration: 0.8s;
	animation-fill-mode: forwards;
	overflow: hidden;
    opacity: 0.99;
}

#chatbox .chat-rail > ul > li:last-child {
	margin-bottom: 0px;
}


#chatbox .chat-rail > ul > li p {
    position: relative;
    display: inline-block;
    background-color: #fff;
    border-radius: 12px;
    padding: 15px;
    color: #181e15;
    font-size: 0.8rem;
    line-height: 1.2rem;
    font-family: "Metropolis", sans-serif;
    text-align: left;
    margin-bottom: 0;
    transition: all 0.3s;
}

#chatbox .chat-rail > ul.hype > li p {
    margin-left: 20px;
}
#chatbox .chat-rail > ul.player > li p {
    margin-right: 20px;
}

#chatbox .chat-rail > ul.hype > li p a {
	color: #00ff7f;
	text-decoration: none;
    font-size: 0.8rem;
}

#chatbox .chat-rail > ul > li p.democracy {
	background-color: #01ffff;
	animation-name: chatbox-player-surge;
    animation-timing-function: ease-out;
	animation-iteration-count: 1;
	animation-duration: 0.3s;
	animation-fill-mode: forwards;
}


#chatbox .chat-rail > ul li:last-child p:after {
	position: absolute;
	content: '';
	display: block;
	width: 30px;
	height: 16px;
	background-size: 100%;
	bottom: 0;
	background-image: url(../images/chatbox/baloon-arrow.png);
}

#chatbox .chat-rail > ul li:last-child p.democracy:after {
	background-image: url(../images/chatbox/baloon-arrow-blue.png);
}

#chatbox .chat-rail > ul.hype p:after {
	left: -14px;
}

#chatbox .chat-rail > ul.player p:after {
	right: -14px;
}

#chatbox .chat-rail > ul > li button {
    display: inline-flex;
    align-items: center;
    outline: none;
    border: none;
    background-color: #021114;
    border-radius: 12px;
    padding: 15px;
    font-size: 0.8rem;
    line-height: 1.2rem;
    font-family: 'Metropolis',sans-serif;
    text-align: left;
    color: #01ffff;
    cursor: pointer;
    border: solid 2px #01ffff;
    text-transform: none;
}

#chatbox .chat-rail .options li.selected button {
	background-color: #01ffff;
    border: solid 0px #01ffff;
}

#chatbox .chat-rail > ul > li button:hover {
    background-color: #01ffff;
    color: #021114;
}

#chatbox .chat-rail > ul > li button.whatsapp:before {
    content: '';
    display: block;
    width: 25px;
    height: 25px;
    background: url('../images/chatbox/chat-icons.png');
    background-size: 200% 200%;
    background-position: 0 0;
    margin-right: 4px;
}

#chatbox .chat-rail > ul > li button.chatonline:before {
    content: '';
    display: block;
    width: 25px;
    height: 25px;
    background: url('../images/chatbox/chat-icons.png');
    background-size: 200% 200%;
    background-position-y: 100%;
    margin-right: 10px;
}

#chatbox .chat-rail > ul > li button:hover:before {
    background-position-x: 100%;
}

#chatbox .chat-rail .hype {
	text-align: left;
}

#chatbox .chat-rail .options li,
#chatbox .chat-rail .player li {
	text-align: right;
}

#chatbox .chat-rail .options li {
	margin-bottom: 5px;
}


#chatbox .chat-rail .options.morph li:not(.selected) {
	animation-name: option-disapear;
    animation-timing-function: ease-out;
	animation-iteration-count: 1;
	animation-duration: 0.3s;
	animation-fill-mode: forwards;
}
