%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

#identity-box {
  --identity-box-selected-background-color: rgb(231,230,230);
  --identity-box-verified-color: hsl(92,100%,30%);
%ifdef MOZ_OFFICIAL_BRANDING
  --identity-box-chrome-color: rgb(229,115,0);
%else
%if MOZ_UPDATE_CHANNEL == aurora
  --identity-box-chrome-color: rgb(51,30,84);
%else
  --identity-box-chrome-color: rgb(0,33,71);
%endif
%endif

  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;
  font-size: .9em;
  padding: 3px 5px;
  margin-inline-end: 4px;
  overflow: hidden;
  /* The latter two properties have a transition to handle the delayed hiding of
     the forward button when hovered. */
  transition: background-color 150ms ease, padding-left, padding-right;
}

#identity-box:hover,
#identity-box[open=true] {
  background-color: var(--identity-box-selected-background-color);
  border-image-source: none;
}

#urlbar[pageproxystate="valid"] > #identity-box.verifiedIdentity {
  color: var(--identity-box-verified-color);
}

#urlbar[pageproxystate="valid"] > #identity-box.chromeUI {
  color: var(--identity-box-chrome-color);
}

#identity-icon-labels {
  padding-inline-start: 2px;
}

#notification-popup-box:not([hidden]) + #identity-box {
  padding-inline-start: 10px;
  border-radius: 0;
}

@conditionalForwardWithUrlbar@ > #urlbar > #identity-box {
  border-radius: 0;
}

@conditionalForwardWithUrlbar@ > #forward-button[disabled] + #urlbar > #notification-popup-box[hidden] + #identity-box {
  padding-inline-start: calc(var(--backbutton-urlbar-overlap) + 4px);
}

@conditionalForwardWithUrlbar@:hover:not([switchingtabs]) > #forward-button[disabled] + #urlbar > #notification-popup-box[hidden] + #identity-box {
  /* Forward button hiding is delayed when hovered, so we should use the same
     delay for the identity box. We handle both horizontal paddings (for LTR and
     RTL), the latter two delays here are for padding-left and padding-right. */
  transition-delay: 0s, 100s, 100s;
}

@conditionalForwardWithUrlbar@:not(:hover) > #forward-button[disabled] + #urlbar > #notification-popup-box[hidden] + #identity-box {
  /* when not hovered anymore, trigger a new non-delayed transition to react to the forward button hiding */
  padding-inline-start: calc(var(--backbutton-urlbar-overlap) + 4.01px);
}

/* TRACKING PROTECTION ICON */

#tracking-protection-icon {
  width: 16px;
  height: 16px;
  margin-inline-start: 0;
  margin-inline-end: 2px;
  list-style-image: url(chrome://browser/skin/tracking-protection-16.svg);
  opacity: 1;
}

#tracking-protection-icon[state="loaded-tracking-content"] {
  list-style-image: url(chrome://browser/skin/tracking-protection-disabled-16.svg);
}

#tracking-protection-icon[animate] {
  transition: margin-left 200ms ease-out, margin-right 200ms ease-out;
}

#tracking-protection-icon:not([state]) {
  margin-inline-start: -18px;
  pointer-events: none;
  opacity: 0;
  /* Only animate the shield in, when it disappears hide it immediately. */
  transition: none;
}

#urlbar[pageproxystate="invalid"] > #identity-box > #identity-icons > #tracking-protection-icon {
  visibility: collapse;
}

/* MAIN IDENTITY ICON */

#page-proxy-favicon {
  width: 16px;
  height: 16px;
  list-style-image: url(chrome://browser/skin/identity-not-secure.svg);
}

.chromeUI > #identity-icons > #page-proxy-favicon[pageproxystate="valid"] {
  list-style-image: url(chrome://branding/content/identity-icons-brand.svg);
}

.verifiedDomain > #identity-icons > #page-proxy-favicon[pageproxystate="valid"],
.verifiedIdentity > #identity-icons > #page-proxy-favicon[pageproxystate="valid"] {
  list-style-image: url(chrome://browser/skin/identity-secure.svg);
}

.mixedActiveContent > #identity-icons > #page-proxy-favicon[pageproxystate="valid"] {
  list-style-image: url(chrome://browser/skin/identity-mixed-active-loaded.svg);
}

.weakCipher > #identity-icons > #page-proxy-favicon[pageproxystate="valid"],
.mixedDisplayContent > #identity-icons > #page-proxy-favicon[pageproxystate="valid"],
.mixedDisplayContentLoadedActiveBlocked > #identity-icons > #page-proxy-favicon[pageproxystate="valid"] {
  list-style-image: url(chrome://browser/skin/identity-mixed-passive-loaded.svg);
}

.mixedActiveBlocked > #identity-icons > #page-proxy-favicon[pageproxystate="valid"] {
  list-style-image: url(chrome://browser/skin/identity-mixed-active-blocked.svg);
}

#page-proxy-favicon[pageproxystate="invalid"] {
  opacity: 0.3;
}

#urlbar[actiontype="searchengine"] > #identity-box > #identity-icons > #page-proxy-favicon {
  -moz-image-region: inherit;
  list-style-image: url(chrome://global/skin/icons/autocomplete-search.svg#search-icon);
  width: 16px;
  height: 16px;
  opacity: 1;
}
