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

body {
  background: none;
}

/* Panel styles */

.panel {
  /* hide the extra margin space that the panel resizer now wants to show */
  overflow: hidden;
}

/* Notifications displayed over tabs */

.panel .messages {
  margin: 0;
}

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

/* Tabs and tab selection buttons */

.tab-view-container {
  background-image: url("../img/beta-ribbon.svg#beta-ribbon");
  background-size: 36px 36px;
  background-repeat: no-repeat;
}

.tab-view {
  display: flex;
  flex-direction: row;
  padding: 10px 0;
  border-bottom: 1px solid #ccc;
  color: #000;
  border-top-right-radius: 2px;
  border-top-left-radius: 2px;
  list-style: none;
}

.tab-view > li {
  flex: 1;
  text-align: center;
  color: #ccc;
  -moz-border-end: 1px solid #ccc;
  padding: 0 10px;
  height: 16px;
  cursor: pointer;
  background-repeat: no-repeat;
  background-size: 16px 16px;
  background-position: center;
}

.tab-view > li:last-child {
  -moz-border-end-style: none;
}

.tab-view > li[data-tab-name="call"],
.tab-view > li[data-tab-name="rooms"] {
  background-image: url("../img/icons-16x16.svg#precall");
}

.tab-view > li[data-tab-name="call"]:hover,
.tab-view > li[data-tab-name="rooms"]:hover {
  background-image: url("../img/icons-16x16.svg#precall-hover");
}

.tab-view > li[data-tab-name="call"].selected,
.tab-view > li[data-tab-name="rooms"].selected {
  background-image: url("../img/icons-16x16.svg#precall-active");
}

.tab-view > li[data-tab-name="contacts"] {
  background-image: url("../img/icons-16x16.svg#contacts");
}

.tab-view > li[data-tab-name="contacts"]:hover {
  background-image: url("../img/icons-16x16.svg#contacts-hover");
}

.tab-view > li[data-tab-name="contacts"].selected {
  background-image: url("../img/icons-16x16.svg#contacts-active");
}

.tab {
  display: none;
}

.tab.selected {
  display: block;
}

/* Content area and input fields */

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

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

#fte-getstarted {
  padding-top: .5rem;
  padding-bottom: .5rem;
}

#fte-title {
  text-align: center;
  margin-bottom: .5rem;
}

#fte-button {
  width: 50%;
  display: block;
  margin-left: auto;
  margin-right: auto;
  font-size: 1rem;
  padding: .5rem 1rem;
  height: auto; /* Needed to override .button's height:26px; */
}

#fte-getstarted + #powered-by-wrapper {
  position: absolute;
  bottom: 0;
}

/* Need to remove when these rules when the Beta tag is removed */
#share-link-header {
  -moz-padding-start: 20px;
}
#fte-getstarted + .generate-url > #share-link-header,
.tab-view + .tab .content-area > .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: 10px;
  color: #777;
}

.content-area input {
  display: block;
  width: 100%;
  outline: none;
  border-radius: 2px;
  margin: 5px 0;
  border: 1px solid #ccc;
  height: 24px;
  padding: 0 10px;
}

.content-area input:invalid {
  box-shadow: none;
}

.content-area input:not(.pristine):invalid {
  border-color: #d74345;
  box-shadow: 0 0 4px #c43c3e;
}

/* Rooms */
.rooms {
  min-height: 100px;
}

.rooms > h1 {
  font-weight: bold;
  color: #999;
  padding: .5rem 1rem;
}

.rooms > p {
  padding: .5rem 0;
  margin: 0;
}

.rooms > p > .btn {
  display: block;
  font-size: 1rem;
  margin: 0 auto;
  padding: .5rem 1rem;
  border-radius: 3px;
}

.room-list {
  max-height: 335px; /* XXX better computation needed */
  overflow: auto;
  border-top: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
}

.room-list:empty {
  border-bottom-width: 0;
}

.room-list > .room-entry {
  padding: .5rem 1rem;
  cursor: pointer;
}

.room-list > .room-entry > h2 {
  display: inline-block;
  font-size: .85rem;
  color: #777;
}

.room-list > .room-entry.room-active > h2 {
  font-weight: bold;
  color: #000;
}

.room-list > .room-entry > h2 > .room-notification {
  display: none;
  background: #00a0ec;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: .3rem;
}

.room-list > .room-entry.room-active > h2 > .room-notification {
  display: inline-block;
}

.room-list > .room-entry:hover {
  background: #f1f1f1;
}

.room-list > .room-entry:not(:last-child) {
  border-bottom: 1px solid #ccc;
}

.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: 0px;}
}

.room-list > .room-entry > h2 > button {
  display: inline-block;
  position: relative;
  width: 24px;
  height: 24px;
  border: none;
  margin: .1em .1em .1em .5em; /* relative to _this_ line's font, not the document's */
  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;
  cursor: pointer;
}

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

.room-list > .room-entry:hover > h2 > .delete-link {
  background-image: url(../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(../img/icons-16x16.svg#checkmark);
  animation: pulse .150s;
  animation-timing-function: ease-in-out;
  top: 0px;
}

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

/* Edit in place */

.room-list > .room-entry > h2 > .edit-in-place {
  cursor: text;
}

.room-list > .room-entry > h2 > .edit-in-place:hover {
  background: #fefbc4;
}

.room-list > .room-entry > h2 > form {
  display: inline-block;
}

.room-list > .room-entry > h2 > form > input {
  border: none;
  background: #fefbc4;
  font-size: 13.6px;
  padding: 0;
}

/* Buttons */

.button-group {
  display: flex;
  flex-direction: row;
  width: 100%;
}

.button-group > .button {
  flex: 1;
  margin: 0 7px;
}

.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: 1px solid #c1c1c1;
  border-radius: 2px;
  height: 26px;
  font-size: 12px;
}

.button > .button-caption {
  vertical-align: middle;
}

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

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

.button.button-accept {
  background-color: #5bc0a4;
  border-color: #5bc0a4;
  color: #fff;
}

.button.button-accept:hover {
  background-color: #47b396;
  border-color: #47b396;
  color: #fff;
}

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

/* Dropdown menu */

.dropdown {
  position: relative;
}

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

body[dir=rtl] .dropdown-menu-item {
  left: auto;
  right: 10px;
}

.dropdown-menu-item {
  text-align: start;
  margin: .3em 0;
  padding: .2em .5em;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 1em;
  white-space: nowrap;
}

.dropdown-menu-item:hover {
  border: 1px solid #ccc;
  background-color: #eee;
}

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

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

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

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

#powered-by,
.terms-service {
  color: #888;
  font-size: .9em;
}

#powered-by {
  border-top: 1px solid #ccc;
  padding-top: .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("../img/telefonica.png");
  background-size: 72px 20px;
  width: 72px;
  height: 20px;
}

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

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

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

@media (min-resolution: 2dppx) {
  #powered-by-logo {
    background-image: url("../img/telefonica@2x.png");
  }

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

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

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

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

.terms-service > a {
  color: #00caee;
}

/* DnD menu */

.dnd-status {
  border: 1px solid transparent;
  padding: 2px 4px;
  margin: 0;
  /* Undo the start border + padding so that unhovered dnd-status is aligned
     as if there was no additional spacing. */
  -moz-margin-start: calc(-1px + -4px);
  font-size: .9em;
  cursor: pointer;
  border-radius: 3px;
}

.dnd-status:hover {
  border-color: #ddd;
  background-color: #f1f1f1;
}

/* Status badges -- Available/Unavailable */

.status {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 5px;
  border-radius: 50%;
}

.status-available {
  background-color: #6cb23e;
}

.status-dnd {
  border: 1px solid #888;
}

/* Sign in/up link */

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

.signin-link a {
  font-size: .9em;
  text-decoration: none;
  color: #888;
}

.footer-signin-separator {
  border-right: 1px solid #aaa;
  height: 16px;
  margin: 0 1em;
}

/* Settings (gear) menu */

.button-settings {
  display: inline-block;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: none;
  background-color: #a5a;
  color: #fff;
  text-align: center;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .9em;
  cursor: pointer;
  background: transparent url(../img/svg/glyph-settings-16x16.svg) no-repeat center center;
  background-size: contain;
  width: 12px;
  height: 12px;
}

.footer .button-settings {
  opacity: .6;      /* used to "grey" the icon a little */
}

.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: -8px;
  right: 14px;
}

.settings-menu .icon {
  display: inline-block;
  background-size: contain;
  width: 12px;
  height: 12px;
  margin-right: 1em;
}

.settings-menu .icon-settings {
  background: transparent url(../img/svg/glyph-settings-16x16.svg) no-repeat center center;
}

.settings-menu .icon-account {
  background: transparent url(../img/svg/glyph-account-16x16.svg) no-repeat center center;
}

.settings-menu .icon-signin {
  background: transparent url(../img/svg/glyph-signin-16x16.svg) no-repeat center center;
}

.settings-menu .icon-signout {
  background: transparent url(../img/svg/glyph-signout-16x16.svg) no-repeat center center;
}

.settings-menu .icon-help {
  background: transparent url(../img/svg/glyph-help-16x16.svg) no-repeat center center;
}

/* Footer */

.footer {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-content: stretch;
  align-items: center;
  font-size: 1em;
  border-top: 1px solid #D1D1D1;
  background-color: #eaeaea;
  color: #7f7f7f;
  padding: .5rem 1rem;
}

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

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