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

#downloadsRichListBox {
  /** The default listbox appearance comes with an unwanted margin. **/
  -moz-appearance: none;
  margin: 0;
}

#downloadsRichListBox > richlistitem.download {
  height: 6em;
  padding: 5px 8px;
}

.downloadTypeIcon {
  -moz-margin-end: 8px;
  /* Ensure icons are displayed at 32px size even on Retina display */
  height: 32px;
  width: 32px;
}

.blockedIcon {
  list-style-image: url("chrome://global/skin/icons/Error.png");
}

.downloadTarget {
  margin-bottom: 3px;
  cursor: inherit;
}

.downloadDetails {
  opacity: 0.7;
  font-size: 95%;
  cursor: inherit;
}

.downloadButton {
  -moz-appearance: none;
  background: transparent;
  min-width: 0;
  min-height: 0;
  margin: 3px;
  border: none;
  padding: 5px;
  list-style-image: url("chrome://browser/skin/downloads/buttons.png");
}

/*** Button icons ***/

.downloadButton.downloadConfirmBlock,
.downloadButton.downloadCancel {
  -moz-image-region: rect(0px, 16px, 16px, 0px);
}
richlistitem.download:hover > .downloadButton.downloadConfirmBlock,
richlistitem.download:hover > .downloadButton.downloadCancel {
  -moz-image-region: rect(0px, 32px, 16px, 16px);
}
richlistitem.download:hover > .downloadButton.downloadConfirmBlock:hover,
richlistitem.download:hover > .downloadButton.downloadCancel:hover {
  -moz-image-region: rect(0px, 48px, 16px, 32px);
}
richlistitem.download:hover > .downloadButton.downloadConfirmBlock:active,
richlistitem.download:hover > .downloadButton.downloadCancel:active {
  -moz-image-region: rect(0px, 64px, 16px, 48px);
}
richlistitem.download[selected] > .downloadButton.downloadConfirmBlock,
richlistitem.download[selected] > .downloadButton.downloadCancel {
  -moz-image-region: rect(0px, 80px, 16px, 64px);
}
richlistitem.download:hover[selected] > .downloadButton.downloadConfirmBlock,
richlistitem.download:hover[selected] > .downloadButton.downloadCancel {
  -moz-image-region: rect(0px, 96px, 16px, 80px);
}
richlistitem.download:hover[selected] > .downloadButton.downloadConfirmBlock:hover,
richlistitem.download:hover[selected] > .downloadButton.downloadCancel:hover {
  -moz-image-region: rect(0px, 112px, 16px, 96px);
}
richlistitem.download:hover[selected] > .downloadButton.downloadConfirmBlock:active,
richlistitem.download:hover[selected] > .downloadButton.downloadCancel:active {
  -moz-image-region: rect(0px, 128px, 16px, 112px);
}

.downloadButton.downloadShow {
  -moz-image-region: rect(16px, 16px, 32px, 0px);
}
richlistitem.download:hover > .downloadButton.downloadShow {
  -moz-image-region: rect(16px, 32px, 32px, 16px);
}
richlistitem.download:hover > .downloadButton.downloadShow:hover {
  -moz-image-region: rect(16px, 48px, 32px, 32px);
}
richlistitem.download:hover > .downloadButton.downloadShow:active {
  -moz-image-region: rect(16px, 64px, 32px, 48px);
}
richlistitem.download[selected] > .downloadButton.downloadShow {
  -moz-image-region: rect(16px, 80px, 32px, 64px);
}
richlistitem.download:hover[selected] > .downloadButton.downloadShow {
  -moz-image-region: rect(16px, 96px, 32px, 80px);
}
richlistitem.download:hover[selected] > .downloadButton.downloadShow:hover {
  -moz-image-region: rect(16px, 112px, 32px, 96px);
}
richlistitem.download:hover[selected] > .downloadButton.downloadShow:active {
  -moz-image-region: rect(16px, 128px, 32px, 112px);
}

.downloadButton.downloadRetry {
  -moz-image-region: rect(32px, 16px, 48px, 0px);
}
richlistitem.download:hover > .downloadButton.downloadRetry {
  -moz-image-region: rect(32px, 32px, 48px, 16px);
}
richlistitem.download:hover > .downloadButton.downloadRetry:hover {
  -moz-image-region: rect(32px, 48px, 48px, 32px);
}
richlistitem.download:hover > .downloadButton.downloadRetry:active {
  -moz-image-region: rect(32px, 64px, 48px, 48px);
}
richlistitem.download[selected] > .downloadButton.downloadRetry {
  -moz-image-region: rect(32px, 80px, 48px, 64px);
}
richlistitem.download:hover[selected] > .downloadButton.downloadRetry {
  -moz-image-region: rect(32px, 96px, 48px, 80px);
}
richlistitem.download:hover[selected] > .downloadButton.downloadRetry:hover {
  -moz-image-region: rect(32px, 112px, 48px, 96px);
}
richlistitem.download:hover[selected] > .downloadButton.downloadRetry:active {
  -moz-image-region: rect(32px, 128px, 48px, 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.downloadConfirmBlock,
  .downloadButton.downloadCancel {
     -moz-image-region: rect(0px, 32px, 32px, 0px);
  }
  richlistitem.download:hover > .downloadButton.downloadConfirmBlock,
  richlistitem.download:hover > .downloadButton.downloadCancel {
    -moz-image-region: rect(0px, 64px, 32px, 32px);
  }
  richlistitem.download:hover > .downloadButton.downloadConfirmBlock:hover,
  richlistitem.download:hover > .downloadButton.downloadCancel:hover {
    -moz-image-region: rect(0px, 96px, 32px, 64px);
  }
  richlistitem.download:hover > .downloadButton.downloadConfirmBlock:active,
  richlistitem.download:hover > .downloadButton.downloadCancel:active {
    -moz-image-region: rect(0px, 128px, 32px, 96px);
  }
  richlistitem.download[selected] > .downloadButton.downloadConfirmBlock,
  richlistitem.download[selected] > .downloadButton.downloadCancel {
    -moz-image-region: rect(0px, 160px, 32px, 128px);
  }
  richlistitem.download:hover[selected] > .downloadButton.downloadConfirmBlock,
  richlistitem.download:hover[selected] > .downloadButton.downloadCancel {
    -moz-image-region: rect(0px, 192px, 32px, 160px);
  }
  richlistitem.download:hover[selected] > .downloadButton.downloadConfirmBlock:hover,
  richlistitem.download:hover[selected] > .downloadButton.downloadCancel:hover {
    -moz-image-region: rect(0px, 224px, 32px, 192px);
  }
  richlistitem.download:hover[selected] > .downloadButton.downloadConfirmBlock:active,
  richlistitem.download:hover[selected] > .downloadButton.downloadCancel:active {
    -moz-image-region: rect(0px, 256px, 32px, 224px);
  }

  .downloadButton.downloadShow {
    -moz-image-region: rect(32px, 32px, 64px, 0px);
  }
  richlistitem.download:hover > .downloadButton.downloadShow {
    -moz-image-region: rect(32px, 64px, 64px, 32px);
  }
  richlistitem.download:hover > .downloadButton.downloadShow:hover {
    -moz-image-region: rect(32px, 96px, 64px, 64px);
  }
  richlistitem.download:hover > .downloadButton.downloadShow:active {
    -moz-image-region: rect(32px, 128px, 64px, 96px);
  }
  richlistitem.download[selected] > .downloadButton.downloadShow {
    -moz-image-region: rect(32px, 160px, 64px, 128px);
  }
  richlistitem.download:hover[selected] > .downloadButton.downloadShow {
    -moz-image-region: rect(32px, 192px, 64px, 160px);
  }
  richlistitem.download:hover[selected] > .downloadButton.downloadShow:hover {
    -moz-image-region: rect(32px, 224px, 64px, 192px);
  }
  richlistitem.download:hover[selected] > .downloadButton.downloadShow:active {
    -moz-image-region: rect(32px, 256px, 64px, 224px);
  }

  .downloadButton.downloadRetry {
    -moz-image-region: rect(64px, 32px, 96px, 0px);
  }
  richlistitem.download:hover > .downloadButton.downloadRetry {
    -moz-image-region: rect(64px, 64px, 96px, 32px);
  }
  richlistitem.download:hover > .downloadButton.downloadRetry:hover {
    -moz-image-region: rect(64px, 96px, 96px, 64px);
  }
  richlistitem.download:hover > .downloadButton.downloadRetry:active {
    -moz-image-region: rect(64px, 128px, 96px, 96px);
  }
  richlistitem.download[selected] > .downloadButton.downloadRetry {
    -moz-image-region: rect(64px, 160px, 96px, 128px);
  }
  richlistitem.download:hover[selected] > .downloadButton.downloadRetry {
    -moz-image-region: rect(64px, 192px, 96px, 160px);
  }
  richlistitem.download:hover[selected] > .downloadButton.downloadRetry:hover {
    -moz-image-region: rect(64px, 224px, 96px, 192px);
  }
  richlistitem.download:hover[selected] > .downloadButton.downloadRetry:active {
    -moz-image-region: rect(64px, 256px, 96px, 224px);
  }
}