@import url('https://fonts.googleapis.com/css2?family=Recursive:wght@300;400&display=swap');

body {
    padding: 0;
    margin: 0;
    width: 100vw;
    height: 100vh;
    box-sizing: border-box;
}
.grid-container {
    width: 100%;
    height: 100%;
    display: grid;
    font-family: sans-serif;
    grid-template-columns: auto;
    grid-template-rows: 40px auto 85px 1.5em;
    grid-template-areas: 
    "title"
    "messages"
    "input"
    "typing";
}
.grid-container > * {
    padding: 0 10%;
}
header {
    grid-area: title;
    display: flex;
    box-shadow: 0 2px 1px 0 rgba(0, 0, 0, 0.2);
    z-index: 1;
}
.title {
    margin: 0 5px 0 2px;
    user-select: none;
    align-self: center;
}
#settings-hover-container {
    display: flex;
    flex-direction: row;
    align-self: center;
    margin: 0;
    padding: 0;
    user-select: none;
}
.settings {
    display: inline-block;
    height: 21px;
    width: 21px;
    text-align: center;
    align-self: flex-end;
    color: #666;
    padding: 5px;
}
.settings-expand {
    align-self: center;
    font-family: sans-serif;
    margin: 0 5px;
    color: #666;
}
.settings-input-collapse {
    transform-origin: left;
    max-width: 20ch;
    border: 1.5px solid #999;
    border-radius: 5px;
    padding: 2px 3px 1px 4px;
    height: 1.5em;
    margin-left: 0;
}
#stats {
    font-size: 10px;
    font-family: sans-serif, sans, helvetica, arial;
    color: #444;
    text-align: right;
    position: fixed;
    right: 50px;
    top: 3px;
}
#react-messages {
    grid-area: messages;
    overflow-y: scroll;
    overflow-x: hidden;
}
.messageBox {
    display: flex;
    flex-direction: column;
    width: 100%;
}
.messageBox:empty::after {
    content: "It's too quiet in here...";
    font-style: italic;
    color: #777;
    font-size: 1.1875em;
    padding: 4px 10% 4px 5px;
    width: 100%;
    text-align: center;
}
.messageBox .msg {
    width: 100%;
    white-space: pre-wrap;
    display: inline-block;
    padding: 4px 10% 4px 5px;
}
.messageBox .msg.msg-collapse {
    padding-bottom: 2px;
    padding-top: 0;
}
.messageBox .msg .user-id {
    color: #356;
    font-weight: 600;
}
.messageBox .msg .timestamp {
    color: #666;
    font-size: 12px;
    margin-left: 5px;
}
.msg.live {
    opacity: 50%;
    user-select: none;
}
.input {
    grid-area: input;
    display: flex;
    margin-top: -1px;
    margin-bottom: 2px;
    z-index: 1;
}
#send-box {
    height: auto;
    flex-grow: 1;
    resize: none;
    font-size: 16px;
    font-family: sans-serif;
    padding: 5px;
    border-radius: 4px;
}
#send-msg {
    display: inline-block;
    width: 45px;
    height: 45px;
    border-radius: 100%;
    line-height: 45px;
    
    text-align: center;
    align-self: center;
    margin: 6px;

    cursor: pointer;

    font-family: sans-serif;
    color: white;
    background-color: #48d;
    border: 4px solid #7ac;
    user-select: none;
}
/* Typing Indicators */
#typing {
    grid-area: typing;
    user-select: none;
}
#typing.hidden {
    display: none;
}
#typing-text {
    line-height: 1.2em;
    color: #666;
    user-select: none;
}
@keyframes typing-dots {
    from {
        transform: translateY(0px) scale(1);
        opacity: 40%;
    }
    to {
        transform: translateY(-5px) scale(1.3);
        opacity: 80%;
    }
    /*to: {
        transform: translateY(0px) scale(1);
        opacity: 40%;
    }*/
}
.typing-anim span {
    background-color: black;
    display: inline-block;
    width: 4px;
    height: 4px;
    vertical-align: middle;
    border-radius: 2px;

    animation-name: typing-dots;
    animation-iteration-count: infinite;
    animation-duration: 0.6s;
    animation-direction: alternate;
    animation-timing-function: cubic-bezier(1,-0.06,.87,1.13);
}
.typing-anim span:nth-child(2) {
    animation-delay: 0.2s;
}
.typing-anim span:nth-child(3) {
    animation-delay: 0.4s;
}