/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

html {
  font-size: 10px;
  font-family: menu;
}

button::-moz-focus-inner {
  border: 0;
}

.conversation-toolbar {
  z-index: 1020; /* required to have it superimposed to the video element */
  border: 0;
  left: 1.2rem;
  height: 2.4rem;
  position: absolute;
  bottom: 1.2rem;
  text-align: center;
}

html[dir="rtl"] .conversation-toolbar {
  left: .7rem;
  right: 1.2rem;
}

.idle {
  transition: opacity 1.5s;
  opacity: .75;
}

/* standalone version */

.conversation-toolbar > li {
  float: left;
  margin-right: .7rem;
  font-size: 0; /* prevents vertical bottom padding added to buttons in google
                   chrome */
}

html[dir="rtl"] .conversation-toolbar > li {
  float: right;
  margin-left: .7rem;
  margin-right: auto;
}

.conversation-toolbar .btn {
  background-position: center;
  background-size: 28px;
  background-repeat: no-repeat;
  background-color: transparent;
  height: 28px;
  width: 33px;
}

.btn-hangup-entry > .btn {
  /* Make the button the width of the background, so that we don't get an
     extra gap which appears to push the toolbar in further than necessary */
  width: 28px;
}

.conversation-toolbar-media-btn-group-box {
  background-position: center;
  background-repeat: no-repeat;
  background-color: transparent;
  background-image: url("../img/media-group.svg");
  background-size: cover;
  height: 28px;
  width: 67px;
}

.conversation-toolbar-media-btn-group-box > button:last-child:active,
.conversation-toolbar-media-btn-group-box > button:last-child:hover {
  background-image: url("../img/media-group-right-hover.svg");
  background-size: cover;
}

html[dir="rtl"] .conversation-toolbar-media-btn-group-box > button:last-child:active,
html[dir="rtl"] .conversation-toolbar-media-btn-group-box > button:last-child:hover {
  background-image: url("../img/media-group-left-hover.svg");
  background-size: cover;
}

.conversation-toolbar-media-btn-group-box > button:first-child:active,
.conversation-toolbar-media-btn-group-box > button:first-child:hover {
  background-image: url("../img/media-group-left-hover.svg");
  background-size: cover;
}

html[dir="rtl"] .conversation-toolbar-media-btn-group-box > button:first-child:active,
html[dir="rtl"] .conversation-toolbar-media-btn-group-box > button:first-child:hover {
  background-image: url("../img/media-group-right-hover.svg");
  background-size: cover;
}

/* conversationViews.jsx */

.conversation-toolbar .btn-hangup {
  background-image: url("../img/exit.svg");
  border: 0;
}

/* Audio mute button */
.btn-mute-audio:after {
  content: url("../img/audio.svg");
}

.btn-mute-audio.muted:after {
  content: url("../img/audio-mute.svg");
}
.btn-mute-audio:hover:after,
.btn-mute-audio:active:after {
  content: url("../img/audio-hover.svg");
}

.btn-mute-audio.muted:hover:after,
.btn-mute-audio.muted:active:after {
  content: url("../img/audio-mute-hover.svg");
}

/* Video mute button */
.btn-mute-video:after {
  content: url("../img/video.svg");
}

.btn-mute-video:active:after,
.btn-mute-video:hover:after {
  content: url("../img/video-hover.svg");
}

.btn-mute-video.muted:after {
  content: url("../img/video-mute.svg");
}

.btn-mute-video.muted:hover:after,
.btn-mute-video.muted:active:after {
  content: url("../img/video-mute-hover.svg");
}

.btn-settings {
  width: 28px;
  height: 28px;
  background-size: 28px;
  background-image: url("../img/settings.svg");
  background-color: transparent;
}

.btn-settings:hover,
.btn-settings:active {
  background-image: url("../img/settings-hover.svg");
}

/* General Call (incoming or outgoing). */

.call-action-group {
  display: flex;
  padding: 0 4px;
  width: 100%;
}

.call-action-group > .btn {
  min-height: 30px;
  border-radius: 4px;
  margin: 0 4px;
  min-width: 64px;
}

.call-action-group > .btn {
  max-width: 48%;
  flex-grow: 1;
}

.call-action-group > .btn-rejoin {
  max-width: 100%;
}

.call-action-group .btn-group-chevron,
.call-action-group .btn-group {
  width: 100%;
}

.room-failure {
  /* This flex allows us to not calculate the height of the logo area
     versus the buttons */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 230px;
  height: 100%;
}

.room-failure > .call-action-group {
  flex: none;
  margin: 1rem 0 2rem;
}

.room-failure > .failure-info {
  flex: auto;
}

.room-failure > .settings-control {
  position: absolute;
  top: 1rem;
  right: .5rem;
}

html[dir="rtl"] .room-failure > .settings-control {
  left: .5rem;
  right: auto;
}

.failure-info {
  text-align: center;
  /* This flex is designed to set the logo in a standard place, but if the
     text below needs more space (due to multi-line), then the logo will move
     higher out the way */
  display: flex;
  flex-direction: column;
  /* Matches 4px padding of .btn-group plus 4px of margin for .btn */
  padding: 0 0.8rem;
}

.failure-info-logo {
  height: 90px;
  background-image: url("../img/sad_hello_icon_64x64.svg");
  background-position: center center;
  background-size: contain;
  background-repeat: no-repeat;
  flex: 1;
  background-size: 90px 90px;
  /* Don't let the logo take up too much space, e.g. if there's only one line of
     text. */
  max-height: calc(90px + 4rem);
  margin-top: 1rem;
}

.failure-info-message {
  margin: 0.25rem 0px;
  text-align: center;
  font-weight: bold;
  font-size: 1.2rem;
  color: #333;
  flex: none;
}

.failure-info-extra,
.failure-info-extra-failure {
  margin: 0.25rem 0;
  flex: none;
}

.failure-info-extra-failure {
  color: #f00;
}

.settings-menu.dropdown-menu {
  bottom: 3.1rem;
}

.settings-menu.dropdown-menu {
  left: auto;
  /*offset dropdown menu to be above menu button*/
  right: 14px;
}

html[dir="rtl"] .settings-menu.dropdown-menu {
  right: auto;
}

html[dir="rtl"] .settings-menu.dropdown-menu {
  /*offset dropdown menu to be above menu button*/
  left: 14px;
}

.settings-menu.dropdown-menu.menu-below {
  top: 11.5rem;
  bottom: auto;
}

/* Feedback form */
.feedback-view-container {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  justify-content: center;
  align-content: center;
  align-items: flex-start;
  height: 100%;
}

.feedback-heading {
  margin: 1em 0;
  width: 100%;
  text-align: center;
  font-weight: bold;
  font-size: 1.2em;
}

.feedback-hello-logo {
  background-image: url("../img/helloicon.svg");
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  flex: 2 1 auto;
  width: 100%;
  margin: 30px 0;
}

.feedback-button-container {
  flex: 0 1 auto;
  margin: 30px;
  align-self: center;
}

.feedback-button-container > button {
  margin: 0 30px;
  padding: .5em 2em;
  border: none;
  background: #00A9DC;
  color: #fff;
  cursor: pointer;
}

/*
 * For any audio-only streams, we want to display our own background
 */
.avatar {
  background-image: url("../img/audio-call-avatar.svg");
  background-repeat: no-repeat;
  background-color: #4BA6E7;
  background-size: contain;
  background-position: center;

  /*
   * Expand to fill the available space, since there is no video any
   * intrinsic width. XXX should really change to an <img> for clarity
   */
  height: 100%;
  width: 100%;
}

/*
 * Used to center the loading spinner
 */
.focus-stream,
.media-wrapper:not(.receiving-screen-share) > .remote {
  position: relative;
}

.loading-stream {
  /* vertical and horizontal center */
  position: absolute;
  top: 50%;
  left: 50%;
  margin-left: -50px;
  margin-top: -50px;
  width: 100px;
  height: 100px;

  /* place the animation */
  background-image: url("../img/spinner.svg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 40%;

  /* 12 is the number of lines in the spinner image */
  animation: rotate-spinner 1s steps(12, end) infinite;
}

@keyframes rotate-spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Stream paused */
.focus-stream > .room-inner-info-area > .remote-stream-paused {
  background-color: #fff;
  border: solid 1px #a6a6a6;
  box-shadow: 0 2px 4px rgba(0,0,0,.25);
  display: inline-block;
  margin: auto;
  padding: 10px 15px;
}

.focus-stream > .room-inner-info-area > .remote-stream-paused > h1 {
  font-size: 1.6rem;
  line-height: 3rem;
  padding-left: 42px;
  position: relative;
  text-align: left;
}

.focus-stream > .room-inner-info-area > .remote-stream-paused > h1:before {
  background: url("../img/paused-hello.svg") center center no-repeat;
  content: "";
  display: block;
  height: 30px;
  left: 0;
  position: absolute;
  width: 32px;
}

html[dir="rtl"] .focus-stream > .room-inner-info-area > .remote-stream-paused > h1 {
  padding-left: 0;
  padding-right: 42px;
}

html[dir="rtl"] .focus-stream > .room-inner-info-area > .remote-stream-paused > h1:before {
  right: 0;
  transform: scaleX(-1);
}

.remote > .avatar {
  /* make visually distinct from local avatar */
  opacity: 0.25;
}

/* Force full height on all parents up to the video elements
 * this way we can ensure the aspect ratio and use height 100%
 * on the video element
 * */
html, .fx-embedded, #main,
.desktop-room-wrapper {
  height: 100%;
}

/**
 * Rooms
 */

.room-conversation-wrapper {
  position: relative;
  height: 100%;
}

.room-invitation-overlay {
  position: absolute;
  background: rgba(255, 255, 255, 0.85);
  top: 0;
  height: 100%;
  right: 0;
  left: 0;
  color: #000;
  z-index: 1010;
  display: flex;
  flex-flow: column nowrap;
  align-items: stretch;
}

.room-invitation-content {
  display: flex;
  flex-flow: column nowrap;
  margin: 12px 0;
  font-size: 1.4rem;
}

.room-invitation-content > * {
  width: 100%;
  margin: 0 15px;
}

.room-context-header {
  font-weight: bold;
  font-size: 1.6rem;
  margin-bottom: 10px;
  text-align: center;
}

/* Input Button Combo group */
.input-button-content {
  margin: 0 15px 10px 15px;
  min-width: 64px;
  border-radius: 4px;
  border: 1px solid #d2cece;;
}

.input-button-group-label {
  color: #898a8a;
  margin: 0 15px;
  margin-bottom: 2px;
  font-size: 1.2rem;
}

.input-button-content > * {
  width: 100%;
  padding: 0 4px;
}

.input-button-content > .input-group input {
  font-size: 1.4rem;
  padding: 0.7rem;
  width: 100%;
  border: 0;
}

.input-button-content > .group-item-top {
  border-radius: 4px 4px 0 0;
}

.input-button-content > .group-item-bottom {
  border-radius: 0 0 4px 4px;
}

.input-button-content > .input-group {
  background: #FFF;
}

.input-button-content > .invite-button {
  background: #00a9dc;
  height: 34px;
  text-align: center;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
}

.input-button-content > .invite-button.triggered {
  background-color: #00a9dc;
}

.input-button-content > .invite-button:hover {
  background-color: #008ACB;
}

.share-action-group {
  display: flex;
  padding: 0 15px;
  width: 100%;
  flex-wrap: nowrap;
  flex-direction: row;
  justify-content: center;
}

.share-action-group > .invite-button {
  cursor: pointer;
  height: 34px;
  border-radius: 4px;
  background-color: #ebebeb;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  flex-grow: 1;
  margin-right: 20px;
}

.share-action-group > .invite-button:last-child {
  margin-right: 0;
}

.share-action-group > .invite-button:hover {
  background-color: #d4d4d4;
}

.share-action-group > .invite-button.triggered {
  background-color: #d4d4d4;
}

.share-action-group > .invite-button > img {
  height: 28px;
  width: 28px;
}

.share-action-group > .invite-button > div {
  display: inline;
  color: #4a4a4a;
}

.share-service-dropdown {
  color: #000;
  text-align: start;
  bottom: auto;
  top: 0;
  overflow: hidden;
  overflow-y: auto;
}

/* When the dropdown is showing a vertical scrollbar, compensate for its width. */
body[platform="other"] .share-service-dropdown.overflow > .dropdown-menu-item,
body[platform="win"] .share-service-dropdown.overflow > .dropdown-menu-item {
  -moz-padding-end: 20px;
}

.share-service-dropdown > .dropdown-menu-item > .icon {
  width: 14px;
  height: 14px;
  margin-right: 4px;
}

.dropdown-menu-item > .icon-add-share-service {
  background-image: url("../img/icons-16x16.svg#add");
  background-repeat: no-repeat;
  background-size: 12px 12px;
  width: 12px;
  height: 12px;
}

.dropdown-menu-item:hover > .icon-add-share-service {
  background-image: url("../img/icons-16x16.svg#add-hover");
}

.dropdown-menu-item:hover:active > .icon-add-share-service {
  background-image: url("../img/icons-16x16.svg#add-active");
}

.context-url-view-wrapper > .context-content {
  margin: 0 1rem 1.5rem 1rem;
}

.media-layout {
  height: 100%;
}

.media-layout > .media-wrapper {
  display: flex;
  flex-flow: column wrap;
  height: 100%;
}

.media-wrapper > .focus-stream {
  display: flex;
  /* We want this to be the width, minus 200px which is for the right-side text
     chat and video displays. */
  width: calc(100% - 200px);
  /* 100% height to fill up media-layout, thus forcing other elements into the
     second column that's 200px wide */
  height: 100%;
  background-color: #d8d8d8;
}

.media-wrapper > .focus-stream.screen-sharing-paused > .remote-video-box {
  display: none;
}

.media-wrapper > .local {
  flex: 0 1 auto;
  width: 200px;
  height: 150px;
}

.media-wrapper > .local .local-video,
.media-wrapper > .focus-stream > .local .local-video {
  width: 100%;
  height: 100%;
  /* Transform is to make the local video act like a mirror, as is the
     convention in video conferencing systems. */
  transform: scale(-1, 1);
  transform-origin: 50% 50% 0;
}

.media-wrapper > .remote {
  /* Works around an issue with object-fit: cover in Google Chrome - it doesn't
     currently crop but overlaps the surrounding elements.
     https://code.google.com/p/chromium/issues/detail?id=400829 */
  overflow: hidden;
}

.media-wrapper > .remote .remote-video {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.media-wrapper > .screen .screen-share-video {
  width: 100%;
  height: 100%;
}

/* Note: we can't use "display: flex;" for the text-chat-view itself,
   as this lets it overflow the expected column heights, and we can't
   fix its height. */
.media-wrapper > .text-chat-view {
  flex: 0 0 auto;
  /* Text chat is a fixed 200px width for normal displays. */
  width: 200px;
  height: 100%;
}

.media-wrapper.showing-local-streams > .text-chat-view {
  /* When we're displaying the local streams, then we need to make the text
     chat view a bit shorter to give room. */
  height: calc(100% - 150px);
}

.media-wrapper.showing-local-streams.receiving-screen-share {
  position: relative;
}

.media-wrapper.showing-local-streams.receiving-screen-share > .text-chat-view {
  /* When we're displaying the local streams, then we need to make the text
     chat view a bit shorter to give room. */
  height: calc(100% - 300px);
}

.media-wrapper.receiving-screen-share > .screen {
  order: 1;
}

.media-wrapper.receiving-screen-share > .text-chat-view {
  order: 2;
}

.media-wrapper.receiving-screen-share > .remote {
  order: 3;
  flex: 0 1 auto;
  width: 200px;
  height: 150px;
}

.media-wrapper.receiving-screen-share > .local {
  order: 4;
}

@media screen and (max-width:640px) {
  .media-layout > .media-wrapper {
    flex-direction: row;
    margin: 0;
    width: 100%;
  }

  .media-wrapper > .focus-stream {
    width: 100%;
    /* A reasonable height */
    height: 55%;
  }

  .media-wrapper.receiving-screen-share > .focus-stream {
    height: 50%;
  }

  .media-wrapper > .focus-stream > .local ~ .conversation-toolbar {
    /* 120px is for the local video area. */
    max-width: calc(100% - 120px);
  }

  .media-wrapper > .focus-stream > .local {
    /* Position over the remote video */
    position: absolute;
    /* Make sure its on top */
    z-index: 2;
    margin: 3px;
    right: 0;
    left: auto;
    bottom: 0;
    width: 120px;
    height: 120px;
  }

  html[dir="rtl"] .media-wrapper > .focus-stream > .local {
    right: auto;
    left: 0;
  }

  html[dir="rtl"] .media-wrapper > .local {
    right: auto;
    left: 0;
  }

  .media-wrapper > .text-chat-view {
    order: 3;
    flex: 1 1 auto;
    width: 100%;
  }

  .media-wrapper > .text-chat-view,
  .media-wrapper.showing-local-streams > .text-chat-view,
  .media-wrapper.showing-local-streams.receiving-screen-share > .text-chat-view {
    /* The remaining 30% that the .focus-stream doesn't use. */
    height: 45%;
  }

  .media-wrapper.receiving-screen-share > .remote > .conversation-toolbar,
  .media-wrapper.showing-local-streams.receiving-screen-share  > .remote > .conversation-toolbar {
    bottom: calc(30% + 1.5rem);
  }


  .media-wrapper.receiving-screen-share > .screen {
    order: 1;
  }

  .media-wrapper.receiving-screen-share > .remote {
    /* Screen shares have remote & local video side-by-side on narrow screens */
    order: 2;
    flex: 1 1 auto;
    height: 20%;
    /* Ensure no previously specified widths take effect, and we take up no more
       than half the width. */
    width: auto;
    max-width: 50%;
  }

  .media-wrapper.receiving-screen-share > .remote .remote-video {
      /* Reset the object-fit for this. */
    object-fit: contain;
  }

  .media-wrapper.receiving-screen-share > .local {
    /* Screen shares have remote & local video side-by-side on narrow screens */
    order: 3;
    flex: 1 1 auto;
    height: 20%;
    /* Ensure no previously specified widths take effect, and we take up no more
       than half the width. */
    width: auto;
    max-width: 50%;
    /* This cancels out the absolute positioning when it's just remote video. */
    position: relative;
    bottom: auto;
    right: auto;
    margin: 0;
  }

  .media-wrapper.receiving-screen-share > .text-chat-view {
    order: 4;
  }
}

/* e.g. very narrow widths similar to conversation window.
   Note: on some displays (e.g. windows / medium size) the width
   may be very slightly over the expected width, so we add on 2px
   just in case. */
@media screen and (max-width:352px) {
  .conversation-toolbar {
    left: 50%;
    transform: translateX(-50%);
  }

  .media-layout > .media-wrapper {
    flex-flow: column nowrap;
  }

  .media-wrapper > .focus-stream > .local ~ .conversation-toolbar {
    max-width: 75%;
  }

  .media-wrapper > .focus-stream > .local {
    position: absolute;
    right: 0;
    left: auto;
    /* 30% is the height of the text chat. As we have a margin,
       we don't need to worry about any offset for a border */
    bottom: 0;
    margin: 3px;
    object-fit: contain;
    /* These make the avatar look reasonable and the local
       video not too big */
    width: 25%;
    height: 25%;
  }

  html[dir="rtl"] .media-wrapper > .focus-stream > .local {
    left: 0;
    right: auto;
  }

  .screen > .no-video {
    display: none;
  }

  .media-wrapper:not(.showing-remote-streams) > .focus-stream > .no-video {
    display: none;
  }

  .media-wrapper:not(.showing-remote-streams) > .focus-stream > .local {
    position: relative;
    margin: 0;
    right: auto;
    left: auto;
    bottom: auto;
    width: 100%;
    height: 100%;
  }

  .media-wrapper:not(.showing-remote-streams) > .focus-stream > .local ~ .conversation-toolbar {
    max-width: 100%;
  }

  .media-wrapper > .focus-stream {
    flex: 1 1 auto;
    /* To keep the aspect ratio of video. Update accordingly with chatbox[customSize] width */
    height: 263px;
  }

  .media-wrapper > .text-chat-view {
    height: calc(100% - 263px);
  }
}

/* Text chat in styles */

.text-chat-view {
  background: white;
}

.text-chat-view > .text-chat-entries {
  width: 100%;
  overflow: auto;
  padding-top: 15px;
  /* 40px is the height of .text-chat-box. */
  height: calc(100% - 40px);
}

.text-chat-disabled > .text-chat-entries {
  /* When text chat is disabled, the entries box should be 100% height. */
  height: 100%;
}

.text-chat-entry,
.text-chat-header {
  display: flex;
  margin-bottom: .5em;
  align-items: flex-start;
}

.text-chat-header > p {
  margin: 0;
}

.text-chat-entry {
  /* aligns paragraph to side where reading starts from */
  text-align: start;
}

/* Sent text chat entries should be on the right */
.text-chat-entry.sent {
  /* aligns paragraph to right side */
  justify-content: flex-end;
  margin-left: 0;
  margin-right: 10px;
}

.text-chat-entry.received {
  margin-left: 10px;
  margin-right: 0;
}

html[dir="rtl"] .text-chat-entry.sent {
  margin-left: 10px;
  margin-right: 0;
}


html[dir="rtl"] .text-chat-entry.received {
  margin-left: 0;
  margin-right: 10px;
}

.text-chat-entry > p {
  position: relative;
  z-index: 10;
  /* Drop the default margins from the 'p' element. */
  margin: 0;
  padding: .8rem;
  /* leave some room for the chat bubble arrow */
  max-width: 70%;
  border-radius: 15px;
  border: 1px solid #5cccee;
  background: #fff;
  word-wrap: break-word;
  flex: 0 1 auto;
  order: 1;
}

.text-chat-entry > .context-wrapper {
  flex: 0 1 auto;
  order: 1;
}

.text-chat-entry.sent > p {
  border-bottom-right-radius: 0;
}

.text-chat-entry.received > p {
  border-top-left-radius: 0;
  border-color: #d8d8d8;
}

html[dir="rtl"] .text-chat-entry.sent > p {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 15px;
}

html[dir="rtl"] .text-chat-entry.received > p {
  border-top-right-radius: 0;
  border-top-left-radius: 15px;
}

/* Text chat entry timestamp */
.text-chat-entry-timestamp {
  margin: 0 .5em;
  color: #aaa;
  font-style: italic;
  font-size: .8em;
  flex: 0 1 auto;
  align-self: center;
}

.received > .text-chat-entry-timestamp {
  order: 2;
}

/* Pseudo element used to cover part between chat bubble and chat arrow.
   dimensions may change for each position */
.text-chat-entry > p:after {
  position: absolute;
  background: #fff;
  content: "";
  /* default dimensions */
  width: 6px;
  height: 7px;
}

.text-chat-entry.sent > p:after {
  right: -1px;
  bottom: 0;
  width: 7px;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
}

.text-chat-entry.received > p:after {
  top: 0;
  left: -1px;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}

html[dir="rtl"] .text-chat-entry.sent > p:after {
  /* Reset */
  right: auto;
  left: -1px;
  bottom: 0;
}

html[dir="rtl"] .text-chat-entry.received > p:after {
  /* Reset */
  top: 0;
  right: -1px;
  width: 9px;
  height: 6px;
}

/* Text chat entry arrow */
.text-chat-arrow {
  width: 18px;
  background-repeat: no-repeat;
  flex: 0 1 auto;
  position: relative;
  z-index: 5;
}

.text-chat-entry.sent .text-chat-arrow {
  margin-bottom: -1px;
  margin-left: -11px;
  height: 10px;
  background-image: url("../img/chatbubble-arrow-right.svg");
  order: 2;
  align-self: flex-end;
}

.text-chat-entry.received .text-chat-arrow {
  margin-left: 0;
  margin-right: -9px;
  height: 10px;
  background-image: url("../img/chatbubble-arrow-left.svg");
  align-self: auto;
}

html[dir="rtl"] .text-chat-arrow {
  transform: scaleX(-1);
}

html[dir="rtl"] .text-chat-entry.sent .text-chat-arrow {
  /* Reset margin. */
  margin-left: 0;
  margin-right: -11px;
}

html[dir="rtl"] .text-chat-entry.received .text-chat-arrow {
  /* Reset margin. */
  margin-right: 0;
  margin-left: -10px;
}

/* Context updated */
.text-chat-entry > .context-content > .context-wrapper {
  max-width: 300px;
  min-height: 50px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 4px;
  padding: 10px;
  box-shadow: 0 1px 1px rgba(0,0,0,.15);
}

.text-chat-entry.received > .context-content > .context-wrapper {
  max-width: 180px;
}

.text-chat-header.special.room-name {
  color: #666;
  font-weight: bold;
  margin-bottom: 0;
  margin-right: 0;
}

.text-chat-header.special.room-name p {
  width: 100%;
  padding: 0.8rem 1rem 1.4rem;
  margin: 0;
}

.text-chat-header.special > p {
  border: none;
}

.text-chat-box {
  margin: auto;
  flex: 0 0 auto;
  max-height: 40px;
  min-height: 40px;
  width: 100%;
}

.text-chat-box > form > input {
  width: 100%;
  height: 40px;
  padding: 0 .4rem .4rem;
  font-size: 1.1em;
  border: 0;
  border-top: 1px solid #d8d8d8;
}

.text-chat-box > form > input::-webkit-input-placeholder {
  font-size: 1.1em;
  color: #999;
}

.text-chat-box > form > input::-moz-placeholder {
  font-size: 1.1em;
  color: #999;
}

.text-chat-box > form > input:-moz-placeholder {
  font-size: 1.1em;
  color: #999;
}

.text-chat-box > form > input:-ms-input-placeholder {
  font-size: 1.1em;
  color: #999;
}

.text-chat-box > form > input:input-placeholder {
  font-size: 1.1em;
  color: #999;
}

/* turn the visible border blue as a visual indicator of focus */
.text-chat-box > form > input:focus {
  border-top: 1px solid #66c9f2;
}

/* e.g. very narrow widths similar to conversation window.
   Note: on some displays (e.g. windows / medium size) the width
   may be very slightly over the expected width, so we add on 2px
   just in case. */
@media screen and (max-width:352px) {
  .text-chat-view {
    display: flex;
    flex-flow: column nowrap;
    /* 60px min-height of .text-chat-entries plus 40px of .text-chat-box */
    min-height: 100px;
    height: auto;
    /* Let the view be the minimum size it needs to be - don't flex to take up
       more. */
    flex: 0 0 auto !important;
  }

  .text-chat-entries {
    flex: 1 1 auto;
    min-height: 60px;
  }

  .text-chat-view.text-chat-disabled {
    /* When we don't have text chat enabled, limit the view to the same height
       as the entries, to avoid unnecessary whitespace */
    max-height: 120px;
  }

  .text-chat-entries-empty.text-chat-disabled {
    display: none;
  }

  /* When the text chat entries are not present, then hide the entries view
     and just show the chat box. */
  .text-chat-entries-empty {
    max-height: 40px;
    min-height: 40px;
  }

  .text-chat-entries-empty > .text-chat-entries {
    display: none;
  }
}

.self-view-hidden-message {
  /* Not displayed by default; display is turned on elsewhere when the
   * self-view is actually hidden.
   */
  display: none;
}

/* Avoid the privacy problem where a user can size the window so small that
 * part of the self view is not shown.  If the self view isn't completely
 * displayable...
 */
@media screen and (max-height:160px) {

  /* disable the self view */
  .standalone .local-video {
    display: none;
  }

  /* and enable a message telling the user how to get it back */
  .standalone .self-view-hidden-message {
    display: inline;
    position: relative;
    top: 90px;
  }
}

/* Make sure the loading spinner always gets the same background */
.loading-background {
  background: black;
  position: relative;
  width: 100%;
  height: 100%;
}
