/* 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/. */

/* Generic rules */

/**
 * "Fixes" the Box Model.
 * @see http://www.paulirish.com/2012/box-sizing-border-box-ftw/
 */
*, *:before, *:after {
  box-sizing: border-box;
}

body {
  font: message-box;
  font-size: 12px;
  background: #fbfbfb;
  overflow: hidden;
}

img {
  border: none;
}

h1, h2, h3 {
  color: #666;
}

/* choose a sane default for paragraphs, since reset.css' 0px is not what we want */
p {
  margin: 1em 0;
}

/* Helpers */

/**
 * Clearfix impl. for modern browsers
 * 1. The space content is one way to avoid an Opera bug when the
 *    contenteditable attribute is included anywhere else in the document.
 *    Otherwise it causes space to appear at the top and bottom of elements
 *    that are clearfixed.
 * 2. The use of `table` rather than `block` is only necessary if using
 *    `:before` to contain the top-margins of child elements.
 */
.cf:before,
.cf:after {
  display: table; /* 1 */
  content: " ";   /* 2 */
}

.cf:after {
  clear: both;
}

.hide {
  /**
   * Force the display: none as it can conflict with other display.
   * You usually want to avoid !important statements as much as
   * possible. In this case, it makes sense as it's unlikely we want a
   * class to undo the hide feature.
   */
  display: none !important;
}

.visually-hidden {
  visibility: hidden;
}

.tc {
  text-align: center;
}

.full-width {
  width: 100%;
}

/* Buttons */

.button-group {
  display: flex;
  flex-direction: row;
  width: 100%;
  padding-top: 6px;
}

.button-group > .button {
  flex: 1;
  margin: 0 5px;
  min-height: 3rem;
  font-size: 1.2rem;
  line-height: 1rem;
  font-weight: 300;
  border-radius: 4px;
}

.button-group > .button:first-child {
  -moz-margin-start: 0;
}

.button-group > .button:last-child {
  -moz-margin-end: 0;
}

.button {
  padding: 2px 5px;
  background-color: #fbfbfb;
  color: #333;
  border-radius: 2px;
  min-height: 26px;
  font-size: 1.2rem;
  line-height: 1.2rem;
  border: none;
}

.button:hover {
  background-color: #ebebeb;
}

.button:active {
  background-color: #ccc;
  color: #fff;
}

.button.button-accept {
  background-color: #00a9dc;
  color: #fff;
}

.button.button-accept:hover,
.button.button-accept:hover:active {
  background-color: #5cccee;
  color: #fff;
}

.button.button-cancel {
  background-color: #ebebeb;
  border: 0;
  color: #000;
}

.button.button-cancel:hover,
.button.button-cancel:hover:active {
  background-color: #dcd6d6;
  color: #000;
}

.button.button-cancel:disabled {
  background-color: #ebebeb;
  color: #c3c3c3;
}

.button.button-accept:active {
  background-color: #3aa689;
  border-color: #3aa689;
  color: #fff;
}

/* A reset for all button-appearing elements, with the lowest-common
 * denominator of the needed rules.  Intended to be used as a base class
 * together with .btn-*
 */

.btn {
  display: inline-block;
  margin: 0;
  padding: 0;
  border: none;
  background: #a5a;
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-size: .9em;
  cursor: pointer;
}

.btn.btn-constrained {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-info {
  background-color: #00a9dc;
  border: 1px solid #00a9dc;
  color: #fff;
}

  .btn-info:hover {
    background-color: #5cccee;
    border: 1px solid #5cccee;
  }

  .btn-info:active {
    background-color: #5cccee;
    border: 1px solid #5cccee;
  }

.btn-accept,
.btn-success {
  background-color: #56b397;
  border: 1px solid #56b397;
}

  .btn-accept:hover,
  .btn-success:hover {
    background-color: #50e3c2;
    border: 1px solid #50e3c2;
  }

  .btn-accept:active,
  .btn-success:active {
    background-color: #3aa689;
    border: 1px solid #3aa689;
  }

.btn-warning {
  background-color: #f0ad4e;
}

.btn-error,
.btn-hangup {
  background-color: #d74345;
  border: 1px solid #d74345;
}

  .btn-error:hover,
  .btn-hangup:hover {
    background-color: #c53436;
    border-color: #c53436;
  }

  .btn-error:active,
  .btn-hangup:active {
    background-color: #ae2325;
    border-color: #ae2325;
  }

.disabled, button[disabled] {
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.65;
}

.btn-group {
  display: flex;
  align-content: space-between;
  justify-content: center;
}

/* Alerts/Notifications */
.notificationContainer {
  border-bottom: 2px solid #E9E9E9;
}

.messages > .notificationContainer > .alert {
  text-align: center;
}

.notificationContainer > .detailsBar,
.alert {
  background: #eee;
  padding: .4em 1em;
}

.alert p.message {
  padding: 0;
  margin: 0;
}

.alert-error {
  background: repeating-linear-gradient(-45deg, #D74345, #D74345 10px, #D94B4D 10px, #D94B4D 20px) repeat scroll 0% 0% transparent;
  color: #fff;
}

.alert-warning {
  background: #fcf8e3;
  border: 1px solid #fbeed5;
}

.alert-success {
  background: #5BC0A4;
  border: 1px solid #5BC0A4;
  color: #fff;
}

.notificationContainer > .details-error {
  background: #fbebeb;
  color: #d74345
}

.notificationContainer > .details-error > .detailsButton {
  float: right;
  -moz-margin-start: 1em; /* Match .detailsBar padding */
}

.alert .close {
  position: relative;
  top: -.1rem;
  right: -1rem;
}

/* Misc */

.call-url,
.standalone-call-btn-text {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.close {
  float: right;
  font-size: 1rem;
  font-weight: bold;
  line-height: 1rem;
  color: #000;
  opacity: .4;
  background: none;
  border: none;
  cursor: pointer;
}

  .close:hover {
    opacity: .6;
  }

.close:before {
  /* \2716 is unicode representation of the close button icon */
  content: '\2716';
}

/* Transitions */
.fade-out {
  transition: opacity 0.5s ease-in;
  opacity: 0;
}

.icon,
.icon-small {
  background-size: 20px;
  background-repeat: no-repeat;
  vertical-align: top;
  background-position: 80% center;
}

.pseudo-icon:before {
  content: "";
  display: inline-block;
  background-repeat: no-repeat;
  width: 14px;
  height: 14px;
  vertical-align: top;
  margin: 0 .7rem;
}

.icon-small {
  background-size: 10px;
}

/*
 * Platform specific styles
 * The UI should match the user OS
 * Specific font sizes for text paragraphs to match
 * the interface on that platform.
 */

.inverse {
  color: #fff;
}

.light {
  color: rgba(51, 51, 51, .5);
}

/* Web panel */

.info-panel {
  border-radius: 4px;
  background: #fff;
  padding: 20px 0;
  border: 1px solid #e7e7e7;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .03);
  margin: 2rem 0;
}

.info-panel h1 {
  font-size: 1.2em;
  font-weight: 700;
  padding: 20px 0;
  text-align: center;
}

.info-panel h4 {
  color: #aaa;
  text-align: center;
  font-weight: 500;
  font-size: 1.2em;
  margin: 0;
}

/* Logos */

.firefox-logo {
  margin: 0 auto; /* horizontal block centering */
  width: 100px;
  height: 100px;
  background: transparent url(../img/firefox-logo.png) no-repeat center center;
  background-size: contain;
}

/* Dropdown menu */

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  bottom: 0;
  left: 0;
  background-color: #fbfbfb;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
  list-style: none;
  border-radius: 2px;
}

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

.dropdown-menu-item {
  width: 100%;
  text-align: start;
  padding: .3rem .8rem;
  cursor: pointer;
  border: 1px solid transparent;
  font-size: 1.2rem;
  line-height: 22px;
  white-space: nowrap;
  color: #4a4a4a;
}

.dropdown-menu-item:first-child {
  padding-top: .5rem;
}

.dropdown-menu-item:last-child {
  padding-bottom: .5rem;
}

.dropdown-menu-item:first-child:hover {
  border-top-right-radius: 2px;
  border-top-left-radius: 2px;
}

.dropdown-menu-item:last-child {
  border-bottom-right-radius: 2px;
  border-bottom-left-radius: 2px;
}

.dropdown-menu-item:hover {
  background-color: #dbf7ff;
}

.dropdown-menu-separator {
  height: 1px;
  margin: 2px -2px 1px -2px;
  border-top: 1px solid #dedede;
  background-color: #fff;
}

/* Custom checkbox */

.checkbox-wrapper {
  -moz-user-select: none;
  user-select: none;
}

.checkbox {
  float: left;
  width: 2rem;
  height: 2rem;
  -moz-margin-end: .5em;
  margin-top: .1em;
  border: 1px solid #999;
  border-radius: 3px;
  cursor: pointer;
  background-color: transparent;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: 1em 1em;
}

html[dir="rtl"] .checkbox {
  float: right;
}

.checkbox.checked {
  background-image: url("../img/check.svg#check");
}

.checkbox.checked:hover,
.checkbox.checked:hover:active {
  background-image: url("../img/check.svg#check-active");
}

.checkbox.disabled {
  border: 1px solid #909090;
}

.checkbox.checked.disabled {
  background-image: url("../img/check.svg#check-disabled");
}

.checkbox-label.ellipsis {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  text-align: left;
}

html[dir="rtl"] .checkbox-label.ellipsis {
  text-align: right;
}

/* ContextUrlView classes */

.context-content {
  color: black;
  text-align: left;
}

html[dir="rtl"] .context-content {
  text-align: right;
}

.context-content > p {
  font-weight: bold;
  margin-bottom: .8em;
  margin-top: 0;
}

.context-wrapper {
  border: 2px solid #ebebeb;
  border-radius: 4px;
  background: #fafafa;
  padding: 1.1rem .8rem;
  /* Use the flex row mode to position the elements next to each other. */
  display: flex;
  flex-flow: row nowrap;
  /* No underline for the text in the context view. */
  text-decoration: none;
}

.context-wrapper > .context-preview {
  float: left;
  /* 16px is standard height/width for a favicon */
  width: 16px;
  max-height: 16px;
  margin-right: .8em;
  flex: 0 0 auto;
}

html[dir="rtl"] .context-wrapper > .context-preview {
  float: left;
  margin-left: .8em;
  margin-right: 0;
}

.context-wrapper > .context-info {
  flex: 0 1 auto;
  display: block;
  color: black;
  /* 16px for the preview, plus its .8em margin */
  max-width: calc(100% - 16px - .8em);
  word-wrap: break-word;
}

.context-wrapper > .context-info > .context-url {
  display: block;
  color: #00a9dc;
  font-weight: 700;
  clear: both;
}

/* Only underline the url, not the associated text */
.clicks-allowed.context-wrapper:hover > .context-info > .context-url {
  text-decoration: underline;
}

.remote-video-box {
  height: 100%;
  width: 100%;
}

.remote-video-box > .remote-cursor {
  background: url('../img/cursor.svg#orange') no-repeat;
  height: 20px;
  /* Svg cursor has a white outline so we need to offset it to ensure that the
   * cursor points at a more precise position with the negative margin. */
  margin: -2px;
  position: absolute;
  width: 15px;
  z-index: 65534;
}
