/* =========================================================================
   ASKANY — LIVE CHAT FEATURES (admin Live Chat page)
   Sounds, filters, tags, private notes, canned responses, blocking,
   full screen view and the collapsible page header.
   ========================================================================= */

/* ---------- Layout: taller console, stats below ---------- */
.askany-live-chat-wrap .askany-chat-container {
  height: calc(100vh - 200px);
  max-height: none;
  min-height: 540px;
}

.askany-live-chat-wrap.askany-lc-header-collapsed .askany-chat-container {
  height: calc(100vh - 150px);
}

.askany-live-chat-wrap .askany-lc-stats-below {
  margin: 18px 0 0;
}

/* ---------- Header: icon buttons + collapse ---------- */
.askany-lc-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: var(--radius-md, 10px);
  background: var(--surface, #fff);
  color: var(--text-muted, #64748B);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.askany-lc-icon-btn:hover {
  background: var(--surface-2, #F8FAFC);
  color: var(--primary, #4F46E5);
  border-color: #C7D2FE;
}

.askany-lc-icon-btn:focus-visible {
  outline: 2px solid var(--primary, #4F46E5);
  outline-offset: 2px;
}

.askany-lc-sound-btn .askany-lc-sound-off,
.askany-lc-sound-btn.is-muted .askany-lc-sound-on {
  display: none;
}

.askany-lc-sound-btn.is-muted .askany-lc-sound-off {
  display: block;
}

.askany-lc-sound-btn.is-muted {
  color: #DC2626;
  border-color: #FECACA;
  background: #FEF2F2;
}

.askany-lc-collapse-btn svg {
  transition: transform 200ms ease;
}

.askany-live-chat-wrap.askany-lc-header-collapsed .askany-lc-collapse-btn svg {
  transform: rotate(180deg);
}

.askany-live-chat-wrap.askany-lc-header-collapsed .askany-header-bar {
  padding: 10px 16px;
  margin-bottom: 12px;
  gap: 12px;
}

.askany-live-chat-wrap.askany-lc-header-collapsed .askany-page-eyebrow,
.askany-live-chat-wrap.askany-lc-header-collapsed .askany-page-subtitle {
  display: none;
}

.askany-live-chat-wrap.askany-lc-header-collapsed .askany-page-title {
  font-size: 16px;
}

/* ---------- Live Agent Only Mode ---------- */
.askany-lc-agent-mode {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 720px;
  margin-top: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: var(--radius-md, 10px);
  background: var(--surface-2, #F8FAFC);
  transition: background 150ms ease, border-color 150ms ease;
}

.askany-lc-agent-mode.is-on {
  background: #FFF7ED;
  border-color: #FED7AA;
}

.askany-lc-agent-mode .askany-switch {
  flex-shrink: 0;
  margin-top: 2px;
}

.askany-lc-agent-mode-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
}

.askany-lc-agent-mode-text strong {
  font-size: 13px;
  color: var(--text, #0F172A);
}

.askany-lc-agent-mode-text span {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-muted, #64748B);
}

.askany-live-chat-wrap.askany-lc-header-collapsed .askany-lc-agent-mode {
  display: none;
}

.askany-lc-ai-off-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #FFEDD5;
  color: #C2410C;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

.askany-lc-ai-off-pill[hidden] {
  display: none;
}

/* Full screen toggle icons */
.askany-lc-fullscreen-btn .askany-lc-fs-exit,
.askany-lc-fullscreen .askany-lc-fullscreen-btn .askany-lc-fs-enter {
  display: none;
}

.askany-lc-fullscreen .askany-lc-fullscreen-btn .askany-lc-fs-exit {
  display: inline-block;
}

/* ---------- Full screen view ---------- */
html.askany-lc-fs-active,
body.askany-lc-fs-active {
  overflow: hidden !important;
}

.askany-settings-wrap.askany-live-chat-wrap.askany-lc-fullscreen {
  position: fixed !important;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100050; /* above #wpadminbar (99999) and the admin menu */
  width: 100% !important;
  max-width: none !important;
  height: 100vh;
  margin: 0 !important;
  padding: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface-2, #F8FAFC);
}

.askany-lc-fullscreen .askany-header-bar {
  flex: 0 0 auto;
  margin-bottom: 10px;
}

.askany-settings-wrap.askany-live-chat-wrap.askany-lc-fullscreen .askany-chat-container {
  flex: 1 1 auto;
  height: auto;
  max-height: none;
  min-height: 0;
}

.askany-lc-fullscreen .askany-lc-stats-below,
.askany-lc-fullscreen > .notice,
.askany-lc-fullscreen > .updated,
.askany-lc-fullscreen > .error {
  display: none !important;
}

/* Modals and toasts must stay on top of the full screen view. */
body.askany-lc-fs-active .tm-backdrop {
  z-index: 1000500 !important;
}

body.askany-lc-fs-active .askany-modal {
  z-index: 1000100;
}

body.askany-lc-fs-active #askany-review-results-modal {
  z-index: 1000200 !important;
}

/* ---------- Sidebar filters ---------- */
.askany-lc-filterbar {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light, #F1F5F9);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  background: var(--surface, #fff);
}

.askany-lc-filter-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-2, #F8FAFC);
  border: 1px solid var(--border-light, #F1F5F9);
  border-radius: var(--radius-md, 10px);
  overflow-x: auto;
  scrollbar-width: none;
}

.askany-lc-filter-tabs::-webkit-scrollbar {
  display: none;
}

.askany-lc-filter-tab {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 6px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted, #64748B);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.askany-lc-filter-tab:hover {
  color: var(--text, #0F172A);
}

.askany-lc-filter-tab.is-active {
  background: var(--surface, #fff);
  color: var(--primary, #4F46E5);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.askany-lc-filter-count {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  min-width: 0;
  color: inherit;
  opacity: 0.75;
}

.askany-lc-filter-count:empty {
  display: none;
}

.askany-lc-tag-filter-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted, #64748B);
}

.askany-lc-tag-filter-wrap .askany-lc-tag-filter {
  flex: 1;
  min-width: 0;
  height: 30px;
  min-height: 30px;
  padding: 0 26px 0 8px;
  font-size: 12px;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 8px;
  background-color: var(--surface, #fff);
  color: var(--text, #0F172A);
}

.askany-session-item.askany-lc-hidden {
  display: none !important;
}

.askany-lc-filter-empty {
  padding: 28px 18px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted, #64748B);
}

/* ---------- Session list chips ---------- */
.askany-session-status {
  flex-wrap: wrap;
  row-gap: 4px;
}

.askany-lc-agent-chip,
.askany-lc-tag-chip,
.askany-lc-blocked-chip,
.askany-lc-more-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 120px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.askany-lc-agent-chip {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.askany-lc-agent-chip.is-mine {
  background: #EEF2FF;
  color: var(--primary, #4F46E5);
  border-color: #C7D2FE;
}

.askany-lc-blocked-chip {
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}

.askany-lc-more-chip {
  background: var(--surface-2, #F8FAFC);
  color: var(--text-muted, #64748B);
  border: 1px solid var(--border, #E2E8F0);
}

.askany-lc-tag-chip {
  --lc-tag: #6b7280;
  background: var(--surface, #fff);
  color: var(--text, #0F172A);
  border: 1px solid var(--border, #E2E8F0);
  border-left: 3px solid var(--lc-tag);
}

/* ---------- Composer tools ---------- */
.askany-live-chat-wrap .askany-chat-input {
  position: relative;
}

.askany-lc-composer-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.askany-lc-mode {
  display: inline-flex;
  flex-shrink: 0;
  padding: 2px;
  background: var(--surface-2, #F8FAFC);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 8px;
}

.askany-lc-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted, #64748B);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.askany-lc-mode-btn.is-active {
  background: var(--surface, #fff);
  color: var(--primary, #4F46E5);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.askany-lc-mode-btn[data-mode="note"].is-active {
  color: #B45309;
}

.askany-lc-smart {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.askany-lc-smart-header {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  color: var(--primary, #4F46E5);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.askany-lc-smart-chips {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 2px 0;
}

.askany-lc-chip {
  flex-shrink: 0;
  max-width: 220px;
  padding: 3px 10px;
  border: 1px solid #C7D2FE;
  border-radius: 999px;
  background: var(--surface, #fff);
  color: #3730A3;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.askany-lc-chip:hover {
  background: #EEF2FF;
  border-color: var(--primary, #4F46E5);
}

.askany-lc-smart-manage {
  flex-shrink: 0;
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #64748B);
  text-decoration: none;
}

.askany-lc-smart-manage:hover {
  color: var(--primary, #4F46E5);
}

/* Private note mode */
.askany-live-chat-wrap .askany-chat-input.askany-lc-note-mode {
  background: #FFFBEB;
  border-top-color: #FDE68A;
  box-shadow: inset 3px 0 0 #F59E0B;
}

.askany-lc-note-mode #askany-message-input,
.askany-lc-note-mode .askany-markdown-editor {
  background: #FFFDF5;
  border-color: #FCD34D;
}

/* "/" autocomplete menu */
.askany-lc-canned-menu {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: calc(100% - 6px);
  z-index: 50;
  max-height: 260px;
  overflow-y: auto;
  padding: 4px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
}

.askany-lc-menu-item {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 8px;
  row-gap: 1px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.askany-lc-menu-item.is-active,
.askany-lc-menu-item:hover {
  background: #EEF2FF;
}

.askany-lc-menu-key {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary, #4F46E5);
}

.askany-lc-menu-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text, #0F172A);
}

.askany-lc-menu-text {
  grid-column: 1 / -1;
  font-size: 11.5px;
  color: var(--text-muted, #64748B);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Private note bubble ---------- */
.askany-lc-note {
  align-self: center;
  width: fit-content;
  max-width: min(640px, 88%);
  padding: 8px 12px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-left: 4px solid #F59E0B;
  border-radius: 8px;
  font-size: 13px;
  color: #451A03;
}

.askany-lc-note-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 3px;
  color: #B45309;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.askany-lc-note-meta {
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.askany-lc-note-del {
  margin-left: auto;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: #B45309;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 150ms ease;
}

.askany-lc-note:hover .askany-lc-note-del,
.askany-lc-note-del:focus-visible {
  opacity: 1;
}

.askany-lc-note-body {
  line-height: 1.5;
  word-break: break-word;
}

/* ---------- Block ---------- */
.askany-lc-block-btn {
  background: var(--surface, #fff);
  color: #B91C1C;
  border: 1px solid #FECACA;
}

.askany-lc-block-btn:hover {
  background: #FEF2F2;
}

.askany-lc-block-btn.is-blocked {
  color: #166534;
  border-color: #BBF7D0;
}

.askany-lc-block-btn.is-blocked:hover {
  background: #F0FDF4;
}

.askany-lc-blocked-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 8px;
  color: #991B1B;
  font-size: 12.5px;
  font-weight: 500;
}

.askany-lc-unblock-inline {
  margin-left: auto;
  padding: 3px 10px;
  border: 1px solid #FCA5A5;
  border-radius: 6px;
  background: #fff;
  color: #991B1B;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- Tags panel ---------- */
.askany-lc-tags-body {
  padding: 12px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.askany-lc-tags-current,
.askany-lc-tags-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.askany-lc-tags-current:empty,
.askany-lc-tags-suggest:empty {
  display: none;
}

.askany-lc-tag-removable {
  max-width: 100%;
  font-size: 12px;
  padding: 2px 4px 2px 8px;
}

.askany-lc-tag-remove {
  padding: 0 3px;
  border: 0;
  background: transparent;
  color: var(--text-muted, #64748B);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.askany-lc-tag-remove:hover {
  color: #DC2626;
}

.askany-lc-tag-suggest {
  --lc-tag: #6b7280;
  padding: 2px 9px;
  border: 1px dashed var(--lc-tag);
  border-radius: 999px;
  background: transparent;
  color: var(--lc-tag);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.askany-lc-tag-suggest:hover {
  border-style: solid;
}

.askany-lc-tag-form {
  display: flex;
  gap: 6px;
}

.askany-lc-tag-form input[type="text"] {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  font-size: 12.5px;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 8px;
}

@media (max-width: 1280px) {
  .askany-lc-smart-header span {
    display: none;
  }
}

@media (max-width: 768px) {
  .askany-live-chat-wrap .askany-chat-container,
  .askany-live-chat-wrap.askany-lc-header-collapsed .askany-chat-container {
    height: auto;
  }

  .askany-lc-composer-tools {
    flex-wrap: wrap;
  }
}
