/* 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/. */
#onboarding-overlay * {
  box-sizing: border-box;
}

#onboarding-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* Ensuring we can put the overlay over elements using
     z-index on original page */
  z-index: 20999;
  color: #4d4d4d;
  background: rgb(54, 57, 89, 0.8); /* #363959, 0.8 opacity */
  display: none;
}

#onboarding-overlay.onboarding-opened {
  display: block;
}

#onboarding-overlay-button {
  padding: 10px 0 0 0;
  position: fixed;
  cursor: pointer;
  top: 4px;
  offset-inline-start: 12px;
  border: none;
  /* Set to none so no grey contrast background in the high-contrast mode */
  background: none;
  /* make sure the icon stay above the activity-stream searchbar */
  /* We want this always under #onboarding-overlay */
  z-index: 10;
}

/* Keyboard focus styling */
#onboarding-overlay-button:-moz-focusring {
  outline: solid 2px rgba(0, 0, 0, 0.1);
  -moz-outline-radius: 5px;
  outline-offset: 5px;
  transition: outline-offset 150ms;
}

#onboarding-overlay-button > img {
  width: 32px;
  vertical-align: top;
}

#onboarding-overlay-button::after {
  content: " ";
  border-radius: 50%;
  margin-top: -1px;
  margin-inline-start: -13px;
  border: 2px solid #f2f2f2;
  background: #0A84FF;
  padding: 0;
  width: 10px;
  height: 10px;
  min-width: unset;
  max-width: unset;
  display: block;
  box-sizing: content-box;
  float: inline-end;
  position: relative;
}

#onboarding-overlay-button:hover::after,
#onboarding-overlay-button.onboarding-speech-bubble::after {
  background: #0060df;
  font-size: 13px;
  text-align: center;
  color: #fff;
  box-sizing: content-box;
  font-weight: 400;
  content: attr(aria-label);
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 10px 16px;
  width: auto;
  height: auto;
  min-width: 100px;
  max-width: 140px;
  white-space: pre-line;
  margin-inline-start: 4px;
  margin-top: -10px;
  box-shadow: -2px 0 5px 0 rgba(74, 74, 79, 0.25);
}

#onboarding-overlay-button:dir(rtl)::after {
  box-shadow: 2px 0 5px 0 rgba(74, 74, 79, 0.25);
}

#onboarding-overlay-button-watermark-icon,
#onboarding-overlay-button.onboarding-watermark::after,
#onboarding-overlay-button.onboarding-watermark:not(:hover) > #onboarding-overlay-button-icon {
  display: none;
}

#onboarding-overlay-button.onboarding-watermark:not(:hover) > #onboarding-overlay-button-watermark-icon {
  display: block;
}

#onboarding-overlay-dialog,
.onboarding-hidden,
#onboarding-tour-sync-page[data-login-state=logged-in] .show-on-logged-out,
#onboarding-tour-sync-page[data-login-state=logged-out] .show-on-logged-in {
  display: none;
}

.onboarding-close-btn {
  position: absolute;
  top: 15px;
  offset-inline-end: 15px;
  cursor: pointer;
  width: 16px;
  height: 16px;
  border: none;
  background: none;
  padding: 0;
 }

.onboarding-close-btn::before {
  content: url("chrome://global/skin/icons/close.svg");
  -moz-context-properties: fill, fill-opacity;
  fill-opacity: 0;
  fill: currentColor;
}

.onboarding-close-btn:-moz-any(:hover, :active, :focus, :-moz-focusring)::before {
  fill-opacity: 0.1;
}

#onboarding-overlay.onboarding-opened > #onboarding-overlay-dialog {
  width: 960px;
  height: 510px;
  background: #f5f5f7;
  border: 1px solid rgba(9, 6, 13, 0.1); /* #09060D, 0.1 opacity */
  border-radius: 3px;
  position: relative;
  margin: 0 calc(50% - 480px);
  top: calc(50% - 255px);
  display: grid;
  grid-template-rows: [dialog-start] 70px [page-start] 1fr [footer-start] 30px [dialog-end];
  grid-template-columns: [dialog-start] 230px [page-start] 1fr [dialog-end];
}

@media (max-height: 510px) {
  #onboarding-overlay.onboarding-opened > #onboarding-overlay-dialog {
    top: 0;
  }
}

#onboarding-overlay-dialog > header {
  grid-row: dialog-start / page-start;
  grid-column: dialog-start / tour-end;
  margin-top: 22px;
  margin-bottom: 0;
  margin-inline-end: 0;
  margin-inline-start: 36px;
  font-size: 22px;
  font-weight: 200;
}

#onboarding-overlay-dialog > nav {
  grid-row: dialog-start / footer-start;
  grid-column-start: dialog-start;
  margin-top: 40px;
  margin-bottom: 0;
  margin-inline-end: 0;
  margin-inline-start: 0;
  padding: 0;
}

#onboarding-overlay-dialog > footer {
  grid-column: dialog-start / tour-end;
  font-size: 13px;
}

#onboarding-skip-tour-button {
  margin-inline-start: 27px;
  margin-bottom: 27px;
}

/* Onboarding tour list */
#onboarding-tour-list {
  margin: 40px 0 0 0;
  padding: 0;
  margin-inline-start: 16px;
}

#onboarding-tour-list .onboarding-tour-item-container {
  list-style: none;
  outline: none;
}

#onboarding-tour-list .onboarding-tour-item {
  pointer-events: none;
  display: list-item;
  padding-inline-start: 49px;
  padding-top: 14px;
  padding-bottom: 14px;
  margin-bottom: 9px;
  background-repeat: no-repeat;
  background-position: left 17px top 14px;
  background-size: 20px;
  font-size: 16px;
  cursor: pointer;
}

#onboarding-tour-list .onboarding-tour-item:dir(rtl) {
  background-position-x: right 17px;
}

#onboarding-tour-list .onboarding-tour-item.onboarding-complete::before {
  content: url("img/icons_tour-complete.svg");
  position: relative;
  offset-inline-start: 3px;
  top: -10px;
  float: inline-start;
}

#onboarding-tour-list .onboarding-tour-item.onboarding-complete {
  padding-inline-start: 29px;
}

#onboarding-tour-list .onboarding-tour-item.onboarding-active,
#onboarding-tour-list .onboarding-tour-item-container:hover .onboarding-tour-item {
  color: #0A84FF;
  /* With 1px transparent outline, could see a border in the high-constrast mode */
  outline: 1px solid transparent;
}

/* Default browser tour */
#onboarding-tour-is-default-browser-msg {
  font-size: 16px;
  line-height: 21px;
  float: inline-end;
  margin-inline-end: 26px;
  margin-top: -32px;
  text-align: center;
}

/* Sync tour */
#onboarding-tour-sync-page form {
  text-align: center;
}

#onboarding-tour-sync-page form > h3 {
  text-align: center;
  margin: 0;
  font-size: 22px;
  font-weight: normal;
}

#onboarding-tour-sync-page form > p {
  text-align: center;
  margin: 3px 0 0 0;
  font-size: 15px;
  font-weight: normal;
}

#onboarding-tour-sync-page form > input {
  margin-top: 10px;
  height: 40px;
  width: 80%;
  padding: 7px;
}

#onboarding-tour-sync-page form > #onboarding-tour-sync-button {
  padding: 10px 20px;
  min-width: 40%;
  margin: 15px 0;
  float: none;
}

/* Onboarding tour pages */
.onboarding-tour-page {
  grid-row: page-start / footer-end;
  grid-column: page-start;
  display: grid;
  grid-template-rows: [tour-page-start] 393px [tour-button-start] 1fr [tour-page-end];
  grid-template-columns: [tour-page-start] 368px [tour-content-start] 1fr [tour-page-end];
}

.onboarding-tour-description {
  grid-row: tour-page-start / tour-page-end;
  grid-column: tour-page-start / tour-content-start;
  font-size: 15px;
  line-height: 22px;
  padding-inline-start: 40px;
  padding-inline-end: 28px;
  max-height: 360px;
  overflow: auto;
}

.onboarding-tour-description > h1 {
  font-size: 36px;
  margin-top: 16px;
  font-weight: 300;
  line-height: 44px;
}

.onboarding-tour-content {
  grid-row: tour-page-start / tour-button-start;
  grid-column: tour-content-start / tour-page-end;
  padding: 0;
  text-align: end;
}

.onboarding-tour-content > img {
  width: 352px;
  margin: 0;
}

/* These illustrations need to be stuck on the right side to the border. Thus we
   need to flip them horizontally on RTL . */
.onboarding-tour-content > img:dir(rtl) {
  transform: scaleX(-1);
}

.onboarding-tour-content > iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.onboarding-tour-page.onboarding-no-button > .onboarding-tour-content {
  grid-row: tour-page-start / tour-page-end;
  grid-column: tour-content-start / tour-page-end;
}

.onboarding-tour-button-container {
  /* Get higher z-index in order to ensure buttons within container are selectable */
  z-index: 2;
  grid-row: tour-button-start / tour-page-end;
  grid-column: tour-content-start / tour-page-end;
}

.onboarding-tour-page.onboarding-no-button > .onboarding-tour-button-container {
  display: none;
  grid-row: tour-page-end;
  grid-column: tour-page-end;
}

.onboarding-tour-action-button {
  background: #0060df;
  /* With 1px transparent border, could see a border in the high-constrast mode */
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  line-height: 16px;
  color: #fff;
  float: inline-end;
  margin-inline-end: 26px;
  margin-top: -32px;
}

/* Remove default dotted outline around buttons' text */
#onboarding-overlay button::-moz-focus-inner,
#onboarding-overlay-button::-moz-focus-inner {
  border: 0;
}

/* Keyboard focus specific outline */
#onboarding-overlay button:-moz-focusring,
.onboarding-action-button:-moz-focusring,
#onboarding-tour-list .onboarding-tour-item:focus {
  outline: 2px solid rgba(0,149,221,0.5);
  outline-offset: 1px;
  -moz-outline-radius: 2px;
}

.onboarding-tour-action-button:hover:not([disabled])  {
  background: #003eaa;
  cursor: pointer;
}

.onboarding-tour-action-button:active:not([disabled]) {
  background: #002275;
}

.onboarding-tour-action-button:disabled {
  opacity: 0.5;
}

/* Tour Icons */
#onboarding-tour-singlesearch,
#onboarding-notification-bar[data-target-tour-id=onboarding-tour-singlesearch] #onboarding-notification-tour-title::before {
  background-image: url("img/icons_singlesearch.svg");
}

#onboarding-tour-singlesearch.onboarding-active,
.onboarding-tour-item-container:hover #onboarding-tour-singlesearch {
  background-image: url("img/icons_singlesearch-colored.svg");
}

#onboarding-tour-private-browsing,
#onboarding-notification-bar[data-target-tour-id=onboarding-tour-private-browsing] #onboarding-notification-tour-title::before {
  background-image: url("img/icons_private.svg");
}

#onboarding-tour-private-browsing.onboarding-active,
.onboarding-tour-item-container:hover #onboarding-tour-private-browsing {
  background-image: url("img/icons_private-colored.svg");
}

#onboarding-tour-addons,
#onboarding-notification-bar[data-target-tour-id=onboarding-tour-addons] #onboarding-notification-tour-title::before {
  background-image: url("img/icons_addons.svg");
}

#onboarding-tour-addons.onboarding-active,
.onboarding-tour-item-container:hover #onboarding-tour-addons {
  background-image: url("img/icons_addons-colored.svg");
}

#onboarding-tour-customize,
#onboarding-notification-bar[data-target-tour-id=onboarding-tour-customize] #onboarding-notification-tour-title::before {
  background-image: url("img/icons_customize.svg");
}

#onboarding-tour-customize.onboarding-active,
.onboarding-tour-item-container:hover #onboarding-tour-customize {
  background-image: url("img/icons_customize-colored.svg");
}

#onboarding-tour-default-browser ,
#onboarding-notification-bar[data-target-tour-id=onboarding-tour-default-browser] #onboarding-notification-tour-title::before {
  background-image: url("img/icons_default.svg");
}

#onboarding-tour-default-browser.onboarding-active,
.onboarding-tour-item-container:hover #onboarding-tour-default-browser {
  background-image: url("img/icons_default-colored.svg");
}

#onboarding-tour-sync,
#onboarding-notification-bar[data-target-tour-id=onboarding-tour-sync] #onboarding-notification-tour-title::before {
  background-image: url("img/icons_sync.svg");
}

#onboarding-tour-sync.onboarding-active,
.onboarding-tour-item-container:hover #onboarding-tour-sync {
  background-image: url("img/icons_sync-colored.svg");
}

#onboarding-tour-library,
#onboarding-notification-bar[data-target-tour-id=onboarding-tour-library] #onboarding-notification-tour-title::before {
  background-image: url("img/icons_library.svg");
}

#onboarding-tour-library.onboarding-active,
.onboarding-tour-item-container:hover #onboarding-tour-library {
  background-image: url("img/icons_library-colored.svg");
}

#onboarding-tour-performance,
#onboarding-notification-bar[data-target-tour-id=onboarding-tour-performance] #onboarding-notification-tour-title::before {
  background-image: url("img/icons_performance.svg");
}

#onboarding-tour-performance.onboarding-active,
.onboarding-tour-item-container:hover #onboarding-tour-performance {
  background-image: url("img/icons_performance-colored.svg");
}

#onboarding-tour-screenshots,
#onboarding-notification-bar[data-target-tour-id=onboarding-tour-screenshots] #onboarding-notification-tour-title::before {
  background-image: url("img/icons_screenshots.svg");
}

#onboarding-tour-screenshots.onboarding-active,
.onboarding-tour-item-container:hover #onboarding-tour-screenshots {
  background-image: url("img/icons_screenshots-colored.svg");
}

a#onboarding-tour-screenshots-button,
a#onboarding-tour-screenshots-button:hover,
a#onboarding-tour-screenshots-button:visited {
  color: #fff;
  text-decoration: none;
}

/* Tour Notifications */
#onboarding-notification-bar {
  --onboarding-notification-bar-background-color: rgba(255, 255, 255, 0.97);
  position: fixed;
  z-index: 20998; /* We want this always under #onboarding-overlay */
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100px;
  min-width: 640px;
  background: var(--onboarding-notification-bar-background-color);
  border-top: 2px solid #e9e9e9;
  transition: transform 0.8s;
  transform: translateY(122px);
}

#onboarding-notification-bar.onboarding-opened {
  transition: none;
  transform: translateY(0px);
}

#onboarding-notification-close-btn {
  position: absolute;
  offset-block-start: 50%;
  offset-inline-end: 24px;
  transform: translateY(-50%);
}

#onboarding-notification-message-section {
  height: 100%;
  display: flex;
  align-items: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#onboarding-notification-body {
  width: 500px;
  margin: 0 18px;
  color: #0c0c0d;
  display: inline-block;
  max-height: 100%;
  overflow: auto;
  padding: 15px 0;
  box-sizing: border-box;
}

#onboarding-notification-body * {
  font-size: 12px;
  font-weight: normal;
  margin-top: 5px;
}

#onboarding-notification-tour-title {
  margin: 0;
  font-weight: bold;
  color: #0f1126;
  font-size: 14px;
}

#onboarding-notification-tour-title::before {
  content: "";
  background-repeat: no-repeat;
  background-size: 14px;
  height: 16px;
  width: 16px;
  float: inline-start;
  margin-top: 2px;
  margin-inline-end: 2px;
}

#onboarding-notification-tour-icon {
  min-width: 64px;
  height: 64px;
  background-size: 64px;
  background-repeat: no-repeat;
  background-image: url("chrome://branding/content/icon64.png");
}

.onboarding-action-button {
  background: #fbfbfb;
  /* With 1px border, could see a border in the high-constrast mode */
  border: 1px solid #c1c1c1;
  border-radius: 2px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  line-height: 16px;
  color: #202340;
  min-width: 130px;
}

.onboarding-action-button:hover {
  background-color: #ebebeb;
  cursor: pointer;
}

.onboarding-action-button:active {
  background-color: #dadada;
}

@media (min-resolution: 2dppx) {
  #onboarding-notification-tour-icon {
    background-image: url("chrome://branding/content/icon128.png");
  }
}
