/**
 * Demo do celular WhatsApp na seção voz: mesma moldura do WhatsApp (use-case-phone-demo + use-case-chat-window),
 * conversa via dados, overlay da chamada. Layout e animações vêm de whatsapp-use-cases.css.
 */

/* Moldura igual ao RCS/SMS: borda escura (voz-channel-phone no HTML); janela encaixa nos cantos */
.voz-channel-phone .use-case-phone-demo .use-case-chat-window {
  border-radius: 26px;
  overflow: hidden;
}

.use-case-phone-demo .use-case-chat-window {
  display: flex;
  flex-direction: column;
  height: 480px;
  max-height: 480px;
  overflow: hidden;
}

.use-case-phone-demo {
  max-width: 275px !important;
}

.voz-wa-demo-chat.use-case-chat-body {
  min-height: 0 !important;
  max-height: none !important;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.use-case-chat-header-avatar {

  background: #ffffff !important;

}

[data-theme="dark"] .use-case-chat-header-avatar {
  background: #000000 !important;
}

.voz-wa-demo-chat {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 10px 14px;
  display: block;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.voz-wa-demo-chat::-webkit-scrollbar {
  width: 4px;
  height: 0;
}

.voz-wa-demo-chat::-webkit-scrollbar-track {
  background: transparent;
}

.voz-wa-demo-chat::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 4px;
}

.voz-wa-demo-chat:hover::-webkit-scrollbar-thumb,
.voz-wa-demo-chat:focus-within::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
}

.voz-wa-demo-chat::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.28);
}

/* Bolhas do cliente verdes (cor de card) */
.voz-wa-demo-chat .use-case-bubble--green {
  background: var(--whatsapp-light, #dcf8c6) !important;
  color: #1a1a1a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .voz-wa-demo-chat .use-case-bubble--green {
  background: #144d37 !important;
  color: #e7f5ec;
}

/* Layout compacto (sobrescreve use-case) */
.voz-wa-demo-chat .use-case-bubble {
  padding: 8px 10px;
}

.voz-wa-demo-chat .use-case-bubble--with-buttons .use-case-time {
  margin-bottom: 4px;
}

/* Quick replies e pulso nos chips */
.voz-wa-demo-quick-replies {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 5px;
}

/* Só o botão "Receber ligação" pulsa; após clicar fica desabilitado */
.voz-wa-demo-quick-replies--pulse .use-case-chip {
  animation: voz-wa-demo-chip-pulse 1.5s ease-in-out infinite;
}

.voz-wa-demo-chat .use-case-chip:disabled {
  opacity: 0.6;
  cursor: default;
  pointer-events: none;
}

@keyframes voz-wa-demo-chip-pulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.35);
  }

  50% {
    transform: scale(1.03);
    box-shadow: 0 0 0 6px rgba(37, 211, 102, 0);
  }
}

.voz-wa-demo-chat .use-case-chip {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
}

/* --- Overlay da chamada: fundo igual hero (claro/branco no light, escuro no dark) --- */
.voz-wa-demo-call {
  position: absolute;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, #e8f4f8 0%, #ffffff 45%, #f0f7fc 100%);
  display: none;
  flex-direction: column;
  z-index: 10;
}

[data-theme="dark"] .voz-wa-demo-call {
  background: var(--voz-call-screen-dark, #1c1b1f);
}

.voz-wa-demo-call.is-visible {
  display: flex;
}

.voz-wa-demo-screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: linear-gradient(180deg, #e8f4f8 0%, #ffffff 45%, #f0f7fc 100%);
}

[data-theme="dark"] .voz-wa-demo-screen {
  background:
    radial-gradient(120% 70% at 15% 15%, var(--wall-1-dark), transparent 60%),
    radial-gradient(120% 80% at 85% 35%, var(--wall-2-dark), transparent 62%),
    radial-gradient(90% 70% at 50% 95%, var(--wall-3-dark), transparent 60%),
    linear-gradient(180deg,
      var(--wall-base-1-dark),
      var(--wall-base-2-dark) 55%,
      var(--wall-base-2-dark) 100%);
}

.voz-wa-demo-screen.is-visible {
  display: flex;
}

/* Incoming: visual igual à hero – Celular, Short Code, deslize para atender */
.voz-wa-demo-screen--incoming {
  justify-content: flex-start;
  padding-top: 24px;
}

.voz-wa-demo-screen--incoming .voz-wa-demo-incoming-header {
  text-align: center;
  margin-bottom: 16px;
}

.voz-wa-demo-call-label {
  font-size: 12px;
  font-weight: 400;
  color: #5a6b78;
  display: block;
  margin-bottom: 4px;
}

[data-theme="dark"] .voz-wa-demo-call-label {
  color: rgba(255, 255, 255, 0.6);
}

.voz-wa-demo-caller-name {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] .voz-wa-demo-caller-name {
  color: #fff;
}

/* Área do botão atender: mesmo posicionamento do hero */
.voz-wa-demo-incoming-actions {
  position: absolute;
  bottom: 36px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  padding: 0 18px;
}

/* Slide "deslize para atender" igual ao hero (voz-phone) */
.voz-wa-demo-call .voz-slide-container {
  position: relative;
  width: 100%;
  max-width: 248px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voz-wa-demo-call .voz-slide-track {
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  height: 68px;
  border-radius: 36px;
  padding: 5px;
  display: flex;
  align-items: center;
  overflow: visible;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.08),
    0 2px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .voz-wa-demo-call .voz-slide-track {
  background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.22) 0%,
      rgba(255, 255, 255, 0.12) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.15),
    0 2px 20px rgba(0, 0, 0, 0.4);
}

.voz-wa-demo-call .voz-slide-track>div:not(.voz-slide-knob):not(.voz-slide-hint-arrow) {
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.7);
  padding-right: 20px;
}

[data-theme="dark"] .voz-wa-demo-call .voz-slide-track>div:not(.voz-slide-knob):not(.voz-slide-hint-arrow) {
  color: rgba(255, 255, 255, 0.9);
}

.voz-wa-demo-call .voz-slide-knob {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.25);
  transition:
    transform 0.12s ease,
    background 0.2s,
    box-shadow 0.2s;
  animation: voz-wa-demo-slide-knob-hint 2.2s ease-in-out infinite;
}

.voz-wa-demo-call .voz-slide-container:active .voz-slide-knob {
  transform: scale(0.95);
  background: #f2f2f2;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.voz-wa-demo-call .voz-slide-knob svg {
  width: 28px;
  height: 28px;
  fill: #34c759;
}

[data-theme="dark"] .voz-wa-demo-call .voz-slide-knob {
  background: linear-gradient(180deg, #f8f8f8 0%, #e8e8e8 100%);
  box-shadow:
    0 2px 0 0 rgba(255, 255, 255, 0.5),
    0 4px 16px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .voz-wa-demo-call .voz-slide-knob svg {
  fill: #30d158;
}

@keyframes voz-wa-demo-slide-knob-hint {

  0%,
  100% {
    transform: translateX(0);
  }

  35% {
    transform: translateX(6px);
  }

  70% {
    transform: translateX(0);
  }
}

.voz-wa-demo-call .voz-slide-hint-arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  color: rgba(0, 0, 0, 0.55);
  animation: voz-wa-demo-slide-arrow-pulse 1.8s ease-in-out infinite;
  pointer-events: none;
}

.voz-wa-demo-call .voz-slide-hint-arrow svg {
  width: 20px;
  height: 20px;
  display: block;
}

[data-theme="dark"] .voz-wa-demo-call .voz-slide-hint-arrow {
  color: rgba(255, 255, 255, 0.75);
}

@keyframes voz-wa-demo-slide-arrow-pulse {

  0%,
  100% {
    opacity: 0.5;
    transform: translateY(-50%) translateX(0);
  }

  50% {
    opacity: 1;
    transform: translateY(-50%) translateX(4px);
  }
}

/* Active: layout como segunda imagem – nome, timer verde, 6 botões, desligar */
.voz-wa-demo-screen--active {
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 10px;
}

.voz-wa-demo-active-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.voz-wa-demo-active-name {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
}

[data-theme="dark"] .voz-wa-demo-active-name {
  color: #fff;
}

/* Timer verde quando atendeu mas ainda está mudo (toque no alto-falante para ouvir) */
.voz-wa-demo-active-timer.voz-wa-demo-timer-waiting {
  color: #30d158;
  opacity: 0.95;
}

.voz-wa-demo-active-timer {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: #25d366;
}

[data-theme="dark"] .voz-wa-demo-active-timer {
  color: #30d158;
}

/* Grid 6 botões – maiores e legíveis; tema claro = ícones e texto escuros */
.voz-wa-demo-options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 18px;
  max-width: 100%;
  padding: 0 14px;
}

.voz-wa-demo-opt-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #1a1a1a;
  cursor: pointer;
  padding: 6px 0;
  transition: opacity 0.15s;
}

.voz-wa-demo-opt-btn:hover {
  opacity: 0.85;
}

[data-theme="dark"] .voz-wa-demo-opt-btn {
  color: rgba(255, 255, 255, 0.95);
}

.voz-wa-demo-opt-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(14, 107, 134, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.voz-wa-demo-opt-btn:hover .voz-wa-demo-opt-circle {
  background: rgba(14, 107, 134, 0.2);
}

[data-theme="dark"] .voz-wa-demo-opt-circle {
  background: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .voz-wa-demo-opt-btn:hover .voz-wa-demo-opt-circle {
  background: rgba(255, 255, 255, 0.2);
}

.voz-wa-demo-opt-circle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.voz-wa-demo-opt-circle--speaker {
  background: rgba(37, 211, 102, 0.2);
  color: #0d5c2e;
}

.voz-wa-demo-opt-circle--speaker .voz-wa-demo-speaker-icon--on {
  display: none;
}

.voz-wa-demo-opt-btn--speaker.is-unmuted .voz-wa-demo-speaker-icon--muted {
  display: none;
}

.voz-wa-demo-opt-btn--speaker.is-unmuted .voz-wa-demo-speaker-icon--on {
  display: block;
}

[data-theme="dark"] .voz-wa-demo-opt-circle--speaker {
  background: rgba(48, 209, 88, 0.4);
  color: #fff;
}

.voz-wa-demo-opt-label {
  font-size: 11px;
  font-weight: 500;
  color: inherit;
}

.voz-wa-demo-active-hangup {
  display: flex;
  justify-content: center;
  padding-bottom: 12px;
}

.voz-wa-demo-btn-hangup {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #ff3b30;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.15s,
    background 0.15s;
}

.voz-wa-demo-btn-hangup:hover {
  background: #e6342a;
  transform: scale(1.05);
}

.voz-wa-demo-btn-hangup:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.voz-wa-demo-btn-hangup svg {
  width: 28px;
  height: 28px;
}

/* Notificação WhatsApp durante a chamada (quase no fim do áudio) */
.voz-wa-demo-notif {
  position: absolute;
  top: -100px;
  left: 8px;
  right: 8px;
  z-index: 20;
  min-height: 56px;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #1c1c1e;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 2px 0 rgba(0, 0, 0, 0.04),
    0 8px 24px rgba(0, 0, 0, 0.12);
  transition: top 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.voz-wa-demo-notif.is-visible {
  top: 8px;
}

[data-theme="dark"] .voz-wa-demo-notif {
  background: rgba(44, 42, 48, 0.95);
  color: #f5f5f7;
  box-shadow:
    0 2px 0 rgba(0, 0, 0, 0.2),
    0 8px 24px rgba(0, 0, 0, 0.4);
}

.voz-wa-demo-notif-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.voz-wa-demo-notif-icon.bg-whatsapp {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .voz-wa-demo-notif-icon.bg-whatsapp {
  background: #000000;
  border-color: rgba(255, 255, 255, 0.14);
}

.voz-wa-demo-notif-icon img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.voz-wa-demo-notif-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.voz-wa-demo-notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.voz-wa-demo-notif-app {
  font-size: 12px;
  font-weight: 600;
  color: #25d366;
}

.voz-wa-demo-notif-time {
  font-size: 11px;
  color: #666;
}

[data-theme="dark"] .voz-wa-demo-notif-time {
  color: rgba(255, 255, 255, 0.6);
}

.voz-wa-demo-notif-title {
  font-size: 14px;
  font-weight: 700;
  display: block;
}

.voz-wa-demo-notif-body {
  font-size: 12px;
  color: #555;
  margin: 0;
  line-height: 1.3;
}

[data-theme="dark"] .voz-wa-demo-notif-body {
  color: rgba(255, 255, 255, 0.85);
}