/*
 * DE12: the app's colours and logo on Roundcube's Elastic skin. Every value is a `--wm-<slot>` token from the app's
 * look hook (applook.php puts it in the page); the slots are admin-kit's (brand.ts). Only colours and the logo change.
 * `html:root:root` outweighs Elastic's own `html.dark-mode …` rules, so one rule serves light and dark: the hook
 * gives each slot both values.
 */

/* The logo: the sign-in page and the menu. */
html:root:root #logo {
  content: var(--wm-logo-image);
}

/* Links: Elastic's own weight, so its folder names, subjects and menus keep their text colour. */
a,
.btn-link,
.ui.alert a:not(.btn) {
  color: var(--wm-accent);
}

/* Main buttons: sign in, send, save. */
html:root:root .btn-primary,
html:root:root .btn-primary.disabled,
html:root:root .btn-primary:disabled,
html:root:root div.tox .tox-dialog__footer .tox-button:not(.tox-button--secondary),
html:root:root .floating-action-buttons a.button {
  color: var(--wm-on-main);
  background: var(--wm-main);
  border-color: var(--wm-main);
}
html:root:root .btn-primary:hover:not(:disabled),
html:root:root .btn-primary:focus,
html:root:root .btn-primary:not(:disabled):not(.disabled):active {
  color: var(--wm-on-main);
  background: var(--wm-main-hover);
  border-color: var(--wm-main-hover);
}

/* The left menu: in light mode the app's main colour; in dark mode Elastic's own dark menu stays. */
html:root:root:not(.dark-mode) #layout-menu,
html:root:root:not(.dark-mode) #taskmenu .special-buttons {
  background-color: var(--wm-main);
}
@media screen and (min-width: 481px) {
  html:root:root:not(.dark-mode) #layout-menu .popover-header {
    background-color: var(--wm-main) !important;
  }
  html:root:root:not(.dark-mode) #taskmenu a.selected,
  html:root:root:not(.dark-mode) #taskmenu a:hover,
  html:root:root:not(.dark-mode) #taskmenu a:focus {
    background: var(--wm-main-hover);
  }
}
html:root:root #taskmenu .action-buttons a,
html:root:root #taskmenu .action-buttons a:hover {
  color: var(--wm-accent);
}
html:root:root:not(.dark-mode) #taskmenu .action-buttons a,
html:root:root:not(.dark-mode) #taskmenu .action-buttons a:hover {
  color: var(--wm-on-main);
}

/* The chosen mail, folder and settings row. */
html:root:root .listing li.selected,
html:root:root .listing li.selected > a,
html:root:root .listing li.selected > div > a,
html:root:root .listing tr.selected td,
html:root:root ul.treelist li.selected > a,
html:root:root ul.treelist li.selected > div > a,
html:root:root .table-widget table.options-table tr.selected td {
  color: var(--wm-on-accent-tint);
  background-color: var(--wm-accent-tint);
}
html:not(.touch):root:root .listing li > a:focus,
html:not(.touch):root:root .listing.focus tbody tr.focused > td:first-child {
  border-left-color: var(--wm-accent);
}

/* Unread counts. */
html:root:root .folderlist li.mailbox .unreadcount,
html:root:root .folderlist li.mailbox.recent > a > .unreadcount {
  color: var(--wm-on-main);
  background: var(--wm-main);
}

/* Menus, pickers and the blue message bar. */
html:root:root .popover .menu li a:not(.disabled):hover,
html:root:root .popover .menu .dropbutton a.dropdown:hover,
html:root:root .popupmenu .listing li > a:not(.disabled):hover,
html:root:root .popupmenu .listing li.selected,
html:root:root .ui-menu .ui-state-active,
html:root:root .ui-datepicker a.ui-state-active,
html:root:root .googie_list li.googie_list_onhover {
  color: var(--wm-on-accent-tint) !important;
  background-color: var(--wm-accent-tint) !important;
}
html:root:root #messagestack .alert-info.information {
  color: var(--wm-on-main);
  background-color: var(--wm-main);
}

/* Focus rings, switches and the storage bar. */
html:root:root .form-control:focus,
html:root:root .recipient-input.focus,
html:root:root .multi-input > .content.focused,
html:root:root .custom-file-input:focus ~ .custom-file-label,
html:root:root div.tox.focused {
  border-color: var(--wm-accent) !important;
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--wm-accent) 25%, transparent) !important;
}
html:root:root .custom-switch .custom-control-input:checked ~ .custom-control-label::before {
  border-color: var(--wm-accent);
  background-color: var(--wm-accent);
}
html:root:root .quota-widget .value {
  background-color: var(--wm-accent);
}
