/* ==========================================================================
   Interactive RCS Demo — frontpage
   Adds ONLY the interactive layer on top of rcsexamples.css (phone frame,
   cards, carousel, chips are reused unchanged). All rules are scoped to
   .rcs-demo so the shared preview styles on /rcs/ are never affected.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Section layout
   -------------------------------------------------------------------------- */
.rcs-demo-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
}

.rcs-demo-tab {
  font: inherit;
  cursor: pointer;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: #d1d5db;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.rcs-demo-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.rcs-demo-tab[aria-selected="true"] {
  background: #e91e8c;
  border-color: #e91e8c;
  color: #fff;
}

.rcs-demo-layout {
  display: flex;
  gap: 48px;
  align-items: center;
  justify-content: center;
}

.rcs-demo-phone-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.rcs-demo-restart {
  font: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: #9aa0a6;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  transition: color 0.2s;
}

.rcs-demo-restart:hover {
  color: #fff;
}

/* --------------------------------------------------------------------------
   Phone frame — scoped overrides for an accumulating, scrollable transcript
   (the shared .rcs-message-area anchors a single message with flex-end)
   -------------------------------------------------------------------------- */
.rcs-demo .rcs-phone-frame {
  position: relative; /* anchor for the in-phone toast */
}

.rcs-phone-frame{
  zoom:1.1;
}

.rcs-demo .rcs-message-area {
  justify-content: flex-start; /* grow downward */
  flex: none;                  /* opt out of flex-grow so height is hard-pinned */
  height: 460px;               /* fixed, real-phone screen height */
  min-height: 0;
  box-sizing: border-box;
  overflow-y: auto;
  overscroll-behavior: auto;   /* chain to the page once the chat hits top/bottom */
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.rcs-demo .rcs-msg-block {
  margin-bottom: 14px;
  animation: rcs-msg-in 0.28s ease;
}

.rcs-demo .rcs-msg-block:last-child {
  margin-bottom: 0;
}

.rcs-demo .rcs-time-block {
  animation: none;
}

@keyframes rcs-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   Chip Suggestions (from _rcs-message.scss)
   -------------------------------------------------------------------------- */
.rcs-chip-suggestions {
  zoom:0.8;
}

/* Real <button> chips/buttons that keep the exact reused visual classes */
.rcs-demo button.chip-suggestion,
.rcs-demo button.card-action-button {
  font: inherit;
  cursor: pointer;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  text-align: center;
}

.rcs-demo .rcs-chip-suggestions button.chip-suggestion {
  width: auto;
}

.rcs-demo button.chip-suggestion:hover:not(:disabled) {
  background: #1976d2;
  color: #fff;
}

.rcs-demo button.chip-suggestion:hover:not(:disabled) .material-icons {
  color: #fff;
}

.rcs-demo button.card-action-button:hover:not(:disabled) {
  background: #f4f9ff;
}

.rcs-demo button.chip-suggestion:disabled,
.rcs-demo button.card-action-button:disabled {
  opacity: 0.5;
  cursor: default;
}

/* --------------------------------------------------------------------------
   Outgoing (user) bubble + read receipt  — NEW
   -------------------------------------------------------------------------- */
.rcs-demo .rcs-outgoing-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.rcs-demo .rcs-outgoing-message {
  background: #1a73e8;
  color: #fff;
  padding: 9px 14px;
  border-radius: 16px 16px 4px 16px;
  font-size: 13px;
  line-height: 1.4;
  max-width: 85%;
  word-wrap: break-word;
}

.rcs-demo .rcs-read-receipt {
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.rcs-demo .rcs-read-receipt .material-icons {
  font-size: 15px;
  color: #9aa0a6;
  transition: color 0.3s ease;
}

.rcs-demo .rcs-read-receipt.is-read .material-icons {
  color: #1a73e8;
}

/* --------------------------------------------------------------------------
   Typing indicator  — NEW
   -------------------------------------------------------------------------- */
.rcs-demo .rcs-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  padding: 11px 14px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.rcs-demo .rcs-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b0b0b0;
  animation: rcs-typing-bounce 1.2s infinite ease-in-out;
}

.rcs-demo .rcs-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.rcs-demo .rcs-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes rcs-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30%           { transform: translateY(-4px); opacity: 1; }
}

/* --------------------------------------------------------------------------
   Toast / snackbar (inside the phone)  — NEW
   -------------------------------------------------------------------------- */
.rcs-demo .rcs-toast {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 78px;
  background: #323232;
  color: #fff;
  font-size: 12.5px;
  line-height: 1.35;
  padding: 11px 14px;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  z-index: 5;
  text-align: left;
}

.rcs-demo .rcs-toast.is-visible {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   CTA card  — NEW (thin rich-card variant with a real signup link)
   -------------------------------------------------------------------------- */
.rcs-demo .rcs-cta-card {
  border: 1.5px solid #e91e8c;
}

.rcs-demo .rcs-cta-banner {
  height: 64px;
  background: linear-gradient(135deg, #e91e8c, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px 12px 0 0;
  display: none;
}

.rcs-demo .rcs-cta-banner .material-icons {
  color: #fff;
  font-size: 32px;
}

.rcs-demo .rcs-cta-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #e91e8c;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.rcs-demo .rcs-cta-button:hover {
  background: #d1187e;
}

/* Force white on the label + icon so no global/link color can hide them */
.rcs-demo .rcs-cta-button,
.rcs-demo .rcs-cta-button .rcs-cta-label,
.rcs-demo .rcs-cta-button .material-icons {
  color: #fff !important;
}

.rcs-demo .rcs-cta-label {
  font-family: inherit;
}

.rcs-demo .rcs-cta-button .material-icons {
  font-size: 16px;
}

/* --------------------------------------------------------------------------
   Feature ticker  — NEW
   -------------------------------------------------------------------------- */
.rcs-ticker-wrap {
  min-width: 210px;
  zoom: 1.2;
}

.rcs-ticker-title {
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

.rcs-feature-ticker {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.rcs-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #9aa0a6;
  font-size: 14px;
  transition: color 0.3s ease;
}

.rcs-feature-icon {
  display: inline-flex;
  align-items: center;
}

.rcs-feature-icon .material-icons {
  font-size: 20px;
}

.rcs-feature-icon .mi-off {
  color: #4b5563;
}

.rcs-feature-icon .mi-on {
  display: none;
  color: #22c55e;
}

.rcs-feature.is-lit {
  color: #e5e7eb;
}

.rcs-feature.is-lit .mi-off {
  display: none;
}

.rcs-feature.is-lit .mi-on {
  display: inline-flex;
  animation: rcs-pop 0.3s ease;
}

@keyframes rcs-pop {
  0%   { transform: scale(0.4); opacity: 0; }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* --------------------------------------------------------------------------
   Responsive — ticker collapses under the phone as a badge row
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .rcs-demo-layout {
    flex-direction: column;
    gap: 24px;
  }

  .rcs-demo .rcs-message-area {
    height: 440px;
  }

  .rcs-ticker-wrap {
    min-width: 0;
    width: 100%;
  }

  .rcs-ticker-title {
    text-align: center;
  }

  .rcs-feature-ticker {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 14px;
  }

  .rcs-feature {
    font-size: 12px;
    gap: 5px;
  }

  .rcs-feature-icon .material-icons {
    font-size: 16px;
  }

  .rcs-demo-phone-col {
    zoom: 0.92;
  }

  .rcs-demo-tabs {
    flex-direction: column;
    align-items: stretch;
  }

  .rcs-demo-tab {
    width: 100%;
    text-align: center;
  }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .rcs-demo .rcs-msg-block,
  .rcs-feature.is-lit .mi-on {
    animation: none;
  }

  .rcs-demo .rcs-typing-dot {
    animation: none;
  }

  .rcs-demo .rcs-message-area {
    scroll-behavior: auto;
  }
}

/* Hide carousel dots inside the demo phones */
.rcs-demo .carousel-indicators {
  display: none;
}

/* Mobile: chips sit flush under the last message in the demo */
@media (max-width: 768px) {
  .rcs-demo .rcs-chip-suggestions {
    margin-top: 0;
  }
}

/* Second tab row below the demo */
.rcs-demo-tabs--bottom {
  margin-bottom: 0;
}
