/*
 * client gui settings
 */
#chatTag {
    position: fixed;
    right: 20px;
    bottom: 50px;
    border-radius: 60px;
    z-index: 10000;
    cursor: pointer;
    color: white;
    line-height: 38px;
}
@media screen and (max-width: 767px) {
    #chatTag {
        position: fixed;
        right: 20px;
        bottom: 20px;
    }
}

/** Chat Fenster für User */
.chatGui {
    position: fixed;
    right: 0;
    width: 330px;
    top: 0;
    bottom: 0;
    z-index: 1000000;
    background: white;
    border: 1px solid var(--itrk-border);
    border-radius: var(--itrk-border-radius);
    display: none;
}
.chatGui #toolbar {
    display: block;
    text-align: right;
    padding: 6px 8px 8px 3px;
    background: #e5e5e5;
    margin: 0;
}
.chatGui #toolbar img {
    float: left;
    margin-left: 5px;
    height: 30px;
    width: auto;
}
.chatGui #toolbar div {
    display: inline-block;
    padding-top: 0.5em;
    line-height: 1.5em;
    width: 2em;
    text-align: center;
    padding-bottom: 0;
    color: var(--darkgray-2);
    cursor: pointer;
}
.chatGui #toolbar div:hover {
    color: var(--darkgray);
    background: rgba(0, 0, 0, 0.1);
}

.chatMessagesBox {
    background: white;
    display: none;
    min-height: 272px;
    max-height: 400px;
    padding: 20px;
    overflow: scroll;
    text-align: right;
}

@media only screen and (max-width:991px) {
    .chatGui {
        max-width: 350px;
        width: 60vw;
    }
    .chatMessagesBox {
        max-height: 350px;
    }
}

@media only screen and (max-width:767px) {
    .chatGui {
        max-width: 450px;
        width: 90vw;
    }
    .chatMessagesBox {
        min-height: 250px;
        max-height: 55vh;
    }
}

@media only screen and (max-width:480px) {
    .chatMessagesBox {
        min-height: 250px;
        max-height: 48vh;
    }
}

@media only screen and (max-height:640px) {
    .chatMessagesBox {
        min-height: 150px;
        max-height: 200px;
    }
}

@media only screen and (max-height:558px) {
    .chatMessagesBox {
        min-height: 80px;
        max-height: 150px;
    }
}

.chatMessagesBox a {
    color: white;
}

.chatMessagesBox a:hover {
    color: black;
}

.chatGui #chatNameForm {
    display: block;
    padding: 20px;
    margin-bottom: 0 !important;
}
.chatGui #chatStartBtn {
    margin-top: 20px;
}

.chatGui #chatNameForm fieldset {
    padding: 0;
    border: 0;
}

.chatGui #chatNameForm input {
    margin-top: 15px;
    margin-bottom: 0 !important;
}

.chatMessageForm {
    display: none;
    position: relative;
    background: var(--lightgray-1);
    border-top: 1px solid var(--itrk-border);
    border-radius: 0 0 var(--itrk-border-radius) var(--itrk-border-radius);
    padding: 20px 0;
    height: 60px;
}
.chatMessageForm .chatMessageSubmitBtn {
    position: absolute;
    top: 17px;
    right: 20px;
}
.chatMessageForm .chatMessageSubmitBtn i {
    color: var(--lightgray-4);
    font-size: 23px;
}
.chatMessageForm .chatMessageSubmitBtn button {
    border: none;
    background: none;
}
.chatMessageForm .chatMessageSubmitBtn button:hover i {
    color: var(--primary-color);
}

.panes .chatMessageForm {
    display: block;
}

.chatMessageForm textarea {
    background: var(--lightgray-1);
    /** subtract padding left and right) */
    width: calc(100% - (20px + 50px));
    height: 37px;
    line-height: 1.4em;
    padding: 0 50px 0 20px;
    color: var(--tertiary-color);

    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    border: none;
    overflow: auto;
    outline: none;

    -webkit-box-shadow: none;
    -moz-box-shadow: none;
    box-shadow: none;
    resize: none;
}

.chatMessageForm textarea:focus, .chatMessageForm input:focus {
    outline: 0;
}

#chatMessageCounter {
    float: left;
    margin-left: 1em;
    color: var(--lightgray-4);
    font-size: 90%;
}

.chat-message {
    margin-top: 20px;
    position: relative;
}

.chat-message .chat-message-body {
    color: var(--tertiary-color);
    padding: 20px;
    text-align: left;
    line-height: 17px;
}
.chat-message .chat-message-body a {
    color: var(--tertiary-color);
    text-decoration: underline;
}

/* messages which have been generated on this end-point */
.chat-message.remote .chat-message-body,
.chat-message.me .chat-message-body {
    background: var(--lightgray-1);
    color: var(--darkgray);
    border: 1px solid var(--itrk-border);
    border-radius: 0 10px 10px 10px;
    margin-left: 70px;
}

#master-chat ul.tabs li a > .image,
#master-chat .panes .chatGui .infobar > .icon .image,
.chat-message.remote div.image,
.chat-message.me div.image {
    position: absolute;
    background: white;
    overflow: hidden;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--itrk-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

#master-chat ul.tabs li a > .image span.icon,
#master-chat .panes .chatGui .infobar > .icon .image span.icon,
.chat-message div.image span.icon {
    color: white;
    font-weight: 500;
    font-size: 18px;
    font-family: 'Bitter', Arial, verdana, sans-serif;
}

.chat-message.me .chat-message-body {
    margin-left: 0;
    margin-right: 70px;
    border-radius: 10px 0 10px 10px;
}

.chat-message.me div.image {
    left: auto;
    right: 0;
    opacity: 0.5;
}

#master-chat ul.tabs li a > .image img,
.chat-message div.image img {
    width: 45px;
    height: auto;
}

.chat-message:first-of-type {
    margin-top: 0px !important;
}

.time-info {
    margin: 5px 0 -10px 0;
    padding: 0;
    background: none;
    color: var(--lightgray-4);
    box-shadow: none;
    font-size: 85%;
    display: block;
    text-align: end;
    width: 100%;
    font-style: italic;
}

.chat-message.System {
    background: none;
    color: var(--tertiary-color);
    text-align: left;
    padding: 0 1em 1em 1em;
    width: 90%;
    float: left;
    clear: both;
    font-size: 110%;
}

/* messages which have been generated on any other end-point */
.chat-message.debug {
    background: var(--lightgray-4);
    color: black;
}
