/* Live chat demo — "¿Cómo funciona?" section.
   COLORS: change them here (HiHostly logo palette). */
.chat-demo {
  --chat-orange: #E8803A;      /* send button */
  --chat-orange-mid: #F0A64A;
  --chat-yellow: #F2C855;
  --chat-navy: #12182F;        /* header */
  --chat-blue: #4A90E2;        /* ✓✓ read ticks */
  --chat-bg: #EFE7DD;          /* conversation background */
  --chat-dot: rgba(18, 24, 47, .07);
  --chat-guest: #FFFFFF;       /* guest bubbles (left) */
  --chat-ai: #FCE3CC;          /* AI bubbles (right) */
  --chat-text: #1F2937;
  --chat-muted: #6B7280;

  width: 100%;
  max-width: 380px;
  height: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25); /* same as the old photo (shadow-2xl) */
  font-family: 'Inter', sans-serif;
  text-align: left;
  background: var(--chat-bg);
}
@media (max-width: 639px) { .chat-demo { max-width: none; } }

/* Header */
.chat-demo__header {
  background: var(--chat-navy);
  color: #fff;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  flex-shrink: 0;
}
.chat-demo__avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.chat-demo__who { flex: 1; min-width: 0; line-height: 1.25; }
.chat-demo__name { font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-demo__status { font-size: .75rem; color: rgba(255, 255, 255, .7); transition: color .2s; }
.chat-demo__status.is-typing { color: var(--chat-yellow); }
.chat-demo__live {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(255, 255, 255, .1);
  color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .06em;
  padding: .3rem .6rem; border-radius: 999px; flex-shrink: 0;
}

/* Messages */
.chat-demo__messages {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 1rem .875rem .5rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  background-color: var(--chat-bg);
  background-image: radial-gradient(var(--chat-dot) 1px, transparent 1.2px);
  background-size: 14px 14px;
  transition: opacity .4s ease;
}
.chat-demo__messages::-webkit-scrollbar { display: none; }
.chat-demo__messages.is-clearing { opacity: 0; }

.chat-msg {
  max-width: 82%;
  padding: .45rem .65rem .35rem;
  border-radius: 10px;
  font-size: .875rem;
  line-height: 1.4;
  color: var(--chat-text);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .08);
  overflow-wrap: anywhere;
  animation: chat-in .3s ease-out both;
}
.chat-msg--guest { align-self: flex-start; background: var(--chat-guest); border-top-left-radius: 2px; }
.chat-msg--ai { align-self: flex-end; background: var(--chat-ai); border-top-right-radius: 2px; }
.chat-msg__meta {
  display: flex; justify-content: flex-end; align-items: center; gap: .2rem;
  font-size: .68rem; color: var(--chat-muted); margin-top: .1rem;
}
.chat-msg__ticks { width: 16px; height: 11px; color: var(--chat-blue); }
.chat-msg__caret {
  display: inline-block; width: 1px; height: 1em; margin-left: 1px;
  background: var(--chat-text); vertical-align: -2px;
  animation: chat-blink .8s step-end infinite;
}

.chat-msg--typing { display: inline-flex; gap: 4px; padding: .7rem .8rem; }
.chat-msg--typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--chat-muted);
  animation: chat-dots 1s ease-in-out infinite;
}
.chat-msg--typing span:nth-child(2) { animation-delay: .15s; }
.chat-msg--typing span:nth-child(3) { animation-delay: .3s; }

/* Video attachment */
.chat-msg--video { padding: .3rem; width: 62%; }
.chat-msg__video {
  position: relative; aspect-ratio: 16 / 10; border-radius: 8px;
  background: linear-gradient(135deg, var(--chat-navy), #2B3A67);
  display: flex; align-items: center; justify-content: center;
}
.chat-msg__play {
  width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .9);
  display: flex; align-items: center; justify-content: center;
}
.chat-msg__play::before {
  content: ""; margin-left: 4px;
  border-left: 13px solid var(--chat-orange); border-top: 8px solid transparent; border-bottom: 8px solid transparent;
}
.chat-msg__video-label { font-size: .8rem; font-weight: 600; padding: .35rem .3rem .1rem; }

/* Footer — decorative only: faded, not clickable */
.chat-demo__footer {
  display: flex; align-items: center; gap: .5rem;
  padding: .6rem .75rem;
  background: var(--chat-bg);
  flex-shrink: 0;
  opacity: .5;
  cursor: default;
  pointer-events: none;
  user-select: none;
}
.chat-demo__input {
  flex: 1; background: #fff; border-radius: 999px;
  padding: .55rem 1rem; font-size: .875rem; color: #9CA3AF;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .06);
}
.chat-demo__send {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--chat-orange); color: #fff;
  display: flex; align-items: center; justify-content: center;
}

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

@keyframes chat-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes chat-blink { 50% { opacity: .25; } }
@keyframes chat-dots { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .chat-msg, .chat-msg--typing span { animation: none; }
  .chat-demo__messages { transition: none; }
}
