/* 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://messenger/skin/shared/variables.css");

:root {
  --autocomplete-popup-url-color: -moz-nativehyperlinktext;
  --tabline-color: var(--selected-item-color);
  --glassShadowColor: hsla(240, 5%, 5%, 0.3);
  --toolbar-non-lwt-bgcolor: color-mix(in srgb, -moz-dialog 85%, white);
  --toolbar-non-lwt-textcolor: -moz-dialogText;
  --toolbar-non-lwt-bgimage: linear-gradient(rgba(255, 255, 255, 0.15),
                                             rgba(255, 255, 255, 0.15));
  --chrome-content-separator-color: ThreeDShadow;
  --row-grouped-header-bg-color: -moz-dialog;
  --row-grouped-header-bg-color-selected: var(--selected-item-color);
  --panel-separator-color: ThreeDLightShadow;
}

@media (-moz-windows-default-theme) {
  :root {
    --tabline-color: #0a84ff;
    --toolbar-non-lwt-bgcolor: #f9f9fa;
    --toolbar-non-lwt-textcolor: #0c0c0d;
    --toolbar-non-lwt-bgimage: none;
    --panel-separator-color: hsla(210, 4%, 10%, 0.14);
    --autocomplete-popup-url-color: hsl(210, 77%, 47%);
  }
}

@media (prefers-color-scheme: dark) {
  :root:-moz-lwtheme {
    --autocomplete-popup-highlight-color: var(--lwt-text-color);
    --dark-lwt-highlight-color: #0a84ff;
  }

  @media (-moz-windows-non-native-menus) {
    :root:not([lwt-tree]):-moz-lwtheme menupopup {
      --panel-background: var(--arrowpanel-background) !important;
      --panel-color: var(--arrowpanel-color) !important;
      --panel-border-color: var(--arrowpanel-border-color) !important;
      --menu-color: var(--arrowpanel-color) !important;
      --menu-disabled-color: color-mix(in srgb, var(--arrowpanel-color) 35%, transparent) !important;
      --menuitem-hover-background-color: color-mix(in srgb, var(--arrowpanel-color) 13%, transparent) !important;
    }
  }
}

@media (prefers-contrast) {
  :root:not(:-moz-lwtheme) {
    --lwt-tabs-border-color: ThreeDShadow;
    --tabline-color: SelectedItem;
    --item-focus-selected-border-color: SelectedItemText;
    --new-folder-color: Highlight;
    --menuitem-vertical-padding: 3px;
    --arrowpanel-dimmed: SelectedItem;
    --arrowpanel-dimmed-further: SelectedItem;
    --toolbar-field-focus-border-color: SelectedItem;
  }

  :root:not(:-moz-lwtheme) .themeable-full,
  :root:not(:-moz-lwtheme) .themeable-brighttext,
  :root:not(:-moz-lwtheme) #navigation-toolbox > toolbar,
  :root:not(:-moz-lwtheme) #todaypane-new-event-button,
  :root:not(:-moz-lwtheme) #CardViewBox {
    --toolbarbutton-hover-background: SelectedItem;
    --toolbarbutton-hover-bordercolor: SelectedItemText !important;
    --toolbarbutton-active-background: SelectedItem;
    --toolbarbutton-active-bordercolor: SelectedItemText;
    --toolbarbutton-checked-background: SelectedItem;
    --toolbarbutton-icon-fill-attention: SelectedItem;
  }

  :root:not(:-moz-lwtheme) .toolbarbutton-1.message-header-view-button {
    --toolbarbutton-header-bordercolor: WindowText;
    --toolbarbutton-active-bordercolor: WindowText;
  }

  :root:not(:-moz-lwtheme) .toolbarbutton-1:not(.qfb-tag-button):hover,
  :root:not(:-moz-lwtheme) #calendar-add-task-button:hover,
  :root:not(:-moz-lwtheme) #todaypane-new-event-button:hover,
  :root:not(:-moz-lwtheme) .toolbarbutton-1[checked="true"],
  :root:not(:-moz-lwtheme) .toolbarbutton-menubutton-button:hover {
    color: SelectedItemText !important;
  }

  menulist:not(:-moz-lwtheme) {
    --toolbarbutton-hover-background: ButtonFace;
  }
}
