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

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

#downloadsPanel > .panel-arrowcontainer > .panel-arrowcontent {
  padding: 0;
}

#downloadsListBox {
  background: transparent;
  padding: 4px;
  color: inherit;
}

#downloadsPanel:not([hasdownloads]) > #downloadsListBox {
  display: none;
}

#downloadsPanel[hasdownloads] > #emptyDownloads {
  display: none;
}

#emptyDownloads {
  padding: 10px 20px;
  max-width: 40ch;
}

#downloadsFooter {
  color: inherit;
}

#downloadsHistory {
  background: transparent;
  color: inherit;
  min-height: 41px;
}

#downloadsHistory > .button-box {
  margin: 11px 12px;
}

#downloadsPanel[keyfocus] > #downloadsFooter > #downloadsHistory:focus > .button-box {
  outline: 1px -moz-dialogtext dotted;
}

/*** Downloads Footer Background ***/

#downloadsHistory,
#downloadsSummary {
  background-color: hsla(180,20%,10%,.07);
  border-top: 1px solid !important;
  border-top-color: hsla(180,20%,10%,.14) !important;
}

#downloadsHistory:hover,
#downloadsSummary:hover {
  background-color: hsla(180,20%,10%,.15);
  border-top-color: hsla(180,20%,10%,.14) !important;
}

#downloadsHistory:hover:active,
#downloadsSummary:hover:active {
  background-color: hsla(180,20%,10%,.19);
  border-top-color: hsla(180,20%,10%,.14) !important;
  box-shadow: 0 1px 0 hsla(180,20%,10%,.05) inset;
}

/*** Downloads Summary and List items ***/

#downloadsSummary,
richlistitem[type="download"] {
  height: 6em;
  -moz-padding-end: 0;
  color: inherit;
}

#downloadsSummary {
  padding: 8px 38px 8px 12px;
  -moz-user-focus: normal;
}

#downloadsPanel[keyfocus] > #downloadsFooter > #downloadsSummary:focus {
  outline: 1px -moz-dialogtext dotted;
  outline-offset: -5px;
}

#downloadsSummary > .downloadTypeIcon {
  list-style-image: url("chrome://browser/skin/downloads/downloadIcon.png");
}

richlistitem[type="download"] {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  margin: 0;
  padding: 0 6px;
}

richlistitem[type="download"][selected] {
  background-color: transparent !important;
}

#downloadsPanel[keyfocus] > #downloadsListBox:focus > richlistitem[type="download"][selected] {
  outline: 1px -moz-dialogtext dotted;
  outline-offset: -1px;
}

.downloadTypeIcon {
  -moz-margin-end: 8px;
  /* Prevent flickering when changing states. */
  /*
  min-height: 32px;
  min-width: 32px;
  */
}

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

/* We hold .downloadTarget, .downloadProgress and .downloadDetails inside of
   a vbox with class .downloadContainer. We set the font-size of the entire
   container to 90% because:

   1) This is the size that we want .downloadDetails to be
   2) The container's width is set by localizers by &downloadDetails.width;,
      which is a ch unit. Since this is the value that should control the
      panel width, we apply it to the outer container to constrain
      .downloadTarget and .downloadProgress.

   Finally, since we want .downloadTarget's font-size to be at 100% of the
   font-size of .downloadContainer's parent, we use calc to go from the
   smaller font-size back to the original font-size.
 */

#downloadsSummaryDetails,
.downloadContainer {
  font-size: 90%;
}

#downloadsSummaryDescription,
.downloadTarget {
  margin-bottom: 7px;
  cursor: inherit;
}

.downloadTarget {
  font-size: calc(100%/0.9);
}

#downloadsSummaryDetails,
.downloadDetails {
  margin-top: 1px;
  opacity: 0.6;
  cursor: inherit;
}

/*** Highlighted list items ***/

#downloadsPanel:not([keyfocus]) > #downloadsListBox > richlistitem[type="download"][state="1"][exists]:hover {
  background-color: hsla(180,20%,10%,.09) !important;
  border-color: transparent;
}

/*** Inline buttons ***/

.downloadButton {
  -moz-appearance: none;
  min-width: 0;
  min-height: 0;
  margin: 3px;
  border: none;
  background: transparent;
  padding: 5px;
}

.downloadButton > .button-box {
  padding: 0;
}

.downloadButton:focus > .button-box {
  outline: 1px -moz-dialogtext dotted;
}

.downloadButton > .button-box > .button-icon {
  margin: 0 !important;
  opacity: 0.5;
}
.downloadButton:hover > .button-box > .button-icon {
  opacity: 0.8;
}
.downloadButton:hover:active > .button-box > .button-icon {
  opacity: 1;
}

/*** Button icons ***/

.downloadButton.downloadConfirmBlock,
.downloadButton.downloadCancel {
  list-style-image: url("chrome://symbolic-icons/skin/close.svg");
}

.downloadButton.downloadShow {
  list-style-image: url("chrome://symbolic-icons/skin/folder.svg");
}

.downloadButton.downloadRetry {
  list-style-image: url("chrome://symbolic-icons/skin/view-refresh.svg");
}
