/* MazayaChat Unified Omnichannel Inbox Styles (tawk.to inspired)
 * Clean B2B Design: Navy #072032, Lime #ACE601, Emerald #10B981, Borders #E2E8F0
 */

/* ─── Hide Old Cluttered Filter Elements ─── */
button:has(svg[data-testid="FilterListIcon"]),
button:has(svg[data-testid="FilterAltOutlinedIcon"]),
.MuiBadge-root:has(svg[data-testid="FilterListIcon"]),
.MuiBadge-root:has(svg[data-testid="FilterAltOutlinedIcon"]) {
  display: none !important;
}

/* ─── Top Channel Switcher Bar in Chat List (Sidebar) ─── */
.mz-sidebar-channel-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 8px 12px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.mz-sidebar-channel-bar::-webkit-scrollbar {
  display: none;
}

html[data-mz-mode="dark"] .mz-sidebar-channel-bar {
  background: #0B1924;
  border-bottom-color: #1B3345;
}

.mz-channel-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  max-width: 32px;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  border-radius: 9px;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: #64748B;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

html[data-mz-mode="dark"] .mz-channel-pill-btn {
  background: #0F2230;
  border-color: #1B3345;
  color: #94A3B8;
  box-shadow: none;
}

.mz-channel-pill-btn:hover {
  border-color: #CBD5E1;
  background: #F1F5F9;
  transform: translateY(-1px);
}

html[data-mz-mode="dark"] .mz-channel-pill-btn:hover {
  background: #142838;
  border-color: #2D4C63;
}

.mz-channel-pill-btn.active {
  background: #ACE601;
  border-color: #ACE601;
  color: #072032;
  box-shadow: 0 2px 6px rgba(172, 230, 1, 0.45);
}

html[data-mz-mode="dark"] .mz-channel-pill-btn.active {
  background: #ACE601;
  border-color: #ACE601;
  color: #072032;
}

.mz-channel-pill-btn.active svg {
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

html[data-mz-mode="dark"] .mz-channel-pill-btn.active svg {
  filter: none;
}

/* ─── Top Channel Filter Icons Active State matching channel brand ───
   The logos are drawn in their own brand colours, so the active button is not filled with that colour (the logo would
   vanish into it): it gets a light tint of the brand colour, a brand-coloured border and glow, and the logo stays as is. */
.mz-channel-pill-btn.active[data-sidebar-ch="whatsapp"],
.mzx .mzx-chbtn.active[data-ch="whatsapp"] { --ch: 37, 211, 102; }
.mz-channel-pill-btn.active[data-sidebar-ch="instagram"],
.mzx .mzx-chbtn.active[data-ch="instagram"] { --ch: 221, 42, 123; }
.mz-channel-pill-btn.active[data-sidebar-ch="messenger"],
.mzx .mzx-chbtn.active[data-ch="messenger"] { --ch: 0, 132, 255; }
.mz-channel-pill-btn.active[data-sidebar-ch="telegram"],
.mzx .mzx-chbtn.active[data-ch="telegram"] { --ch: 36, 161, 222; }
.mz-channel-pill-btn.active[data-sidebar-ch="email"],
.mzx .mzx-chbtn.active[data-ch="gmail"],
.mzx .mzx-chbtn.active[data-ch="imap"] { --ch: 234, 67, 53; }
.mz-channel-pill-btn.active[data-sidebar-ch="outlook"],
.mzx .mzx-chbtn.active[data-ch="outlook"] { --ch: 0, 120, 212; }
.mzx .mzx-chbtn.active[data-ch="webchat"] { --ch: 7, 32, 50; }
.mz-channel-pill-btn.active:not([data-sidebar-ch="all"]),
.mzx .mzx-chbtn.active:not(.is-all):not([data-ch=""]) {
  background: rgba(var(--ch, 172, 230, 1), 0.12) !important;
  border-color: rgb(var(--ch, 172, 230, 1)) !important;
  box-shadow: 0 0 0 2px rgba(var(--ch, 172, 230, 1), 0.22), 0 4px 12px rgba(var(--ch, 172, 230, 1), 0.28) !important;
}
html[data-mz-mode="dark"] .mz-channel-pill-btn.active:not([data-sidebar-ch="all"]),
html[data-mz-mode="dark"] .mzx .mzx-chbtn.active:not(.is-all):not([data-ch=""]) {
  background: rgba(var(--ch, 172, 230, 1), 0.22) !important;
}
html[data-mz-mode="dark"] .mzx .mzx-chbtn.active[data-ch="webchat"] { --ch: 172, 230, 1; }
.mz-channel-pill-btn.active[data-sidebar-ch="all"],
.mzx .mzx-chbtn.active[data-ch=""],
.mzx .mzx-chbtn.is-all.active {
  background: #ACE601 !important;
  border-color: #ACE601 !important;
  color: #072032 !important;
  box-shadow: 0 3px 10px rgba(172, 230, 1, 0.45) !important;
}

/* ─── Floating Add Contact Button inside Chat List (Sidebar) ─── */
.mz-newc-floating-wrap,
#mz-newc-wrap {
  position: absolute !important;
  bottom: 16px !important;
  left: 0 !important;
  right: 0 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  pointer-events: none !important;
  z-index: 25 !important;
  padding: 0 16px !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  width: auto !important;
  box-sizing: border-box !important;
}

.mz-newc-floating-btn,
#mz-newc-btn {
  pointer-events: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 10px 20px !important;
  border-radius: 9999px !important;
  border: 0 !important;
  font: inherit !important;
  font-weight: 700 !important;
  font-size: 13.5px !important;
  cursor: pointer !important;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
  white-space: nowrap !important;
  max-width: 90% !important;
  width: auto !important;
  text-decoration: none !important;
}

.mz-newc-floating-btn:hover,
#mz-newc-btn:hover {
  transform: translateY(-2px) scale(1.02) !important;
}

.mz-newc-floating-btn:active,
#mz-newc-btn:active {
  transform: translateY(0) scale(0.98) !important;
}

.mz-newc-floating-btn svg,
#mz-newc-btn svg {
  flex-shrink: 0 !important;
}

/* ─── Active Chat Customer Channel Switcher Strip (Directly below hB) ─── */
.mz-active-chat-channel-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 18px;
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
  overflow-x: auto;
  white-space: nowrap;
  flex-shrink: 0;
  scrollbar-width: none;
}

.mz-active-chat-channel-bar::-webkit-scrollbar {
  display: none;
}

html[data-mz-mode="dark"] .mz-active-chat-channel-bar {
  background: #0F2230;
  border-bottom-color: #1B3345;
}

.mz-active-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748B;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  font-family: inherit;
}

html[data-mz-mode="dark"] .mz-active-tab-btn {
  color: #94A3B8;
}

.mz-active-tab-btn:hover {
  background: rgba(7, 32, 50, 0.05);
  color: #072032;
}

html[data-mz-mode="dark"] .mz-active-tab-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
}

.mz-active-tab-btn.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #065F46;
  font-weight: 700;
}

html[data-mz-mode="dark"] .mz-active-tab-btn.active {
  background: rgba(172, 230, 1, 0.15);
  border-color: rgba(172, 230, 1, 0.4);
  color: #ACE601;
}

/* ─── Omnichannel Badges in Conversation List ─── */
.mz-omni-badges-strip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-inline-start: 6px;
  vertical-align: middle;
}

.mz-omni-mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.04);
}

/* ─── Composer Switcher Tabs ─── */
.mz-composer-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
  border-bottom: 1px solid #E2E8F0;
}

html[data-mz-mode="dark"] .mz-composer-tabs {
  background: #0F2230;
  border-color: #1B3345;
}

.mz-composer-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748B;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.mz-composer-tab:hover {
  background: rgba(7, 32, 50, 0.05);
  color: #072032;
}

.mz-composer-tab.active {
  background: #072032;
  color: #FFFFFF;
  font-weight: 700;
}

html[data-mz-mode="dark"] .mz-composer-tab.active {
  background: #ACE601;
  color: #072032;
}

.mz-composer-tab.whisper.active {
  background: #D97706;
  color: #FFFFFF;
}

.mz-composer-channel-indicator {
  margin-inline-start: auto;
  font-size: 0.76rem;
  font-weight: 700;
  color: #059669;
  background: rgba(16, 185, 129, 0.1);
  padding: 3px 10px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* hidden sidebar entries */
#mz-gmail-section-header-li, #mz-gmail-user-nav-li { display: none !important; }
#mz-composer-tabs { display: none !important; }
.mz-channel-pill-btn.active, .mz-channel-pill-btn.active:hover { box-shadow: none !important; }
.mz-channel-pill-btn.active svg { filter: none !important; }
.mz-channel-pill-btn, .mz-channel-pill-btn:hover, .mz-channel-pill-btn:focus, .mz-channel-pill-btn:focus-visible, .mz-channel-pill-btn:active, .mz-channel-pill-btn.active { box-shadow: none !important; outline: none !important; }
.mz-channel-pill-btn svg, .mz-channel-pill-btn.active svg { filter: none !important; }

/* ─── Case 2: Full-width Inbox when empty but channels connected ─── */
.mz-inbox-fullwidth {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  flex: 1 1 100% !important;
  border-right: none !important;
  border-left: none !important;
  box-shadow: none !important;
  background: #FFFFFF !important;
}

html[data-mz-mode="dark"] .mz-inbox-fullwidth {
  background: #0F172A !important;
}

.mz-chatpane-hidden {
  display: none !important;
}

.mz-inbox-fullwidth .mz-sidebar-channel-bar {
  padding: 12px 24px;
  gap: 10px;
  border-bottom: 1px solid rgba(100, 116, 139, 0.12);
}

.mz-sidebar-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 420px;
  padding: clamp(32px, 6vw, 64px) 24px;
  text-align: center;
  box-sizing: border-box;
}

.mz-sidebar-empty-state-icon {
  width: 88px;
  height: 88px;
  border-radius: 26px;
  background: #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: #072032;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

html[data-mz-mode="dark"] .mz-sidebar-empty-state-icon {
  background: #1E293B;
  color: #F8FAFC;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.mz-sidebar-empty-state-title {
  font-size: 22px;
  font-weight: 800;
  color: #072032;
  margin-bottom: 10px;
  line-height: 1.3;
}

html[data-mz-mode="dark"] .mz-sidebar-empty-state-title {
  color: #F8FAFC;
}

.mz-sidebar-empty-state-desc {
  font-size: 15px;
  color: #64748B;
  max-width: 520px;
  line-height: 1.65;
}

html[data-mz-mode="dark"] .mz-sidebar-empty-state-desc {
  color: #94A3B8;
}

.mz-inbox-fullwidth #mz-newc-wrap {
  display: none !important;
}

.mz-inbox-fullwidth #mz-newc-btn {
  max-width: 480px;
  width: 100%;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 800;
  border-radius: 12px;
}


/* show every channel icon: wrap instead of a hidden horizontal scroll that cut off the last one */
.mz-sidebar-channel-bar { flex-wrap: wrap; overflow-x: visible; row-gap: 6px; }

#mz-sidebar-channel-bar { width: 100% !important; max-width: 100% !important; min-width: 0 !important; box-sizing: border-box !important; flex-wrap: wrap !important; overflow: visible !important; }
#mz-sidebar-channel-bar .mz-channel-pill-btn { flex: 0 0 auto; }

/* all channel icons must fit the ~300px list pane: slightly tighter row (it still wraps if it ever overflows) */
#mz-sidebar-channel-bar { padding: 8px 10px !important; gap: 4px !important; }
#mz-sidebar-channel-bar .mz-channel-pill-btn { width: 30px !important; min-width: 30px !important; max-width: 30px !important; height: 30px !important; min-height: 30px !important; max-height: 30px !important; }

/* final: eight icons at 27px/3px gap = 229px, comfortably inside the ~285px list pane */
#mz-sidebar-channel-bar { padding: 8px !important; gap: 3px !important; justify-content: center !important; }
#mz-sidebar-channel-bar .mz-channel-pill-btn { width: 27px !important; min-width: 27px !important; max-width: 27px !important; height: 27px !important; min-height: 27px !important; max-height: 27px !important; border-radius: 8px !important; }
#mz-sidebar-channel-bar .mz-channel-pill-btn svg { width: 16px !important; height: 16px !important; }
