/* 10-reply-all.css */
/* 10-reply-all: yellow + red "reply all", as in the managers' Chrome extension.
   Padding is upstream's 5px 16px minus the 2px border, so nothing moves. */
.ticket-article-item .article-actions .article-action[data-type="emailReplyAll"] {
  padding: 3px 14px;
  border: 2px solid #e53935;
  border-radius: 4px;
  background-color: #ffeb3b;
  color: #212121; /* the icon follows it: fill: currentColor */
}

.ticket-article-item .article-actions .article-action[data-type="emailReplyAll"]:hover,
.ticket-article-item .article-actions .article-action[data-type="emailReplyAll"]:focus-visible {
  border-color: #c62828;
  background-color: #fdd835;
  color: #000;
  text-decoration: none;
}

/* Zammad sets outline: none !important on every <a>, so ring via box-shadow. */
.ticket-article-item .article-actions .article-action[data-type="emailReplyAll"]:focus-visible {
  box-shadow: 0 0 0 2px var(--highlight);
}

/* Softer yellow, not glaring on a dark background. */
html[data-theme="dark"] .ticket-article-item .article-actions .article-action[data-type="emailReplyAll"] {
  border-color: #ff5252;
  background-color: #e6c229;
  color: #1a1a1a;
}

html[data-theme="dark"] .ticket-article-item .article-actions .article-action[data-type="emailReplyAll"]:hover,
html[data-theme="dark"] .ticket-article-item .article-actions .article-action[data-type="emailReplyAll"]:focus-visible {
  border-color: #ff8a80;
  background-color: #f5d34f;
  color: #000;
}

/* 20-undo-send.css */
/* 20-undo-send: the toast stack and the ticket lock while an email waits */

.wb-undo-stack {
  position: fixed;
  /* right of the navigation and above the ticket action bar: the avatar
     menu, "new ticket" and the bar's buttons stay reachable */
  left: calc(260px + 16px);
  bottom: 76px;
  z-index: 1000; /* above #notify (900), below modals (1100) */
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100vw - 292px);
  pointer-events: none;
}

.wb-undo-toast {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 460px;
  max-width: 100%;
  padding: 8px 8px 8px 16px;
  border-radius: 4px;
  background: var(--background-tertiary);
  color: var(--text-inverted);
  box-shadow: var(--elevation-high);
  font-size: 14px;
  line-height: 1.35;
  pointer-events: auto;
}

/* the tertiary background is almost the page colour in dark mode */
html[data-theme="dark"] .wb-undo-toast {
  background: var(--background-popover);
}

.wb-undo-text {
  flex: 1;
  min-width: 0;
  margin-right: 8px;
}

.wb-undo-title {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
  color: inherit;
  opacity: 0.7;
  text-decoration: none;
}

.wb-undo-title[href]:hover {
  color: inherit;
  opacity: 1;
  text-decoration: underline;
}

.wb-undo-btn {
  flex-shrink: 0;
  padding: 6px 10px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--text-muted-highlight);
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.wb-undo-btn:hover,
.wb-undo-btn:focus-visible {
  background: var(--background-modifier-lighter);
  outline: none;
}

.wb-undo-btn[hidden] {
  display: none;
}

@media (max-width: 767px) {
  .wb-undo-stack {
    left: 58px; /* collapsed navigation is 50px */
    right: 8px;
    bottom: 68px;
    max-width: none;
  }

  .wb-undo-toast {
    width: auto;
  }
}

/* Everything that would change the email or the ticket before the PUT.
   The keyboard is blocked in JS; contenteditable must stay true. */
.wb-undo-locked .article-new,
.wb-undo-locked .tabsSidebar .edit,
.wb-undo-locked .js-attributeBar,
.wb-undo-locked .ticket-article .article-actions,
.wb-undo-locked .newTicket .type-tabs,
.wb-undo-locked .newTicket .ticket-create,
.wb-undo-create .tabsSidebar {
  pointer-events: none;
  opacity: 0.55;
  transition: opacity 0.2s;
}

/* 30-macro-hotkeys.css */
/* 30-macro-hotkeys: combo hints in the macro dropdown and the profile page */

/* .dropdown-menu kbd already has Zammad's muted style; a float after the
   nowrap text would drop below the li, so lay the li out as a row */
.dropdown-menu > li.wb-hasMacroHotkey {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dropdown-menu .wb-macroHotkey {
  margin-inline-start: 16px;
  white-space: nowrap;
}

.wb-macroHotkeys-table td {
  vertical-align: middle;
}

.wb-macroHotkeys-cell {
  width: 260px;
}

/* readonly keeps typed text out; Zammad dims readonly inputs as disabled */
.wb-macroHotkeys-input.form-control[readonly] {
  opacity: 1;
  cursor: pointer;
}

.wb-macroHotkeys-input.form-control[readonly]:focus {
  cursor: text;
}

.wb-macroHotkeys-msg {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.35;
}

.wb-macroHotkeys-msg.is-error {
  color: var(--danger-color);
}

.wb-macroHotkeys-msg.is-warning {
  color: var(--bad-color);
}

.wb-macroHotkeys-hint {
  color: var(--text-muted);
}

/* 40-insert-link.css */
/* 40-insert-link: link popover and link bubble, fixed on <body> above the
   formatting bubble (600) and below the modal backdrop (1000), so a dialog
   opened meanwhile covers them; colours from Zammad's theme tokens. */
.wb-link-pop,
.wb-link-bubble {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 990;
  box-sizing: border-box;
  max-width: calc(100vw - 16px);
  background: var(--background-popover);
  color: var(--text-normal);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--elevation-high);
  font-size: 13px;
  line-height: 1.4;
}

.wb-link-pop {
  padding: 8px;
}

.wb-link-pop-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wb-link-pop-row + .wb-link-pop-row {
  margin-top: 6px;
}

.wb-link-pop .icon,
.wb-link-bubble .icon {
  flex: none;
  width: 16px;
  height: 16px;
  fill: var(--text-muted);
}

.wb-link-pop-input.form-control {
  flex: none;
  width: 300px;
  max-width: calc(100vw - 150px);
  margin: 0;
}

/* aligned with the address field, past the icon */
.wb-link-pop-textRow {
  padding-left: 24px;
}

.wb-link-pop-apply {
  flex: none;
  margin: 0;
}

.wb-link-pop-error {
  display: none;
  margin-top: 4px;
  padding-left: 24px;
  color: var(--danger-color);
  font-size: 12px;
}

.wb-link-pop.is-invalid .wb-link-pop-error {
  display: block;
}

.wb-link-pop.is-invalid .wb-link-pop-url {
  border-color: var(--danger-color);
}

.wb-link-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px 4px 10px;
}

.wb-link-bubble-url {
  max-width: 280px;
  margin: 0 6px 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-link);
}

.wb-link-bubble-url:not([href]) {
  color: var(--text-muted);
}

.wb-link-bubble .btn {
  flex: none;
  margin: 0;
  padding: 0 6px;
}

/* the selection stays visible while focus is in the popover */
::highlight(wb-link) {
  background-color: var(--background-highlight);
}
