%if 0
/* 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/. */
%endif

%filter substitution

#identity-box {
  margin-inline-end: var(--identity-box-margin-inline);
}

@supports not -moz-bool-pref("browser.proton.urlbar.enabled") {
#identity-box {
  margin-inline-start: var(--identity-box-margin-inline);
}

/* The tracking protection icon will be hidden if it is a chrome page. There
   will be only the brand icon in the url bar. We need to change the margin
   in order for the identity box to cover the whole urlbar start section. */
#identity-box[pageproxystate="valid"].chromeUI {
  margin-inline-start: 0;
}
} /*** END !proton ***/

#identity-box,
#tracking-protection-icon-container {
  /* Set default fill for icons in the identity block.
     Individual icons can override this. */
  fill: currentColor;
  fill-opacity: .6;
}

@supports not -moz-bool-pref("browser.proton.urlbar.enabled") {
#identity-box[pageproxystate="invalid"] {
  margin-inline-end: calc(var(--identity-box-margin-inline) + 2px);
}
} /*** END !proton ***/

#urlbar.searchButton > #urlbar-input-container > #identity-box[pageproxystate="invalid"],
#identity-box[pageproxystate="invalid"] > #identity-permission-box,
#identity-box[pageproxystate="invalid"] > #notification-popup-box,
#identity-box[pageproxystate="invalid"] #identity-icon-label,
#identity-box[pageproxystate="invalid"] #remote-control-icon {
  display: none;
}

#urlbar:not(.searchButton) > #urlbar-input-container > #identity-box[pageproxystate="invalid"] {
  pointer-events: none;
  -moz-user-focus: ignore;
}

.identity-box-button:hover:not([open=true]),
#tracking-protection-icon-container:hover:not([open=true]) {
  background-color: hsla(0,0%,70%,.2);
}

.identity-box-button:hover:active,
.identity-box-button[open=true],
#tracking-protection-icon-container:hover:active,
#tracking-protection-icon-container[open=true] {
  background-color: hsla(0,0%,70%,.3);
}

@supports not -moz-bool-pref("browser.proton.urlbar.enabled") {
.identity-box-button:hover:not([open=true]),
.identity-box-button:hover:active,
.identity-box-button[open=true],
#tracking-protection-icon-container:hover:not([open=true]),
#tracking-protection-icon-container:hover:active,
#tracking-protection-icon-container[open=true] {
  fill-opacity: .8;
}
} /*** END !proton ***/

.identity-box-button:not(:active):-moz-focusring,
#tracking-protection-icon-container:not(:active):-moz-focusring {
  outline: var(--toolbarbutton-focus-outline);
  outline-offset: -2px;
  -moz-outline-radius: var(--toolbarbutton-border-radius);
}

.identity-box-button {
  padding-inline: var(--urlbar-icon-padding);
  border-radius: var(--toolbarbutton-border-radius);
}

@supports not -moz-bool-pref("browser.proton.urlbar.enabled") {
.identity-box-button {
  padding-inline: calc(var(--urlbar-icon-padding) / 2);
  border-radius: 0;
}
} /*** END !proton ***/

#identity-box[pageproxystate="valid"].notSecureText #identity-icon-label,
#identity-box[pageproxystate="valid"].chromeUI #identity-icon-label,
#identity-box[pageproxystate="valid"].extensionPage #identity-icon-label,
.urlbar-label {
  opacity: var(--identity-box-label-opacity);
}

#identity-icon-label {
  padding-inline-start: 4px;
}
#identity-box:not(.chromeUI, .extensionPage, .notSecureText) {
  --urlbar-separator-color: transparent;
}

#identity-box[pageproxystate="valid"].notSecureText,
#identity-box[pageproxystate="valid"].chromeUI,
#identity-box[pageproxystate="valid"].extensionPage,
#urlbar-label-box {
  margin-inline-end: 8px;
}

#identity-box[pageproxystate="valid"].notSecureText > .identity-box-button,
#identity-box[pageproxystate="valid"].chromeUI > .identity-box-button,
#identity-box[pageproxystate="valid"].extensionPage > .identity-box-button,
#urlbar-label-box {
  padding-inline: 8px;
  border-radius: var(--toolbarbutton-border-radius);
}

@supports -moz-bool-pref("browser.proton.urlbar.enabled") {
#identity-box[pageproxystate="valid"].notSecureText > .identity-box-button,
#identity-box[pageproxystate="valid"].chromeUI > .identity-box-button,
#identity-box[pageproxystate="valid"].extensionPage > .identity-box-button,
#urlbar-label-box {
  background-color: var(--urlbar-box-bgcolor);
}

#identity-box[pageproxystate="valid"].notSecureText > .identity-box-button:hover:not([open]),
#identity-box[pageproxystate="valid"].chromeUI > .identity-box-button:hover:not([open]),
#identity-box[pageproxystate="valid"].extensionPage > .identity-box-button:hover:not([open]) {
  background-color: var(--urlbar-box-hover-bgcolor);
}

#identity-box[pageproxystate="valid"].notSecureText > .identity-box-button:hover:active,
#identity-box[pageproxystate="valid"].notSecureText > .identity-box-button[open=true],
#identity-box[pageproxystate="valid"].chromeUI > .identity-box-button:hover:active,
#identity-box[pageproxystate="valid"].chromeUI > .identity-box-button[open=true],
#identity-box[pageproxystate="valid"].extensionPage > .identity-box-button:hover:active,
#identity-box[pageproxystate="valid"].extensionPage > .identity-box-button[open=true] {
  background-color: var(--urlbar-box-active-bgcolor);
}
} /*** END proton ***/

#urlbar[searchmode]:not([focused="true"]) > #urlbar-input-container > #urlbar-label-box {
  pointer-events: none;
}

@supports not -moz-bool-pref("browser.proton.urlbar.enabled") {
#identity-box[pageproxystate="valid"].notSecureText,
#identity-box[pageproxystate="valid"].chromeUI,
#identity-box[pageproxystate="valid"].extensionPage,
#urlbar-label-box {
  border-inline-end: 1px solid var(--urlbar-separator-color);
  border-image: linear-gradient(transparent 15%, var(--urlbar-separator-color) 15%, var(--urlbar-separator-color) 85%, transparent 85%);
  border-image-slice: 1;
}

#identity-box[pageproxystate="valid"].notSecureText > #identity-icon-box,
#identity-box[pageproxystate="valid"].chromeUI > #identity-icon-box,
#identity-box[pageproxystate="valid"].extensionPage > #identity-icon-box {
  padding-inline: 8px;
  border-radius: 0;
}

#urlbar-label-box {
  padding-inline: 4px;
  border-inline-start: 1px solid var(--urlbar-separator-color);
  border-radius: 0;
}

#urlbar[searchmode]:not([breakout-extend]) > #urlbar-input-container > #urlbar-label-box {
  border-inline-start-color: transparent;
  border-image-width: 0 1px 0 0;
}

#urlbar[searchmode]:not([breakout-extend]) > #urlbar-input-container > #urlbar-label-box:-moz-locale-dir(rtl) {
  border-image-width: 0 0 0 1px;
}
}/*** END !proton ***/

.urlbar-label {
  margin: 0;
}

.sharing-icon,
#identity-icon,
#permissions-granted-icon,
#tracking-protection-icon,
.notification-anchor-icon,
#blocked-permissions-container > .blocked-permission-icon {
  width: 16px;
  height: 16px;
  -moz-context-properties: fill, fill-opacity;
}

.sharing-icon,
#identity-icon,
#tracking-protection-icon,
.notification-anchor-icon,
#blocked-permissions-container > .blocked-permission-icon {
  margin-inline-start: 4px;
}

#tracking-protection-icon {
  margin-inline-start: 0;
}

/* MAIN IDENTITY ICON */
#identity-icon {
  margin-inline-start: 0;
  list-style-image: url(chrome://global/skin/icons/info.svg);
}

#identity-box[pageproxystate="valid"].chromeUI #identity-icon {
  list-style-image: url(chrome://branding/content/icon16.png);
}
@media (min-resolution: 1.1dppx) {
  #identity-box[pageproxystate="valid"].chromeUI #identity-icon {
    list-style-image: url(chrome://branding/content/icon32.png);
  }
}

@supports not -moz-bool-pref("browser.proton.urlbar.enabled") {
#identity-box[pageproxystate="valid"].chromeUI #identity-icon {
  list-style-image: url(chrome://branding/content/identity-icons-brand.svg);
}
} /*** END !proton ***/

#identity-box[pageproxystate="valid"].localResource #identity-icon {
  list-style-image: url(chrome://global/skin/icons/document.svg);
}

#urlbar:not(.searchButton) > #urlbar-input-container > #identity-box[pageproxystate="invalid"] #identity-icon {
  list-style-image: url(chrome://global/skin/icons/search-glass.svg);
  fill-opacity: .4;
}

#urlbar[actiontype="extension"] > #urlbar-input-container > #identity-box #identity-icon {
  list-style-image: url(chrome://mozapps/skin/extensions/extension.svg);
}

#identity-box[pageproxystate="valid"].extensionPage #identity-icon {
  list-style-image: url(chrome://mozapps/skin/extensions/extension.svg);
}

#identity-box[pageproxystate="valid"].verifiedDomain #identity-icon,
#identity-box[pageproxystate="valid"].mixedActiveBlocked #identity-icon {
  list-style-image: url(chrome://global/skin/icons/security.svg);
}

#identity-box[pageproxystate="valid"].verifiedDomain #identity-icon:not([lock-icon-gray]),
#identity-box[pageproxystate="valid"].mixedActiveBlocked #identity-icon:not([lock-icon-gray]) {
  fill-opacity: 1;
  fill: #12BC00;
}

#identity-box[pageproxystate="valid"].weakCipher #identity-icon,
#identity-box[pageproxystate="valid"].mixedDisplayContent #identity-icon,
#identity-box[pageproxystate="valid"].mixedDisplayContentLoadedActiveBlocked #identity-icon,
#identity-box[pageproxystate="valid"].certUserOverridden #identity-icon,
#identity-box[pageproxystate="valid"].certErrorPage #identity-icon {
  list-style-image: url(chrome://global/skin/icons/security-warning.svg);
  fill: unset;
}


#identity-box[pageproxystate="valid"].notSecure #identity-icon,
#identity-box[pageproxystate="valid"].mixedActiveContent #identity-icon,
#identity-box[pageproxystate="valid"].httpsOnlyErrorPage #identity-icon {
  list-style-image: url(chrome://global/skin/icons/security-broken.svg);
}

#permissions-granted-icon {
  list-style-image: url(chrome://browser/skin/permissions.svg);
}

#identity-permission-box {
  display: none;
}

#identity-permission-box[open=true],
#identity-permission-box[hasPermissions],
#identity-permission-box[hasSharingIcon] {
  display: -moz-box;
}

/* SHARING ICON */

#webrtc-sharing-icon[sharing="camera"] {
  list-style-image: url("chrome://browser/skin/notification-icons/camera.svg");
}

#webrtc-sharing-icon[sharing="microphone"] {
  list-style-image: url("chrome://browser/skin/notification-icons/microphone.svg");
}

#webrtc-sharing-icon[sharing="screen"] {
  list-style-image: url("chrome://browser/skin/notification-icons/screen.svg");
}

#geo-sharing-icon[sharing] {
  list-style-image: url("chrome://browser/skin/notification-icons/geo.svg");
}

.sharing-icon:not([sharing]) {
  display: none;
}

#webrtc-sharing-icon[sharing]:not([paused]) {
  -moz-context-properties: fill;
  fill: rgb(224, 41, 29);
}

/* TRACKING PROTECTION ICON */

#tracking-protection-icon-container {
  padding-inline: var(--urlbar-icon-padding);
  border-radius: var(--toolbarbutton-border-radius);
  /* This is needed in order to position the blue dot indicator. */
  position: relative;
}

@supports not -moz-bool-pref("browser.proton.urlbar.enabled") {
#tracking-protection-icon-container {
  border-radius: 0;
  /* Separator */
  border-inline-end: 1px solid var(--urlbar-separator-color);
  border-image: linear-gradient(transparent 15%, var(--urlbar-separator-color) 15%, var(--urlbar-separator-color) 85%, transparent 85%);
  border-image-slice: 1;
}
} /*** END !proton ***/

#urlbar-input-container[pageproxystate="valid"] > #tracking-protection-icon-container.chromeUI {
  display: none;
}

#tracking-protection-icon-box {
  overflow: hidden;
  width: 16px;
  height: 16px;
}

#tracking-protection-icon-box:not([hasException])[active] > #tracking-protection-icon,
#tracking-protection-icon-box:not([active]) > #tracking-protection-icon-animatable-box {
  display: none;
}

#tracking-protection-icon-animatable-box {
  display: block;
  position: absolute;
  overflow: hidden;
  width: 16px;
  height: 16px;
}

#tracking-protection-icon-box:not([hasException])[active] > #tracking-protection-icon-animatable-box > #tracking-protection-icon-animatable-image {
  /* Overrides the default 'display: -moz-box' to prevent icon shifting issue
     with scaled text, see Bug 1591049 */
  display: block;
  background-image: url(chrome://browser/skin/tracking-protection-animation.svg);
  transform: translateX(-256px);
  width: 272px;
  background-size: auto;
  height: 16px;
  min-height: 16px;
  -moz-context-properties: fill, fill-opacity;
}

#tracking-protection-icon-box:not([hasException])[active] > #tracking-protection-icon-animatable-box > #tracking-protection-icon-animatable-image:-moz-locale-dir(rtl) {
  transform: translateX(0);
}

#tracking-protection-icon-box[hasException]:-moz-locale-dir(rtl)::before {
  left: 0;
  right: unset;
  /* This is needed in order to put the dot in front of the shield icon in rtl
     mode */
  z-index: 1;
}

:root[lwt-toolbar-field-brighttext] #tracking-protection-icon-box:not([hasException])[active] > #tracking-protection-icon-animatable-box > #tracking-protection-icon-animatable-image {
  background-image: url(chrome://browser/skin/tracking-protection-animation-brighttext.svg);
}

@media (prefers-reduced-motion: no-preference) {
  #tracking-protection-icon-box[active][animate] > #tracking-protection-icon-animatable-box > #tracking-protection-icon-animatable-image {
    animation-name: tp-icon-animation;
    animation-timing-function: steps(16);
    animation-duration: 1s;
    animation-fill-mode: forwards;
  }

  #tracking-protection-icon-box[active][animate] > #tracking-protection-icon-animatable-box > #tracking-protection-icon-animatable-image:-moz-locale-dir(rtl) {
    animation-name: tp-icon-animation-rtl;
  }
}

#tracking-protection-icon-tooltip {
  max-width: 500px;
}

#urlbar-input-container[pageproxystate="valid"] > #tracking-protection-icon-container > #tracking-protection-icon-box > #tracking-protection-icon {
  list-style-image: url(chrome://browser/skin/tracking-protection.svg);
}

#urlbar-input-container[pageproxystate="valid"] > #tracking-protection-icon-container > #tracking-protection-icon-box[hasException] > #tracking-protection-icon {
  list-style-image: url(chrome://browser/skin/tracking-protection-disabled.svg);
}

#urlbar-input-container[pageproxystate="invalid"] > #tracking-protection-icon-container {
  visibility: collapse;
}

@keyframes tp-icon-animation {
  from {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-256px);
  }
}

@keyframes tp-icon-animation-rtl {
  from {
    transform: translateX(256px);
  }
  100% {
    transform: translateX(0);
  }
}

/* REMOTE CONTROL ICON */

#remote-control-icon {
  visibility: collapse;
}

:root[remotecontrol] #remote-control-icon {
  list-style-image: url(chrome://browser/content/static-robot.png);
  visibility: visible;
  width: 16px;
  height: 16px;
  margin-inline-start: 2px;
}
