:root {
    --gray: #e5e5e5;
    --light-gray: #f7f7f9;
    --white: #ffffff;
}

/* open button*/
#chat-open-button {
    color: var(--white);
    font-size: 24px;
    font-weight: 500;
    background-color: var(--primaryColor);
    border-radius: 100%;
    width: 60px;
    height: 60px;
    position: fixed;
    bottom: 30px;
    right: 30px;
    border: none;
    text-align: center;
    line-height: 60px;
    z-index: 9999;
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
}
#chat-open-button i {
    color: var(--white);
}
#chat-open-button i.fa-times {
    display: none;
}
#chat-open-button.open i.fa-times {
    display: inline-block;
}
#chat-open-button.open i.fa-comments {
    display: none;
}

/* chat window header */
#chat-window header {
    background-color: var(--primaryColor);
    padding: 10px 20px;
    border-radius: 5px 5px 0 0;
    display: flex;
}
#chat-window header .header-left {
    text-align: left;
    width: 50%;
}
#chat-window header .header-right {
    text-align: right;
    width: 50%;
}
.circle {
    display: inline-block;
    text-align: center;
    line-height: 32px;
    color: var(--white);
    width: 32px;
    height: 32px;
    border: 2px solid var(--white);
    border-radius: 50%;
}
.chat-name {
    font-size: 18px;
    color: var(--white);
    margin-left: 3px;
}
.chat-close-button {
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
}

/* chat window content */
#chat-window {
    display: none;
    width: 450px !important;
    min-width: 450px !important;
    max-width: 450px !important;
    height: 520px !important;
    max-height: calc(100% - 110px) !important;
    background-color: var(--white);
    position: fixed;
    bottom: 100px;
    right: 15px;
    z-index: 9999;
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
    border-radius: 5px;
    flex-flow: column;
    font-size: 13px;
}
@media (max-width: 480px) {
	#chat-window {
		width: calc(100% - 30px) !important;
		min-width: calc(100% - 30px) !important;
		max-width: calc(100% - 30px) !important;
    	max-height: calc(100% - 210px) !important;
	}
}
@media (max-height: 480px) {
	#chat-window {
        max-height: calc(100% - 90px) !important;
        bottom: 80px !important;
        width: 600px !important;
        max-width: calc(100% - 30px) !important;
	}
    #chat-open-button {
        bottom: 10px !important;
    }
    #chat-window .writting textarea {
        max-height: 40px !important;
        min-height: 0px !important;
    }
    .emoji-btn {
        display: none !important;
    }
    em-emoji-picker {
        display: none !important;
    }
}
#chat-window.open {
    display: flex;
    animation: slideUp 0.4s ease;
}
#chat-window .chat-content {
    padding: 10px 15px;
    margin-top: auto;
    overflow-y: auto;
}
.message-box {
    margin-bottom: 10px;
}
.message {
    padding: 12px !important;
    min-height: 40px;
    border-radius: 8px 8px 8px 3px;
}
.response .message {
    background-color: var(--gray) !important;
    margin-right: 12%;
}
.question .message {
    background-color: var(--primaryColor) !important;
    color: var(--white) !important;
    margin-left: 12%;
}
.question .message a {
    color: var(--white) !important;
    text-decoration: underline;
}
.question .message p::selection {
    color: var(--primaryColor) !important;
    background: var(--white) !important;
}
.response .message-wrap {
    display: flex;
}
.response .circle {
    display: inline-block;
    text-align: center;
    line-height: 32px;
    color: var(--primaryColor);
    flex: 0 0 32px;
    height: 32px;
    margin-right: 5px;
    border: 2px solid var(--primaryColor);
    border-radius: 50%;
    margin-top: 2px;
}
.time {
    font-size: 11px;
    margin-left: 37px;
}
.question .time {
    text-align: right;
}

@keyframes slideUp {
    from {
      transform: translateY(100vh);
    }
    to {
      transform: translateY(0);
    }
}
@keyframes slideDown {
    from {
      transform: translateY(0);
    }
    to {
      transform: translateY(100vh);
    }
}

/* Writting */
#chat-window .writting {
    padding: 10px 20px;
    border-top: 1px solid  var(--light-gray);
    position: relative;
}
#chat-window .writting textarea {
    width: 100%;
    font-size: 13px;
    max-height: 8rem;
    resize: none;
    outline: none;
    border: 0;
    margin: 0;
    padding: 0;
}

/* typing effect */
.typewriter {
    opacity: 0;
}
@keyframes caret {
    50% {
        border-color: transparent;
    }
}

/* loading */
.loading-response {
    text-align: left;    
}
.loading-response span {
    display: inline-block;
    vertical-align: middle;
    width: 10px;
    height: 10px;
    margin: 50px auto;
    background: grey;
    border-radius: 50px;
    -webkit-animation: loading-response 0.5s infinite alternate;
    -moz-animation: loading-response 0.5s infinite alternate;
}
.loading-response span:nth-of-type(2) {
    -webkit-animation-delay: 0.2s;
    -moz-animation-delay: 0.2s;
}
.loading-response span:nth-of-type(3) {
    -webkit-animation-delay: 0.3s;
    -moz-animation-delay: 0.3s;
}

@-webkit-keyframes loading-response {
  0% {
    height: 10px;
    opacity: 0.9;
    -webkit-transform: translateY(0);
  }
  100% {
    opacity: 0.3;
    -webkit-transform: translateY(-11px);
  }
}

@-moz-keyframes loading-response {
  0% {
    width: 10px;
    height: 10px;
    opacity: 0.9;
    -moz-transform: translateY(0);
  }
  100% {
    width: 24px;
    height: 24px;
    opacity: 0.3;
    -moz-transform: translateY(-11px);
  }
}

/* emojis */
em-emoji-picker {
	width: 100%;
    height: 200px;
	display: flex;
    justify-content: center;
}
.emoji-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 18px;
}
.chat-input {
    padding-right: 5em;
}