/* Fix user-agent */

* {
  box-sizing: border-box;
}

html {
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

html, input {
  font-family:
    "HelveticaNeue-Light",
    "Helvetica Neue Light",
    "Helvetica Neue",
    Helvetica,
    Arial,
    "Lucida Grande",
    sans-serif;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
  word-wrap: break-word;
}

/* Pages */

.pages {
  height: 100%;
  margin: 0;
  padding: 0;
  width: 100%;
}

.page {
  height: 100%;
  position: absolute;
  width: 100%;
}

/* Login Page */

.login.page {
  background-color: #000;
}

.login.page .form {
  height: 260px;
  margin-top: -130px;
  position: absolute;

  text-align: center;
  top: 50%;
  width: 100%;
}

.login.page .form .usernameInput,
.login.page .form .roomNameInput,
.login.page .form .passwordInput {
  background-color: transparent;
  border: none;
  border-bottom: 2px solid #fff;
  outline: none;
  padding-bottom: 15px;
  text-align: center;
  width: 400px;
  display: block;
  margin: 10px auto;
}

.login.page .title {
  font-size: 200%;
}

.login.page .usernameInput,
.login.page .roomNameInput,
.login.page .passwordInput {
  font-size: 200%;
  letter-spacing: 3px;
}

.login.page .title,
.login.page .usernameInput,
.login.page .roomNameInput,
.login.page .passwordInput {
  color: #fff;
  font-weight: 100;
}

.login-error {
  color: #e21400;
  font-size: 90%;
  margin-top: 10px;
  min-height: 1.2em;
}

.login-warning {
  color: #f8a700;
  font-size: 80%;
  margin-top: 4px;
  min-height: 1.2em;
}

/* Chat page */

.chat.page {
  display: none;
}

/* Font */

.messages {
  font-size: 150%;
}

.inputMessage {
  font-size: 100%;
}

.log {
  color: gray;
  font-size: 70%;
  margin: 5px;
  text-align: center;
}

/* Messages */

.chatArea {
  height: 100%;
  padding-bottom: 70px;
}

.messages {
  height: 100%;
  margin: 0;
  overflow-y: scroll;
  padding: 10px 20px 10px 20px;
}

.messageBody {
  white-space: pre-wrap;
}

.message.typing .messageBody {
  color: gray;
}

.username {
  display: block;
  font-weight: 700;
  overflow: hidden;
}

/* Rich text indicator */

.rich-indicator {
  position: absolute;
  bottom: 62px;
  left: 12px;
  font-size: 11px;
  color: #4ae8c4;
  background: rgba(0, 0, 0, 0.7);
  padding: 2px 8px;
  border-radius: 3px;
  z-index: 10;
  pointer-events: none;
}

.messageBody span {
  display: inline;
}

.messageBody span[style] {
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 90%;
}

/* Input */

.inputArea {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-end;
  background: #000;
}

.fileButton {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 24px;
  padding: 12px 8px 12px 12px;
  color: #ccc;
  flex-shrink: 0;
  line-height: 1;
}

.fileButton:hover {
  color: #fff;
}

.inputMessage {
  border: 10px solid #000;
  border-left: 0;
  min-height: 60px;
  max-height: 200px;
  outline: none;
  padding-left: 10px;
  padding-top: 15px;
  flex: 1;
  resize: none;
  overflow-y: auto;
  font-family: inherit;
  line-height: 1.4;
}

/* Image messages */

.chatImage {
  max-width: 400px;
  max-height: 300px;
  border-radius: 4px;
  display: block;
  margin-top: 4px;
}

.imageDownload {
  font-size: 70%;
  color: #3b88eb;
  text-decoration: none;
  margin-top: 2px;
  display: inline-block;
}

.imageDownload:hover {
  text-decoration: underline;
}

/* File attachments */

.fileAttachment {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 4px;
  max-width: 400px;
}

.fileIcon {
  font-size: 28px;
  flex-shrink: 0;
}

.fileName {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 90%;
}

.fileDownload {
  font-size: 75%;
  color: #3b88eb;
  text-decoration: none;
  flex-shrink: 0;
}

.fileDownload:hover {
  text-decoration: underline;
}

/* Drag-and-drop overlay */

.chat.page.dragover::after {
  content: 'Drop file here';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(59, 136, 235, 0.15);
  border: 3px dashed #3b88eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 200%;
  color: #3b88eb;
  pointer-events: none;
  z-index: 100;
}
