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

:root {
  --organizer-background-color-content: ThreeDShadow;
  --organizer-border-color: ThreeDShadow;
}

/* Toolbar */

#placesToolbar {
  border-bottom: 1px solid var(--organizer-border-color);
  padding: 3px;
  padding-inline-end: 6px;
}

#placesToolbar > toolbarbutton > .toolbarbutton-icon,
#placesMenu > menu > image,
#placesMenu > menu > .menubar-text {
  -moz-context-properties: fill, fill-opacity;
  fill: currentColor;
  fill-opacity: 0.8;
}

#placesToolbar > toolbarbutton[disabled] > .toolbarbutton-icon {
  opacity: .4;
}

#placesToolbar > toolbarbutton {
  padding: 4px 7px;
}

#back-button {
  list-style-image: url("chrome://browser/skin/back.svg");
}

#forward-button {
  list-style-image: url("chrome://browser/skin/forward.svg");
}

#back-button:-moz-locale-dir(rtl) > .toolbarbutton-icon,
#forward-button:-moz-locale-dir(rtl) > .toolbarbutton-icon {
  transform: scaleX(-1);
}

#searchFilter {
  margin: 0;
  padding-block: 2px;
}

/* Menus */

#placesMenu {
  margin-inline-start: 6px;
}

#placesMenu > menu {
  padding-block: 2px;
  padding-inline: 4px 1px;
  margin-inline-end: 2px;
  appearance: auto;
  -moz-default-appearance: toolbarbutton;
%ifdef XP_WIN
% use standard menu colors on OS/2
  color: -moz-DialogText;
%endif
}

#placesMenu > menu[_moz-menuactive="true"] {
  background-color: transparent;
}

#placesMenu > menu:hover {
  border-color: ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight;
}

#placesMenu > menu[open] {
  border-color: ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow;
  padding-block: 3px 1px;
  padding-inline: 5px 0;
}

#placesMenu > menu > .menubar-text {
  padding-inline-end: 8px;
  background: url(chrome://global/skin/icons/arrow-dropdown-12.svg) right center no-repeat;
  background-size: 6px;
}

#placesMenu > menu > .menubar-text:-moz-locale-dir(rtl) {
  background-position-x: left;
}

/* Organize button */
#organizeButton {
  list-style-image: url("chrome://global/skin/icons/settings.svg");
}

/* View button */
#viewMenu {
  list-style-image: url("chrome://browser/skin/sort.svg");
}

/* Maintenance button */
#maintenanceButton {
  list-style-image: url("chrome://browser/skin/import-export.svg");
}

/* Info box */

#detailsPane {
  border-top: 1px solid var(--organizer-border-color);
  padding: 5px;
}

#editBMPanel_tagsSelectorRow > richlistbox > richlistitem,
.expander-up,
.expander-down {
  border: 1px solid transparent;
}

#contentView treecol {
  padding: 4px;
}

/* Downloads pane */
#clearDownloadsButton > .toolbarbutton-icon {
  display: none;
}

@media (-moz-windows-classic: 0) {
  #placesToolbox {
    appearance: none;
    background-color: transparent;
  }

  #placesToolbar {
    appearance: none;
    background-color: -moz-Dialog;
    color: -moz-dialogText;
  }
}

@media (-moz-windows-default-theme) {
  #placesView > splitter {
    border: 0;
    border-inline-end: 1px solid var(--organizer-border-color);
    min-width: 0;
    width: 3px;
    background-color: transparent;
    margin-inline-start: -3px;
    position: relative;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --blue-50: #0a84ff;
    --blue-50-a30: rgba(10, 132, 255, 0.3);

    --grey-10: #f9f9fA;
    --grey-40: #b1b1b3;
    --grey-50: #737373;
    --grey-60: #4a4a4f;
    --grey-70: #38383d;
    --grey-80: #2a2a2e;
    --grey-90: #0c0c0d;

    --organizer-text-primary-color: white;
    --organizer-text-secondary-color: var(--grey-10);

    --organizer-background-color-content: var(--grey-60);
    --organizer-background-primary-color: var(--grey-70);
    --organizer-background-intermediate-color: var(--grey-80);
    --organizer-background-secondary-color: var(--grey-90);

    --organizer-border-color: var(--grey-60);
    --organizer-border-color-selected: var(--grey-40);
    --organizer-background-color-selected: var(--grey-50);

    --organizer-searchbox-border-active: var(--blue-50);
    --organizer-searchbox-border-active-shadow: var(--blue-50-a30);
  }

  #places input {
    border: 1px solid var(--organizer-border-color);
    background-color: var(--organizer-background-color-content);
    color: var(--organizer-text-primary-color);
  }

  #placesToolbar {
    background-color: var(--organizer-background-secondary-color);
    color: var(--organizer-text-primary-color);
  }

  #placesToolbar > toolbarbutton {
    appearance: none;
  }

  #placesToolbar > toolbarbutton:not([disabled]):hover {
    background-color: var(--organizer-background-color-content);
  }

  #placesMenu > menu {
    appearance: none;
    color: var(--organizer-text-primary-color);
  }

  #placesMenu > menu:hover,
  #placesMenu > menu[_moz-menuactive="true"] {
    border-color: var(--organizer-border-color);
    background-color: var(--organizer-background-color-content);
  }

  #searchFilter {
    appearance: none;
    background-color: var(--organizer-background-color-content);
    color: var(--organizer-text-primary-color);
    border: 1px solid transparent;
    border-radius: 2px;
  }

  #searchFilter[focused] {
    border-color: var(--organizer-searchbox-border-active);
    box-shadow: 0 0 0 1px var(--organizer-searchbox-border-active),
      0 0 0 3px var(--organizer-searchbox-border-active-shadow);
  }

  #placesList {
    color: var(--organizer-text-primary-color);
    background-color: var(--organizer-background-intermediate-color);
  }

  #placesView > splitter {
    border-color: var(--organizer-border-color);
  }

  #downloadsRichListBox {
    color: var(--organizer-text-primary-color);
    background-color: var(--organizer-background-primary-color);
  }

  #detailsPane {
    background-color: var(--organizer-background-intermediate-color);
    color: var(--organizer-text-primary-color);
  }

  treechildren:not(.autocomplete-treebody)::-moz-tree-cell-text() {
    color: var(--organizer-text-primary-color);
  }

  treechildren:not(.autocomplete-treebody)::-moz-tree-row(selected),
  treechildren::-moz-tree-row(selected) {
    background: var(--organizer-background-color-selected);
    color: var(--organizer-text-primary-color);
    border: 1px solid var(--organizer-border-color-selected);
  }

  treechildren::-moz-tree-twisty(current) {
    color: var(--organizer-text-primary-color);
  }

  treechildren::-moz-tree-row {
    background-color: transparent;
  }

  treechildren::-moz-tree-row(hover) {
    background-color: var(--organizer-background-color-content);
  }

  treechildren::-moz-tree-image {
    fill: var(--organizer-text-primary-color);
  }

  treechildren::-moz-tree-separator {
    height: 1px;
    border-color: var(--organizer-text-secondary-color);
  }

  #contentView treecol {
    appearance: none;
    background: var(--organizer-background-intermediate-color);
    color: var(--organizer-text-primary-color);
    border-inline-end: 1px solid var(--organizer-border-color);
  }

  tree {
    background-color: var(--organizer-background-primary-color);
  }

  #editBMPanel_tagsSelectorRow > richlistbox {
    appearance: none;
    color: var(--organizer-text-primary-color);
    background-color: var(--organizer-background-color-content);
  }

  #editBMPanel_tagsSelectorRow > richlistbox > richlistitem[selected] {
    border: 1px solid var(--organizer-border-color-selected);
    background: var(--organizer-background-color-selected);
    color: var(--organizer-text-primary-color);
  }
}
