/* ReploChat site: homepage "Channels" live inbox demo with the industry toggle
   (resources/views/livewire/public/partials/channels-demo.blade.php).
   Builds on the hero mock classes (.rc-hm-app-win, .rc-hm-list, .rc-hm-b …) in rc-site-home.css.
   This file loads before rc-site-home.css, so overrides use two-class selectors. */

/* The section wrapper was sized for the old Lottie; let the demo use its own frame. */
.rc-hm-channels-anim:has(.rc-chd) { max-width: 860px; border: 0; border-radius: 0; overflow: visible; background: none; box-shadow: none; }

.rc-chd { width: 100%; }
.rc-chd-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- Industry toggle ---------- */
.rc-chd-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 18px; }
.rc-chd-tab { appearance: none; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-muted); font: inherit; font-size: 13.5px; font-weight: 600; line-height: 1; padding: 9px 14px; border-radius: var(--radius-pill); cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.rc-chd-tab:hover { border-color: var(--brand-700); color: var(--ink); }
.rc-chd-tab[aria-selected="true"] { background: var(--brand-700); border-color: var(--brand-700); color: #ffffff; }
.rc-chd-tab:focus-visible { outline: 2px solid var(--brand-700); outline-offset: 2px; }

/* ---------- Window ---------- */
.rc-chd .rc-chd-body { grid-template-columns: 236px minmax(0, 1fr); height: 420px; min-height: 0; }
.rc-chd .rc-chd-list { overflow: hidden; }
.rc-chd-item { animation: rc-chd-slide .35s ease-out both; }
.rc-chd-listen { display: flex; align-items: center; gap: 8px; padding: 10px 8px; font-size: 11.5px; color: var(--ink-subtle); }

.rc-chd .rc-chd-convo { min-height: 0; }
.rc-chd .rc-hm-convo-head .rc-hm-av { width: 26px; height: 26px; font-size: 11px; }
.rc-chd .rc-hm-convo-head strong { margin-right: auto; }
.rc-chd-pill-assign { animation: rc-chd-pop .3s ease-out both; }

/* Newest message at the bottom; older ones slide off the top, so the frame never changes height. */
.rc-chd .rc-chd-wall { justify-content: flex-end; overflow: hidden; min-height: 0; }
.rc-chd-pop { animation: rc-chd-pop .32s ease-out both; flex: none; }
.rc-chd .rc-hm-b { font-size: 12.5px; }
.rc-chd-agent .rc-hm-b-tag { color: var(--brand-ink); }
.rc-chd-ico { display: inline-flex; vertical-align: -2px; }
.rc-chd .rc-hm-sys-ok .rc-chd-text, .rc-chd .rc-hm-sys .rc-chd-text { display: inline; }

/* Flow sent, Flow response, COD template */
.rc-chd-flow .rc-chd-text { font-weight: 600; }
.rc-chd-btn { display: block; clear: both; margin: 8px -10px -7px; padding: 8px; border-top: 1px solid var(--line); text-align: center; font-size: 12.5px; font-weight: 600; color: var(--read-tick); }
.rc-chd-form { min-width: 210px; border-left: 3px solid var(--brand-700); }
.rc-chd-fields { margin: 2px 0 0; display: grid; gap: 3px; }
.rc-chd-fields div { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; }
.rc-chd-fields dt { margin: 0; font-size: 11px; color: var(--ink-subtle); }
.rc-chd-fields dd { margin: 0; font-size: 12px; font-weight: 600; color: var(--ink); }
.rc-chd-tpl .rc-hm-tpl-btns { margin-top: 6px; }

/* Typing indicator */
.rc-chd-typing { flex: none; display: inline-flex; gap: 4px; padding: 10px 12px; border-radius: 10px; box-shadow: 0 1px 1px rgba(16,32,28,0.06); }
.rc-chd-typing.is-in { align-self: flex-start; background: var(--chat-in); border-top-left-radius: 3px; }
.rc-chd-typing.is-out { align-self: flex-end; background: var(--chat-out); border-top-right-radius: 3px; }
.rc-chd-typing i, .rc-chd-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-subtle); animation: rc-chd-blink 1.1s infinite ease-in-out; }
.rc-chd-typing i:nth-child(2), .rc-chd-dots i:nth-child(2) { animation-delay: .15s; }
.rc-chd-typing i:nth-child(3), .rc-chd-dots i:nth-child(3) { animation-delay: .3s; }
.rc-chd-dots { display: inline-flex; gap: 3px; }
.rc-chd-dots i { width: 4px; height: 4px; }

/* Before the WhatsApp chat opens */
.rc-chd-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px; text-align: center; background: var(--chat-wall); }
.rc-chd-empty strong { font-size: 13.5px; color: var(--ink); }
.rc-chd-empty small { font-size: 12px; color: var(--ink-subtle); }
.rc-chd-empty-ico { display: inline-flex; margin-bottom: 4px; }
.rc-chd-empty-ico .rc-hm-wa-dot { width: 26px; height: 26px; }
.rc-chd-empty-ico .rc-hm-wa-dot + .rc-hm-wa-dot { margin-left: -8px; box-shadow: 0 0 0 2px var(--chat-wall); }

.rc-chd-cap { margin: 12px 0 0; text-align: center; font-size: 12.5px; color: var(--ink-subtle); }

@keyframes rc-chd-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes rc-chd-slide { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes rc-chd-blink { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

/* ---------- Small screens: chat list becomes a strip above the conversation ---------- */
@media (max-width: 760px) {
  .rc-chd .rc-chd-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: 470px; }
  .rc-chd .rc-chd-list { display: flex; gap: 6px; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .rc-chd .rc-chd-list li { flex: 1 1 0; min-width: 0; padding: 6px; gap: 6px; }
  .rc-chd .rc-chd-list .rc-hm-list-main small, .rc-chd .rc-chd-list .rc-hm-list-side { display: none; }
  .rc-chd-listen { flex: 1 1 0; justify-content: center; }
}
@media (max-width: 600px) {
  .rc-chd-tabs { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin-left: -4px; margin-right: -4px; padding: 0 4px 4px; scrollbar-width: none; }
  .rc-chd-tabs::-webkit-scrollbar { display: none; }
  .rc-chd-tab { flex: none; }
  .rc-chd .rc-chd-list { display: flex; }
  .rc-chd .rc-hm-win-num { display: inline-flex; max-width: 58%; overflow: hidden; }
  .rc-chd .rc-hm-win-num > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rc-chd .rc-hm-b { max-width: 90%; }
}
@media (max-width: 420px) {
  .rc-chd .rc-chd-list .rc-hm-list-main { display: none; }
  .rc-chd .rc-chd-list li { flex: 0 0 auto; }
  .rc-chd .rc-hm-win-team { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .rc-chd-item, .rc-chd-pop, .rc-chd-pill-assign { animation: none; }
  .rc-chd-typing i, .rc-chd-dots i { animation: none; opacity: .6; }
}
