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

#placesToolbar {
  position: relative;
  -moz-window-dragging: drag;
  padding: env(-moz-mac-titlebar-height) 4px 3px;
  border-bottom: 1px solid ThreeDShadow;

  &::after {
    content: "";
    position: absolute;
    inset: 0;
    appearance: auto;
    -moz-default-appearance: -moz-window-titlebar;
    z-index: -1;
  }

  > toolbarbutton {
    margin: 4px 4px 5px;
    padding: 0;
    height: 22px;
    appearance: auto;
    -moz-default-appearance: toolbarbutton;

    > .toolbarbutton-icon {
      -moz-context-properties: fill, fill-opacity;
      fill: currentColor;
      fill-opacity: 0.8;
      margin: 1px 4px;
    }

    &:not(#clearDownloadsButton) > .toolbarbutton-text {
      display: none;
    }

    &[type="menu"] > .toolbarbutton-menu-dropmarker {
      content: url(chrome://global/skin/icons/arrow-down-12.svg);
      padding: 0;
      margin-inline-end: 2px;
    }

    &[disabled] > .toolbarbutton-icon,
    &:not(:hover):-moz-window-inactive > .toolbarbutton-icon,
    &[type="menu"][disabled] > .toolbarbutton-menu-dropmarker,
    &:not(:hover):-moz-window-inactive[type="menu"] > .toolbarbutton-menu-dropmarker {
      opacity: .5;
    }

    &:-moz-window-inactive[disabled] > .toolbarbutton-icon,
    &:-moz-window-inactive[type="menu"][disabled] > .toolbarbutton-menu-dropmarker {
      opacity: .25;
    }

    > menupopup {
      margin-top: 1px;
    }
  }
}

/* Places Organizer Sidebars */

#placesList {
  background-color: -moz-sidebar;
  width: 160px;
  min-width: 100px;
  max-width: 400px;

  > treechildren::-moz-tree-cell-text {
    margin-inline-end: 6px;
  }

  > treechildren::-moz-tree-cell(separator) {
    cursor: default;
  }

  > treechildren::-moz-tree-separator {
    border-top: 1px solid color-mix(in srgb, FieldText 70%, transparent);
    margin: 0 10px;
  }
}

#placesView {
  border-top: none !important;

  > splitter {
    border-inline-start: none !important;
    border-inline-end: 1px solid color-mix(in srgb, FieldText 30%, transparent);
    min-width: 1px;
    width: 3px;
    margin-inline-start: -3px;
    position: relative;
    background-image: none !important;
  }
}

/* back and forward button */
#back-button,
#forward-button:-moz-locale-dir(rtl) {
  list-style-image: url("chrome://global/skin/icons/arrow-left.svg");
}

#forward-button,
#back-button:-moz-locale-dir(rtl) {
  list-style-image: url("chrome://global/skin/icons/arrow-right.svg");
}

#back-button {
  margin-inline-end: 0 !important; /* override margin from #placesToolbar > toolbarbutton */

  > .toolbarbutton-icon {
    margin-inline: 3px 2px !important;
  }
}

#forward-button {
  margin-inline-start: 0 !important; /* override margin from #placesToolbar > toolbarbutton */

  > .toolbarbutton-icon {
    margin-inline: 2px 3px !important;
  }
}

/* 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");
}

/* Root View */
#placesView {
  border-top: 1px solid ThreeDDarkShadow;
  -moz-user-focus: ignore;
}

/* Info box */
#detailsPane {
  border-top: 1px solid color-mix(in srgb, FieldText 50%, transparent);
}

#placeContent {
  appearance: none;
  border: none;

  > treechildren::-moz-tree-cell,
  > treechildren::-moz-tree-column {
    border-inline-start: 1px solid color-mix(in srgb, FieldText 30%, transparent);
  }

  > treechildren::-moz-tree-column(first-column),
  > treechildren::-moz-tree-cell(first-column) {
    /* This matches the treecol separator in tree.css */
    border-inline-start: none;
  }

  > treechildren::-moz-tree-cell(separator) {
    border-color: transparent;
  }
}

/**
 * info pane
 */

#itemsCountText,
#selectItemDescription {
  color: GrayText;
}

/**
 * Downloads pane
 */

#clearDownloadsButton {
  list-style-image: none !important;
}

#clearDownloadsButton > .toolbarbutton-icon {
  display: none;
}

/**** expanders ****/

.expander-up,
.expander-down {
  padding: 0;
}

.expander-up {
  appearance: auto;
  -moz-default-appearance: -moz-mac-disclosure-button-open;
}

.expander-down {
  appearance: auto;
  -moz-default-appearance: -moz-mac-disclosure-button-closed;
}
