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

@import url("chrome://browser/skin/browser-shared.css");

:root {
  --panel-field-background: light-dark(rgba(249, 249, 250, 0.3), rgba(12, 12, 13, 0.3));
}

@media (-moz-native-theme) {
  @media not (prefers-contrast) {
    :root:not([lwtheme]) {
      @media (prefers-color-scheme: light) {
        --urlbar-box-background-color: #fafafa;
      }
      @media (prefers-color-scheme: dark) {
        --tab-background-color-selected: color-mix(in srgb, -moz-dialog 75%, white);
      }
    }
  }
}

/** Begin titlebar **/

.titlebar-button {
  display: none;
}

.titlebar-buttonbox-container {
  align-items: center;
  /* Hide window controls in fullscreen */
  :root[inFullscreen] & {
    display: none;
  }
}

.titlebar-buttonbox {
  &:-moz-locale-dir(ltr) {
    margin-inline: 12px 0;

    @media (-moz-mac-rtl) {
      margin-inline: 12px;
    }
  }

  &:-moz-locale-dir(rtl) {
    margin-inline: 12px;

    @media (-moz-mac-rtl) {
      margin-inline: 12px 0;
    }
  }
}

/** End titlebar **/

:root[chromehidden~="toolbar"][chromehidden~="location"][chromehidden~="directories"] {
  border-top: 1px solid rgba(0, 0, 0, 0.65);
}

/* ----- BOOKMARK TOOLBAR ----- */

#nav-bar-customization-target > #wrapper-personal-bookmarks > #personal-bookmarks {
  min-height: 32px;
  align-items: center;
}

/* Workaround for native menubar inheritance */
.openintabs-menuitem {
  list-style-image: none;
}

/* Inactive elements are faded out on OSX */
.toolbarbutton-1:not(:hover):-moz-window-inactive,
.bookmark-item:not(:hover):-moz-window-inactive,
:root:not([customizing]) .toolbarbutton-1:-moz-window-inactive[disabled] {
  opacity: 0.5;
}

/* Address bar */

.urlbar,
#searchbar {
  font-size: 1.25em;
}

/* ----- AUTOCOMPLETE ----- */

#PopupAutoComplete > richlistbox > richlistitem[originaltype~="datalist-first"] {
  border-top: 1px solid #c7c7c7;
}

/* Bookmarking panel */

/* The following elements come from editBookmarkPanel.inc.xhtml. Styling that's
   specific to the editBookmarkPanel should be in browser.css. Styling that
   should be shared by all editBookmarkPanel.inc.xhtml consumers should be in
   editBookmark.css. */

/**** folder tree and tag selector ****/

#editBMPanel_folderTree,
#editBMPanel_tagsSelector {
  appearance: none;
  background-color: var(--panel-field-background);
  color: inherit;
  border-radius: var(--border-radius-xsmall);
  border: 1px solid var(--panel-separator-color);
  margin: 0;
}

#editBMPanel_folderTree > treechildren::-moz-tree-row(blur, selected),
#editBMPanel_tagsSelector:not(:focus) > richlistitem[selected] {
  background-color: var(--panel-background-color-dimmed);
}

#editBMPanel_folderTree > treechildren::-moz-tree-twisty(blur, selected),
#editBMPanel_folderTree > treechildren::-moz-tree-image(blur, selected),
#editBMPanel_folderTree > treechildren::-moz-tree-cell-text(blur, selected),
#editBMPanel_tagsSelector:not(:focus) > richlistitem[selected] {
  color: inherit;
}

#editBMPanel_folderTree {
  border-bottom: none;
  border-end-start-radius: 0;
  border-end-end-radius: 0;
  /* Implements editBookmarkPanel resizing on folderTree un-collapse. */
  margin: 0 !important;
  min-width: 27em;
  position: relative;
}

/* ----- SIDEBAR ELEMENTS ----- */

#sidebar-box {
  /* Default font size is 11px on mac, so this is 12px */
  font-size: 1.0909rem;
}

/* ::::: tabbrowser ::::: */

.tab-label,
.tab-group-label {
  margin-block: 1px 0;
}

.tabbrowser-tab:not(:hover) > .tab-stack > .tab-content > .tab-icon-image:not([selected], [multiselected]) {
  opacity: 0.9;
}

/*
 * Force the overlay to create a new stacking context so it always appears on
 * top of the icon.
 */
.tab-icon-overlay {
  opacity: 0.9999;
}

.tab-label-container:not([selected], [multiselected]) {
  opacity: 0.7;
}

.tabbrowser-tab {
  border: none;
}

/* Bookmark drag and drop styles */

.bookmark-item[dragover-into="true"] {
  background: SelectedItem !important;
  color: SelectedItemText !important;
}

#UITourTooltipDescription {
  font-size: 1.18rem;
  line-height: 2rem;
}

#UITourTooltipClose {
  margin-inline-end: -10px;
  margin-top: -14px;
}
