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

%include ../../shared/downloads/downloads.inc.css

/*** Panel and outer controls ***/

#downloadsPanel {
  margin-top: -1px;
}

@keyfocus@ #downloadsSummary:focus,
@keyfocus@ .downloadsPanelFooterButton:focus {
  outline: 2px -moz-mac-focusring solid;
  outline-offset: -2px;
}

/*** List items and similar elements in the summary ***/

:root {
  --downloads-item-height: 7em;
  --downloads-item-border-top-color: hsla(0,0%,100%,.07);
  --downloads-item-border-bottom-color: hsla(0,0%,0%,.2);
  --downloads-item-font-size-factor: 0.95;
  --downloads-item-target-margin-bottom: 6px;
  --downloads-item-details-margin-top: 0;
  --downloads-item-details-opacity: 0.7;
}

.downloadButton:focus > .button-box {
  outline: 2px -moz-mac-focusring solid;
  outline-offset: -2px;
}

/*** Highlighted list items ***/

@keyfocus@ @itemFocused@,
@notKeyfocus@ @itemFinished@[exists]:hover,
@item@[showingsubview] {
  border-radius: 3px;
  border-top: 1px solid hsla(0,0%,100%,.2);
  border-bottom: 1px solid hsla(0,0%,0%,.4);
  background-color: Highlight;
  color: HighlightText;
}

@item@[showingsubview] {
  transition: background-color var(--panelui-subview-transition-duration),
              color var(--panelui-subview-transition-duration);
}

@keyfocus@ @itemFocused@[verdict="Malware"],
@notKeyfocus@ @itemFinished@[exists][verdict="Malware"]:hover,
@item@[showingsubview][verdict="Malware"] {
  background-color: hsl(4, 82%, 47%);
  color: white;
}

@notKeyfocus@ @itemFinished@[exists]:hover {
  cursor: pointer;
}

/*** Button icons ***/

.downloadButton.downloadIconCancel {
  -moz-image-region: rect(0px, 16px, 16px, 0px);
}
@item@:hover .downloadButton.downloadIconCancel {
  -moz-image-region: rect(0px, 32px, 16px, 16px);
}
@item@:hover .downloadButton.downloadIconCancel:hover {
  -moz-image-region: rect(0px, 48px, 16px, 32px);
}
@item@:hover .downloadButton.downloadIconCancel:active {
  -moz-image-region: rect(0px, 64px, 16px, 48px);
}
@keyfocus@ @itemFocused@ .downloadButton.downloadIconCancel {
  -moz-image-region: rect(0px, 80px, 16px, 64px);
}
@keyfocus@ @itemFocused@:hover .downloadButton.downloadIconCancel {
  -moz-image-region: rect(0px, 96px, 16px, 80px);
}
@keyfocus@ @itemFocused@:hover .downloadButton.downloadIconCancel:hover {
  -moz-image-region: rect(0px, 112px, 16px, 96px);
}
@keyfocus@ @itemFocused@:hover .downloadButton.downloadIconCancel:active {
  -moz-image-region: rect(0px, 128px, 16px, 112px);
}

.downloadButton.downloadIconShow {
  -moz-image-region: rect(16px, 16px, 32px, 0px);
}
@notKeyfocus@ @itemNotFinished@:hover .downloadButton.downloadIconShow,
@keyfocus@ @itemFinished@:hover:not([selected]) .downloadButton.downloadIconShow {
  -moz-image-region: rect(16px, 32px, 32px, 16px);
}
@notKeyfocus@ @itemNotFinished@:hover .downloadButton.downloadIconShow:hover,
@keyfocus@ @itemFinished@:hover:not([selected]) .downloadButton.downloadIconShow:hover {
  -moz-image-region: rect(16px, 48px, 32px, 32px);
}
@notKeyfocus@ @itemNotFinished@:hover .downloadButton.downloadIconShow:active,
@keyfocus@ @itemFinished@:hover:not([selected]) .downloadButton.downloadIconShow:active {
  -moz-image-region: rect(16px, 64px, 32px, 48px);
}
@keyfocus@ @itemFocused@ .downloadButton.downloadIconShow {
  -moz-image-region: rect(16px, 80px, 32px, 64px);
}
@notKeyfocus@ @itemFinished@:hover .downloadButton.downloadIconShow,
@keyfocus@ @itemFocused@:hover .downloadButton.downloadIconShow {
  -moz-image-region: rect(16px, 96px, 32px, 80px);
}
@notKeyfocus@ @itemFinished@:hover .downloadButton.downloadIconShow:hover,
@keyfocus@ @itemFocused@:hover .downloadButton.downloadIconShow:hover {
  -moz-image-region: rect(16px, 112px, 32px, 96px);
}
@notKeyfocus@ @itemFinished@:hover .downloadButton.downloadIconShow:active,
@keyfocus@ @itemFocused@:hover .downloadButton.downloadIconShow:active {
  -moz-image-region: rect(16px, 128px, 32px, 112px);
}

.downloadButton.downloadIconRetry {
  -moz-image-region: rect(32px, 16px, 48px, 0px);
}
@item@:hover .downloadButton.downloadIconRetry {
  -moz-image-region: rect(32px, 32px, 48px, 16px);
}
@item@:hover .downloadButton.downloadIconRetry:hover {
  -moz-image-region: rect(32px, 48px, 48px, 32px);
}
@item@:hover .downloadButton.downloadIconRetry:active {
  -moz-image-region: rect(32px, 64px, 48px, 48px);
}
@keyfocus@ @itemFocused@ .downloadButton.downloadIconRetry {
  -moz-image-region: rect(32px, 80px, 48px, 64px);
}
@keyfocus@ @itemFocused@:hover .downloadButton.downloadIconRetry {
  -moz-image-region: rect(32px, 96px, 48px, 80px);
}
@keyfocus@ @itemFocused@:hover .downloadButton.downloadIconRetry:hover {
  -moz-image-region: rect(32px, 112px, 48px, 96px);
}
@keyfocus@ @itemFocused@:hover .downloadButton.downloadIconRetry:active {
  -moz-image-region: rect(32px, 128px, 48px, 112px);
}

.downloadButton.downloadShowBlockedInfo {
  -moz-image-region: rect(48px, 16px, 64px, 0px);
}
@item@:hover .downloadButton.downloadShowBlockedInfo {
  -moz-image-region: rect(48px, 32px, 64px, 16px);
}
@item@:hover .downloadButton.downloadShowBlockedInfo:hover {
  -moz-image-region: rect(48px, 48px, 64px, 32px);
}
@item@:hover .downloadButton.downloadShowBlockedInfo:active {
  -moz-image-region: rect(48px, 64px, 64px, 48px);
}
@keyfocus@ @itemFocused@ .downloadButton.downloadShowBlockedInfo {
  -moz-image-region: rect(48px, 80px, 64px, 64px);
}
@keyfocus@ @itemFocused@:hover .downloadButton.downloadShowBlockedInfo {
  -moz-image-region: rect(48px, 96px, 64px, 80px);
}
@keyfocus@ @itemFocused@:hover .downloadButton.downloadShowBlockedInfo:hover {
  -moz-image-region: rect(48px, 112px, 64px, 96px);
}
@keyfocus@ @itemFocused@:hover .downloadButton.downloadShowBlockedInfo:active {
  -moz-image-region: rect(48px, 128px, 64px, 112px);
}

.downloadButton.downloadShowBlockedInfo:-moz-locale-dir(rtl) {
  -moz-image-region: rect(64px, 16px, 80px, 0px);
}
@item@:hover .downloadButton.downloadShowBlockedInfo:-moz-locale-dir(rtl) {
  -moz-image-region: rect(64px, 32px, 80px, 16px);
}
@item@:hover .downloadButton.downloadShowBlockedInfo:hover:-moz-locale-dir(rtl) {
  -moz-image-region: rect(64px, 48px, 80px, 32px);
}
@item@:hover .downloadButton.downloadShowBlockedInfo:active:-moz-locale-dir(rtl) {
  -moz-image-region: rect(64px, 64px, 80px, 48px);
}
@keyfocus@ @itemFocused@ .downloadButton.downloadShowBlockedInfo:-moz-locale-dir(rtl) {
  -moz-image-region: rect(64px, 80px, 80px, 64px);
}
@keyfocus@ @itemFocused@:hover .downloadButton.downloadShowBlockedInfo:-moz-locale-dir(rtl) {
  -moz-image-region: rect(64px, 96px, 80px, 80px);
}
@keyfocus@ @itemFocused@:hover .downloadButton.downloadShowBlockedInfo:hover:-moz-locale-dir(rtl) {
  -moz-image-region: rect(64px, 112px, 80px, 96px);
}
@keyfocus@ @itemFocused@:hover .downloadButton.downloadShowBlockedInfo:active:-moz-locale-dir(rtl) {
  -moz-image-region: rect(64px, 128px, 80px, 112px);
}

@media (min-resolution: 2dppx) {
  .downloadButton {
    list-style-image: url("chrome://browser/skin/downloads/buttons@2x.png");
  }
  .downloadButton > .button-box > .button-icon {
    width: 16px;
    height: 16px;
  }

  .downloadButton.downloadIconCancel {
    -moz-image-region: rect(0px, 32px, 32px, 0px);
  }
  @item@:hover .downloadButton.downloadIconCancel {
    -moz-image-region: rect(0px, 64px, 32px, 32px);
  }
  @item@:hover .downloadButton.downloadIconCancel:hover {
    -moz-image-region: rect(0px, 96px, 32px, 64px);
  }
  @item@:hover .downloadButton.downloadIconCancel:active {
    -moz-image-region: rect(0px, 128px, 32px, 96px);
  }
  @keyfocus@ @itemFocused@ .downloadButton.downloadIconCancel {
    -moz-image-region: rect(0px, 160px, 32px, 128px);
  }
  @keyfocus@ @itemFocused@:hover .downloadButton.downloadIconCancel {
    -moz-image-region: rect(0px, 192px, 32px, 160px);
  }
  @keyfocus@ @itemFocused@:hover .downloadButton.downloadIconCancel:hover {
    -moz-image-region: rect(0px, 224px, 32px, 192px);
  }
  @keyfocus@ @itemFocused@:hover .downloadButton.downloadIconCancel:active {
    -moz-image-region: rect(0px, 256px, 32px, 224px);
  }

  .downloadButton.downloadIconShow {
    -moz-image-region: rect(32px, 32px, 64px, 0px);
  }
  @notKeyfocus@ @itemNotFinished@:hover .downloadButton.downloadIconShow,
  @keyfocus@ @itemFinished@:hover:not([selected]) .downloadButton.downloadIconShow {
    -moz-image-region: rect(32px, 64px, 64px, 32px);
  }
  @notKeyfocus@ @itemNotFinished@:hover .downloadButton.downloadIconShow:hover,
  @keyfocus@ @itemFinished@:hover:not([selected]) .downloadButton.downloadIconShow:hover {
    -moz-image-region: rect(32px, 96px, 64px, 64px);
  }
  @notKeyfocus@ @itemNotFinished@:hover .downloadButton.downloadIconShow:active,
  @keyfocus@ @itemFinished@:hover:not([selected]) .downloadButton.downloadIconShow:active {
    -moz-image-region: rect(32px, 128px, 64px, 96px);
  }
  @keyfocus@ @itemFocused@ .downloadButton.downloadIconShow {
    -moz-image-region: rect(32px, 160px, 64px, 128px);
  }
  @notKeyfocus@ @itemFinished@:hover .downloadButton.downloadIconShow,
  @keyfocus@ @itemFocused@:hover .downloadButton.downloadIconShow {
    -moz-image-region: rect(32px, 192px, 64px, 160px);
  }
  @notKeyfocus@ @itemFinished@:hover .downloadButton.downloadIconShow:hover,
  @keyfocus@ @itemFocused@:hover .downloadButton.downloadIconShow:hover {
    -moz-image-region: rect(32px, 224px, 64px, 192px);
  }
  @notKeyfocus@ @itemFinished@:hover .downloadButton.downloadIconShow:active,
  @keyfocus@ @itemFocused@:hover .downloadButton.downloadIconShow:active {
    -moz-image-region: rect(32px, 256px, 64px, 224px);
  }

  .downloadButton.downloadIconRetry {
    -moz-image-region: rect(64px, 32px, 96px, 0px);
  }
  @item@:hover .downloadButton.downloadIconRetry {
    -moz-image-region: rect(64px, 64px, 96px, 32px);
  }
  @item@:hover .downloadButton.downloadIconRetry:hover {
    -moz-image-region: rect(64px, 96px, 96px, 64px);
  }
  @item@:hover .downloadButton.downloadIconRetry:active {
    -moz-image-region: rect(64px, 128px, 96px, 96px);
  }
  @keyfocus@ @itemFocused@ .downloadButton.downloadIconRetry {
    -moz-image-region: rect(64px, 160px, 96px, 128px);
  }
  @keyfocus@ @itemFocused@:hover .downloadButton.downloadIconRetry {
    -moz-image-region: rect(64px, 192px, 96px, 160px);
  }
  @keyfocus@ @itemFocused@:hover .downloadButton.downloadIconRetry:hover {
    -moz-image-region: rect(64px, 224px, 96px, 192px);
  }
  @keyfocus@ @itemFocused@:hover .downloadButton.downloadIconRetry:active {
    -moz-image-region: rect(64px, 256px, 96px, 224px);
  }

  .downloadButton.downloadShowBlockedInfo {
    -moz-image-region: rect(96px, 32px, 128px, 0px);
  }
  @item@:hover .downloadButton.downloadShowBlockedInfo {
    -moz-image-region: rect(96px, 64px, 128px, 32px);
  }
  @item@:hover .downloadButton.downloadShowBlockedInfo:hover {
    -moz-image-region: rect(96px, 96px, 128px, 64px);
  }
  @item@:hover .downloadButton.downloadShowBlockedInfo:active {
    -moz-image-region: rect(96px, 128px, 128px, 96px);
  }
  @keyfocus@ @itemFocused@ .downloadButton.downloadShowBlockedInfo {
    -moz-image-region: rect(96px, 160px, 128px, 128px);
  }
  @keyfocus@ @itemFocused@:hover .downloadButton.downloadShowBlockedInfo {
    -moz-image-region: rect(96px, 192px, 128px, 160px);
  }
  @keyfocus@ @itemFocused@:hover .downloadButton.downloadShowBlockedInfo:hover {
    -moz-image-region: rect(96px, 224px, 128px, 192px);
  }
  @keyfocus@ @itemFocused@:hover .downloadButton.downloadShowBlockedInfo:active {
    -moz-image-region: rect(96px, 256px, 128px, 224px);
  }

  .downloadButton.downloadShowBlockedInfo:-moz-locale-dir(rtl) {
    -moz-image-region: rect(128px, 32px, 160px, 0px);
  }
  @item@:hover .downloadButton.downloadShowBlockedInfo:-moz-locale-dir(rtl) {
    -moz-image-region: rect(128px, 64px, 160px, 32px);
  }
  @item@:hover .downloadButton.downloadShowBlockedInfo:hover:-moz-locale-dir(rtl) {
    -moz-image-region: rect(128px, 96px, 160px, 64px);
  }
  @item@:hover .downloadButton.downloadShowBlockedInfo:active:-moz-locale-dir(rtl) {
    -moz-image-region: rect(128px, 128px, 160px, 96px);
  }
  @keyfocus@ @itemFocused@ .downloadButton.downloadShowBlockedInfo:-moz-locale-dir(rtl) {
    -moz-image-region: rect(128px, 160px, 160px, 128px);
  }
  @keyfocus@ @itemFocused@:hover .downloadButton.downloadShowBlockedInfo:-moz-locale-dir(rtl) {
    -moz-image-region: rect(128px, 192px, 160px, 160px);
  }
  @keyfocus@ @itemFocused@:hover .downloadButton.downloadShowBlockedInfo:hover:-moz-locale-dir(rtl) {
    -moz-image-region: rect(128px, 224px, 160px, 192px);
  }
  @keyfocus@ @itemFocused@:hover .downloadButton.downloadShowBlockedInfo:active:-moz-locale-dir(rtl) {
    -moz-image-region: rect(128px, 256px, 160px, 224px);
  }

  #downloadsPanel-multiView > .panel-viewcontainer > .panel-viewstack[viewtype="subview"] .download-state[showingsubview] .downloadButton {
    list-style-image: url("chrome://browser/skin/customizableui/subView-arrow-back-inverted@2x.png");
  }
  #downloadsPanel-multiView > .panel-viewcontainer > .panel-viewstack[viewtype="subview"] .download-state[showingsubview] .downloadButton:-moz-locale-dir(rtl) {
    list-style-image: url("chrome://browser/skin/customizableui/subView-arrow-back-inverted-rtl@2x.png");
  }
}
