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

@namespace url("http://www.w3.org/1999/xhtml");
@namespace xul url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");


xul|richlistitem[originaltype="autofill-profile"][selected="true"] > .autofill-item-box {
  background-color: #F2F2F2;
}

xul|richlistitem[originaltype="autofill-footer"][selected="true"] > .autofill-item-box > .autofill-button,
xul|richlistitem[originaltype="autofill-clear-button"][selected="true"] > .autofill-item-box > .autofill-button {
  background-color: #DCDCDE;
}

xul|richlistitem[originaltype="autofill-insecureWarning"] {
  border-bottom: 1px solid var(--panel-separator-color);
  background-color: var(--arrowpanel-dimmed);
}

.autofill-item-box {
  --item-padding-vertical: 7px;
  --item-padding-horizontal: 10px;
  --col-spacer: 7px;
  --item-width: calc(50% - (var(--col-spacer) / 2));
  --label-text-color: #262626;
  --comment-text-color: #646464;
  --warning-text-color: #646464;
  --btn-text-color: -moz-FieldText;

  --default-font-size: 12;
  --label-affix-font-size: 10;
  --label-font-size: 12;
  --comment-font-size: 10;
  --warning-font-size: 10;
  --btn-font-size: 11;
}

.autofill-item-box[size="small"] {
  --item-padding-vertical: 7px;
  --col-spacer: 0px;
  --row-spacer: 3px;
  --item-width: 100%;
}

.autofill-item-box:not([ac-image=""]) {
  --item-padding-vertical: 6.5px;
  --comment-font-size: 11;
}

.autofill-footer,
.autofill-footer[size="small"] {
  --item-width: 100%;
  --item-padding-vertical: 0;
  --item-padding-horizontal: 0;
}

.autofill-item-box {
  box-sizing: border-box;
  margin: 0;
  border-bottom: 1px solid rgba(38,38,38,.15);
  padding: var(--item-padding-vertical) 0;
  padding-inline-start: var(--item-padding-horizontal);
  padding-inline-end: var(--item-padding-horizontal);
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  background-color: #FFFFFF;
  color: var(--label-text-color);
}

.autofill-item-box:last-child {
  border-bottom: 0;
}

.autofill-item-box > .profile-item-col {
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: var(--item-width);
}

.autofill-item-box > .profile-label-col {
  text-align: start;
}

.autofill-item-box:not([ac-image=""]) > .profile-label-col::before {
  margin-right: 5px;
  float: left;
  content: "";
  width: 16px;
  height: 16px;
  background-image: var(--primary-icon);
  background-size: 16px 16px;
  -moz-context-properties: fill;
  fill: #4D4D4D;
}

.autofill-item-box > .profile-label-col > .profile-label {
  font-size: calc(var(--label-font-size) / var(--default-font-size) * 1em);
}

.autofill-item-box > .profile-label-col > .profile-label-affix {
  font-weight: lighter;
  font-size: calc(var(--label-affix-font-size) / var(--default-font-size) * 1em);
}

.autofill-item-box > .profile-comment-col {
  margin-inline-start: var(--col-spacer);
  text-align: end;
  color: var(--comment-text-color);
}

.autofill-item-box > .profile-comment-col > .profile-comment {
  font-size: calc(var(--comment-font-size) / var(--default-font-size) * 1em);
}

.autofill-item-box[size="small"] {
  flex-direction: column;
}

.autofill-item-box[size="small"] > .profile-comment-col {
  margin-top: var(--row-spacer);
  text-align: start;
}

.autofill-footer {
  padding: 0;
  flex-direction: column;
}

.autofill-footer > .autofill-footer-row {
  display: flex;
  justify-content: center;
  align-items: center;
  width: var(--item-width);
}

.autofill-footer > .autofill-warning {
  padding: 2.5px 0;
  color: var(--warning-text-color);
  text-align: center;
  background-color: rgba(248,232,28,.2);
  border-bottom: 1px solid rgba(38,38,38,.15);
  font-size: calc(var(--warning-font-size) / var(--default-font-size) * 1em);
}

.autofill-footer > .autofill-button {
  box-sizing: border-box;
  padding: 0 10px;
  min-height: 40px;
  background-color: #EDEDED;
  font-size: calc(var(--btn-font-size) / var(--default-font-size) * 1em);
  color: var(--btn-text-color);
  text-align: center;
}

.autofill-footer[no-warning="true"] > .autofill-warning {
  display: none;
}

.autofill-insecure-item {
  box-sizing: border-box;
  padding: 4px 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  color: GrayText;
}

.autofill-insecure-item::before {
  display: block;
  margin-inline-start: 4px;
  margin-inline-end: 8px;
  content: "";
  width: 16px;
  height: 16px;
  background-image: url(chrome://browser/skin/connection-mixed-active-loaded.svg);
  -moz-context-properties: fill;
  fill: GrayText;
}
