/* 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;
}

body {
  background: none;
}

/* Beta Ribbon */
.beta-ribbon {
  background: url("../../shared/img/beta-ribbon.svg") no-repeat;
  background-size: 30px;
  width: 30px;
  height: 30px;
}

/* Panel styles */

.panel {
  /* hide the extra margin space that the panel resizer now wants to show */
  overflow: hidden;
  font: menu;
  background-color: #fbfbfb;
  height: 410px;
  width: 330px;
}

/* Panel container flexbox */
.panel-content {
  height: 410px;
  width: 330px;
  display: flex;
  flex-flow: column nowrap;
  align-items: flex-start;
}

.panel-content > .beta-ribbon {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
}

/* Notifications displayed over tabs */

.panel .messages {
  width: 100%;
  margin: 0;
}

.panel .messages .alert {
  margin: 0;
}

/* Sign-in request view */

.sign-in-request {
  text-align: center;
  vertical-align: middle;
  margin: 2em 0;
}

.sign-in-request > h1 {
  font-size: 1.7em;
  margin-bottom: .2em;
}

.sign-in-request > h2,
.sign-in-request > a {
  font-size: 1.2em;
}

.sign-in-request > a {
  cursor: pointer;
  color: #0295df;
}

.sign-in-request > a:hover:active {
  text-decoration: underline;
}

.sign-in-request-button {
  font-size: 1rem;
  margin: 1rem;
  width: 80%;
  padding: .5rem 1rem;
  border-radius: 3px;
}

/* Content area and input fields */

.content-area {
  padding: .5rem 1rem;
}

.content-area header {
  font-weight: 700;
}

/* Need to remove when these rules when the Beta tag is removed */
#share-link-header {
  -moz-padding-start: 20px;
}

.fte-get-started-container + .generate-url > #share-link-header {
  /* The header shouldn't be indented if the tabs are present. */
  -moz-padding-start: 0;
}

.content-area label {
  display: block;
  width: 100%;
  margin-top: 10px;
  font-size: 1rem;
  color: #777;
}

.content-area input {
  display: block;
  width: 100%;
  outline: none;
  border-radius: 4px;
  margin: 10px 0;
  border: 1px solid #c3c3c3;
  height: 2.6rem;
  padding: 0 6px;
  font-size: 1.1rem;
  color: #4a4a4a;
  box-shadow: none;
}

.content-area input::-moz-placeholder {
  color: #999;
}

.content-area input:not(.pristine):invalid {
  border: 0.1rem solid #d13f1a;
}

.content-area input:focus {
  border: 0.1rem solid #5cccee;
}

/* Rooms CSS */

.no-conversations-message {
  /* example of vertical aligning a container in an element see:
     http://zerosixthree.se/vertical-align-anything-with-just-3-lines-of-css/ */
  text-align: center;
  color: #4a4a4a;
  font-weight: lighter;
  position: relative;
  top: 50%;
  transform: translateY(-50%);
  padding-top: 11rem;
  padding-bottom: 1rem;
  background-image: url("../../shared/img/empty_conversations.svg");
  background-repeat: no-repeat;
  background-position: top center;
}

.panel-text-medium,
.panel-text-large {
  margin: 3px 0;
}

.panel-text-medium {
  font-size: 1.6rem;
}

.panel-text-large {
  font-size: 2.2rem;
}

.room-list-loading {
  position: relative;
  text-align: center;
  /* makes sure that buttons are anchored above footer */
  flex: 1;
}

.room-list-loading > img {
  width: 66px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}


/* Rooms */
.rooms {
  flex: 1;
  display: flex;
  flex-flow: column nowrap;
  width: 100%;
}

.rooms > h1 {
  color: #666;
  font-size: 1rem;
  padding: .5rem 0;
  height: 3rem;
  line-height: 3rem;
  margin: 0 15px;
}

.new-room-view {
  border-bottom: 1px solid #d8d8d8;
  display: flex;
  flex-direction: column;
}

.new-room-view > .btn {
  border-radius: 5px;
  font-size: 1.2rem;
  font-weight: bold;
  margin: 1.5rem;
  padding: 1rem;
}

.new-room-view > .stop-sharing-button {
  background-color: #d13f1a;
  border-color: #d13f1a;
}

.new-room-view > .stop-sharing-button:hover {
  background-color: #ef6745;
  border-color: #ef6745;
}

.room-list {
  /* xxx  not sure why flex needs the 3 value setting
    but setting flex to just 1, the whole tab including the new room is scrollable.
    seems to not like the 0% of the default setting - may be FF bug */
  flex: 1 1 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-flow: column nowrap;
  width: 100%;
}

.room-list-empty {
  border-bottom-width: 0;
  flex: 1;
  /* the child no-conversations-message is vertical aligned inside this container
    see: http://zerosixthree.se/vertical-align-anything-with-just-3-lines-of-css/
    stops blurring from decimal pixels being rendered - pixel rounding */
  transform-style: preserve-3d;
}

.room-list > .room-entry {
  padding: .2rem 15px;
  /* Always show the default pointer, even over the text part of the entry. */
  cursor: default;
}

.room-list > .room-entry > h2 {
  display: inline-block;
  vertical-align: middle;
  /* See .room-entry-context-item for the margin/size reductions.
   * An extra 16px to make space for the edit button. */
  width: calc(100% - 1rem - 32px);

  font-size: 1.3rem;
  line-height: 2.4rem;
  color: #000;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.room-list > .room-entry.room-active:not(.room-opened) > h2 {
  font-weight: bold;
}

.room-list > .room-entry:not(.room-opened):hover {
  background: #dbf7ff;
}

.room-list > .room-entry > p {
  margin: 0;
  padding: .2rem 0;
}

.room-list > .room-entry > p > a {
  color: #777;
  opacity: .5;
  transition: opacity .1s ease-in-out 0s;
  text-decoration: none;
}

.room-list > .room-entry > p > a:hover {
  opacity: 1;
  text-decoration: underline;
}

@keyframes drop-and-fade-in {
  0%   {opacity: 0; top: -15px;}
  25%  {opacity: 0; top: -15px;}
  100% {opacity: 1; top: 0;}
}

.room-list > .room-entry > h2 > button {
  display: inline-block;
  position: relative;
  width: 24px;
  height: 24px;
  border: none;
  margin: .1em; /* relative to _this_ line's font, not the document's */
  -moz-margin-start: .5em;
  background-color: transparent;  /* override browser default for button tags */
  top: -15px;
}

.room-list > .room-entry:hover > h2 > button {
  animation: drop-and-fade-in 0.250s;
  animation-fill-mode: forwards;
}

.room-list > .room-entry:hover > h2 > .copy-link {
  background-image: url(../../shared/img/icons-16x16.svg#copy);
}

.room-list > .room-entry:hover > h2 > .delete-link {
  background-image: url(../../shared/img/icons-16x16.svg#trash);
}

/* scale this up to 1.1x and then back to the original size */
@keyframes pulse {
  0%, 100% { transform: scale(1.0); }
  50%      { transform: scale(1.1); }
}

.room-list > .room-entry > h2 > .copy-link.checked {
  background: transparent url(../../shared/img/icons-16x16.svg#checkmark);
  animation: pulse .150s;
  animation-timing-function: ease-in-out;
  top: 0;
}

/* keep the various room-entry row pieces aligned with each other */
.room-list > .room-entry > h2 > button,
.room-list > .room-entry > h2 > span {
  vertical-align: middle;
}

/* Room entry context button (edit button) */
.room-entry-context-actions {
  display: none;
  vertical-align: top;
}

.room-entry:hover .room-entry-context-actions {
  display: inline-block;
}

/* Room entry edit button */
.room-entry-context-edit-btn {
  background-image: url("../../shared/img/icons-10x10.svg#edit-darkgrey");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 12px;
  cursor: pointer;
  display: inline-block;
  height: 24px;
  vertical-align: middle;
  width: 16px;
}

html[dir="rtl"] .room-entry-context-actions > .dropdown-menu {
  right: auto;
  left: 21px;
}

.room-entry-context-actions > .dropdown-menu {
  right: 21px;
  bottom: auto;
  left: auto;
  z-index: 1;
}

/* Keep ".room-list > .room-entry > h2" in sync with these. */
.room-entry-context-item {
  display: inline-block;
  -moz-margin-end: 1rem;
  vertical-align: middle;
}

.room-entry-context-item > img,
.room-entry-context-item > a > img {
  width: 16px;
}

.button-close {
  background-color: transparent;
  background-image: url(../../shared/img/icons-10x10.svg#close);
  background-repeat: no-repeat;
  background-size: 8px 8px;
  border: none;
  padding: 0;
  height: 8px;
  width: 8px;
}

.button-close:hover,
.button-close:hover:active {
  background-color: transparent;
  border: none;
}

/* Spinner */

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

.spinner {
  width: 16px;
  height: 16px;
  background-repeat: no-repeat;
  background-size: 16px 16px;
}

.spinner.busy {
  background-image: url(../../shared/img/spinner.png);
  animation-name: spinnerRotate;
  animation-duration: 1s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@media (min-resolution: 2dppx) {
  .spinner.busy {
    background-image: url(../../shared/img/spinner@2x.png);
  }
}

/* Share tab */

.generate-url-stack {
  margin: 14px 0;
  position: relative;
}

.generate-url-input {
  outline: 0;
  border: 1px solid #ccc; /* Overriding background style for a text input (see
                             below) resets its borders to a weird beveled style;
                             defining a default 1px border solves the issue. */
  border-radius: 2px;
  height: 26px;
  padding: 0 10px;
  font-size: 1em;
}

.generate-url-spinner {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  top: 4px;
  left: auto;
  right: 4px;
}

html[dir="rtl"] .generate-url-spinner {
  left: 4px;
  right: auto;
}

.generate-url .button {
  background-color: #00a9dc;
  border-color: #0096dd;
  color: #fff;
}

.generate-url .button:hover {
  background-color: #008acb;
  border-color: #008acb;
}

#powered-by,
.terms-service {
  color: #4a4a4a;
  font-size: 1.2rem;
}

#powered-by {
  border-top: 1px solid #ccc;
  padding-top: 1.5rem;
  text-align: center;
  margin-top: 0;
}

#powered-by-logo {
  display: inline-block;
  margin-left: 10px;
  margin-right: 10px;
  vertical-align: middle;
  background-image: url("../../shared/img/telefonica-logo.svg");
  width: 84px;
  height: 23px;
  background-repeat: no-repeat;
}

#powered-by-logo.en-GB,
#powered-by-logo.de {
  background-image: url("../../shared/img/02.png");
  background-size: 21px 20px;
  width: 21px;
  height: 20px;
}

#powered-by-logo.pt-BR {
  background-image: url("../../shared/img/vivo.png");
  background-size: 53px 26px;
  width: 53px;
  height: 26px;
}

#powered-by-logo[class^="es-"] {
  background-image: url("../../shared/img/movistar.png");
  background-size: 92px 20px;
  width: 92px;
  height: 20px;
}

@media (min-resolution: 2dppx) {
  #powered-by-logo.en-GB,
  #powered-by-logo.de {
    background-image: url("../../shared/img/02@2x.png");
  }

  #powered-by-logo.pt-BR {
    background-image: url("../../shared/img/vivo@2x.png");
  }

  #powered-by-logo[class^="es-"] {
    background-image: url("../../shared/img/movistar@2x.png");
  }
}

.terms-service {
  padding-left: 5rem;
  padding-right: 5rem;
  padding-bottom: 1rem;
  text-align: center;
}

.terms-service > a {
  color: #00a9dc;
  text-decoration: none;
}

/* Status badges -- Available/Unavailable */
.status {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 5px;
  border-radius: 50%;
}

/* Sign in/up link */

.signin-link {
  flex: 2 1 auto;
  margin: 0;
  text-align: right;
}

.signin-link > a {
  font-weight: 500;
  text-decoration: none;
  color: #00A9DC;
}

/* Settings (gear) menu */

.button-settings {
  width: 10px;
  height: 10px;
  margin: 0;
  padding: 0;
  border: none;
  cursor: pointer;
  vertical-align: middle;
  background: transparent url("../../shared/img/icons-10x10.svg#settings-cog");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  -moz-margin-start: .5em;
}

.user-details .dropdown-menu {
  bottom: 1.3rem; /* Just above the text. */
  left: -5px; /* Compensate for button padding. */
}

html[dir="rtl"] .user-details .dropdown-menu {
  right: -5px;
}

.settings-menu .dropdown-menu {
  /* The panel can't have dropdown menu overflowing its iframe boudaries;
     let's anchor it from the bottom-right, while resetting the top & left values
     set by .dropdown-menu */
  top: auto;
  left: auto;
  bottom: 1.1em;
  right: 14px;
}

.entries-divider {
  border-left: 0;
  border-right: 0;
  border-bottom: solid 1px #d8d8d8;
}

html[dir="rtl"] .settings-menu .dropdown-menu {
  /* This is specified separately rather than using -moz-margin-start etc, as
     we need to override .dropdown-menu's values which can't use the gecko
     specific extensions. */
  left: 14px;
  right: auto;
}

/* Footer */

.footer {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-content: stretch;
  align-items: center;
  font-size: 1rem;
  color: #666666;
  padding: 10px 15px 6px 15px;
  width: 100%;
  height: 42px;
}

.footer .signin-details {
  align-items: center;
  display: flex;
}

.footer .user-identity {
  color: #000;
  font-weight: bold;
  margin: 0;
}

/* First time use */

.fte-get-started-content {
  /* Manual vertical centering */
  flex: 1;
  padding: 2rem 0 0;
  display: flex;
  flex-direction: column;
}

.fte-title {
  margin: 0 20px;
}

.fte-title > img {
  width: 100%;
}

img.fte-logo {
  height: 32px;
}

.fte-subheader, .fte-content {
  font-size: 1.6rem;
  text-align: center;
  margin: 2rem auto;
  color: #4a4a4a;
  line-height: 2.4rem;
}

.fte-content {
  font-size: 1.5rem;
  font-weight: 500;
  color: #9a9a9a;
}

.fte-separator {
  /* Constrain separator width with magic number. */
  width: 164px;
  border: solid #c5c5c5 1px;
  height: 1px;
  margin: 0 auto;
}

img.fte-hello-web-share {
  /* Set custom SVG size and position to align with powered-by-wrapper element. */
  width: 290px;
  height: 148px;
  margin-bottom: -4px;
}

.fte-get-started-content + .powered-by-wrapper {
  width: 100%;
  background: #ebebeb;
}

.fte-get-started-content + .powered-by-wrapper > #powered-by {
  border: none;
}

.fte-get-started-container {
  height: 410px;
  width: 330px;
  display: flex;
  flex-flow: column nowrap;
  background: #fbfbfb;
}

.fte-button-container {
  border-top: 1px solid #ccc;
  padding: 8px 8px 0;
  background: #ebebeb;
  display: flex;
  flex-direction: column;
}

.fte-get-started-button {
  border: none;
  color: #fff;
  background-color: #00a9dc;
  line-height: 43px;
  margin: 10px;
  padding: 0;
  border-radius: 4px;
  font-size: 1.4rem;
  font-weight: bold;
}

.fte-get-started-button:hover,
.fte-get-started-button:focus,
.fte-get-started-button:active {
  background-color: #5cccee;
  color: #fff;
}

/* E10s not supported */

.error-content {
  /* Manual vertical centering */
  flex: 1;
  padding: 3.5rem 0 1.5rem 0;
  display: flex;
  flex-direction: column;
}

.error-title {
  margin: 0 15px;
  text-align: center;
}

.error-title > img {
  width: 72px;
}

.error-subheader {
  text-align: center;
  font-size: 1.6rem;
  margin: 2.5rem 0;
  color: #4a4a4a;
  line-height: 2.2rem;
}

.e10s-not-supported-button {
  border: none;
  color: #fff;
  background-color: #00a9dc;
  line-height: 43px;
  margin: 0 15px;
  padding: 0;
  border-radius: 4px;
  font-size: 1.4rem;
  font-weight: bold;
}

.e10s-not-supported-button:hover,
.e10s-not-supported-button:focus,
.e10s-not-supported-button:active {
  background-color: #5cccee;
  color: #fff;
}
