/* ═══════════════════════════════════════════════════════════
   AGENTS MOCKUP — agents-mockup.css
   Prefixo: am-

   Painel Percio + chat fiel ao WhatsApp Web/Desktop dark mode.
   Tokens oficiais: #111B21 / #202C33 / #2A3942 / #005C4B / #25D366
   ═══════════════════════════════════════════════════════════ */

.am-showcase {
  position: relative;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  isolation: isolate;
}

.am-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: clamp(10px, 1.6vw, 16px);
  border-radius: 22px;
  background:
    radial-gradient(ellipse 95% 85% at 50% 25%,
      rgba(118, 56, 234, 0.12) 0%,
      rgba(42, 8, 135, 0.05) 50%,
      transparent 80%),
    var(--surface-section, #1D1A38);
  border: 1px solid rgba(172, 150, 255, 0.10);
  overflow: hidden;
}

.am-panel::before {
  content: '';
  position: absolute;
  inset: -20%;
  background: radial-gradient(ellipse 50% 45% at 70% 30%,
    rgba(245, 132, 26, 0.05) 0%,
    transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Janela do produto */
.am-window {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  border-radius: 14px;
  background: #111B21;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 12px 40px rgba(0, 0, 0, 0.55),
    0 28px 72px rgba(42, 8, 135, 0.22);
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px) scale(0.97);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.am-showcase.is-inview .am-window {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Chrome */
.am-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #1A242B;
  border-bottom: 1px solid #222D34;
}

.am-dots {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.am-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  box-shadow: inset 0 -0.5px 0.5px rgba(0, 0, 0, 0.25);
}

.am-dot--r { background: #FF5F57; }
.am-dot--y { background: #FEBC2E; }
.am-dot--g { background: #28C840; }

.am-chrome-label {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #8696A0;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.am-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(245, 132, 26, 0.16);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: var(--brand-burnt-orange, #F5841A);
  letter-spacing: 0.02em;
}

.am-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-burnt-orange, #F5841A);
  box-shadow: 0 0 8px rgba(245, 132, 26, 0.7);
  animation: amLivePulse 1.8s ease-in-out infinite;
}

@keyframes amLivePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

/* ── WhatsApp UI (tokens reais) ── */
.am-wa {
  --wa-bg: #0B141A;
  --wa-panel: #202C33;
  --wa-composer: #2A3942;
  --wa-out: #005C4B;
  --wa-in: #2A3942;
  --wa-text: #E9EDEF;
  --wa-muted: #8696A0;
  --wa-green: #00A884;
  --wa-check: #53BDEB;
  --wa-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  display: flex;
  flex-direction: column;
  height: clamp(440px, 62vw, 560px);
  background: var(--wa-bg);
  font-family: var(--wa-font);
  -webkit-font-smoothing: antialiased;
}

.am-wa-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 8px 10px;
  background: var(--wa-panel);
  border-bottom: 1px solid #1a2329;
  flex-shrink: 0;
  min-height: 56px;
}

.am-wa-back {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--wa-muted);
  padding: 2px;
}

.am-wa-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #211E3D;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.am-wa-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.am-wa-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}

.am-wa-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--wa-text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}

.am-wa-status {
  font-size: 12px;
  color: var(--wa-muted);
  line-height: 1.2;
  transition: color 0.2s ease;
}

.am-wa-status.is-typing {
  color: var(--wa-green);
}

.am-wa-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--wa-muted);
  flex-shrink: 0;
  padding-left: 4px;
}

.am-wa-actions svg {
  width: 22px;
  height: 22px;
  display: block;
}

/* Body + wallpaper doodle (padrão clássico WA) */
.am-wa-body {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px 12px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(134, 150, 160, 0.3) transparent;
  background-color: var(--wa-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1' opacity='0.035'%3E%3Ccircle cx='24' cy='30' r='7'/%3E%3Cpath d='M50 22h14M57 15v14'/%3E%3Crect x='80' y='18' width='14' height='14' rx='2'/%3E%3Cpath d='M110 20c6 0 10 4 10 10s-4 10-10 10-10-4-10-10 4-10 10-10z'/%3E%3Cpath d='M140 18l8 14h-16z'/%3E%3Cpath d='M20 70c0-6 8-6 8 0v12c0 6-8 6-8 0z'/%3E%3Ccircle cx='52' cy='78' r='3'/%3E%3Ccircle cx='62' cy='78' r='3'/%3E%3Ccircle cx='72' cy='78' r='3'/%3E%3Cpath d='M95 68h18v12H95z'/%3E%3Cpath d='M125 70l12 6-12 6z'/%3E%3Cpath d='M155 68c8 0 8 16 0 16s-8-16 0-16z'/%3E%3Cpath d='M22 120h16l-8 14z'/%3E%3Crect x='52' y='118' width='16' height='12' rx='6'/%3E%3Cpath d='M88 118c0 8 12 8 12 0s-12-8-12 0'/%3E%3Cpath d='M118 120h20M128 112v16'/%3E%3Ccircle cx='160' cy='126' r='8'/%3E%3Cpath d='M30 158c10-4 18 6 10 12'/%3E%3Cpath d='M70 155l8 4 8-4v10l-8 4-8-4z'/%3E%3Cpath d='M110 158h18v8h-18z'/%3E%3Cpath d='M145 152c6 0 10 5 10 10h-20c0-5 4-10 10-10z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 180px 180px;
}

.am-wa-date {
  align-self: center;
  padding: 5px 11px;
  border-radius: 7.5px;
  background: #182229;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--wa-muted);
  margin: 4px 0 8px;
  letter-spacing: 0.02em;
}

.am-wa-notice {
  align-self: center;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  max-width: 95%;
  padding: 7px 10px 8px;
  border-radius: 7.5px;
  background: #182229;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  font-size: 11px;
  line-height: 1.45;
  color: #FFD279;
  text-align: left;
  margin-bottom: 10px;
}

.am-wa-notice svg {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  margin-top: 2px;
  color: #FFD279;
}

/* Bolhas — geometria WhatsApp */
.am-msg {
  position: relative;
  max-width: 85%;
  padding: 6px 7px 4px 9px;
  border-radius: 7.5px;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition:
    opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.am-msg.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.am-msg p {
  margin: 0;
  font-size: 13.2px;
  line-height: 1.42;
  color: var(--wa-text);
  font-weight: 400;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Meta flutuante no canto inferior direito (layout real WA) */
.am-msg-meta {
  float: right;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 2px 0 -3px 10px;
  position: relative;
  top: 4px;
}

.am-msg-time {
  font-size: 10.5px;
  color: var(--wa-muted);
  line-height: 15px;
  letter-spacing: 0.02em;
  user-select: none;
}

.am-msg--out {
  align-self: flex-end;
  background: var(--wa-out);
  border-top-right-radius: 0;
  margin-bottom: 4px;
}

.am-msg--out .am-msg-time {
  color: rgba(255, 255, 255, 0.55);
}

.am-msg--in {
  align-self: flex-start;
  background: var(--wa-in);
  border-top-left-radius: 0;
  margin-bottom: 4px;
}

/* Mensagens empilhadas do mesmo lado: arredonda o topo da cauda */
.am-msg--in + .am-msg--in {
  border-top-left-radius: 7.5px;
  margin-top: 1px;
}

.am-msg--in + .am-msg--in::before {
  display: none;
}

/* Cauda das bolhas (SVG via mask/pseudo) */
.am-msg--out::before {
  content: '';
  position: absolute;
  top: 0;
  right: -7px;
  width: 8px;
  height: 13px;
  background: var(--wa-out);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.am-msg--in::before {
  content: '';
  position: absolute;
  top: 0;
  left: -7px;
  width: 8px;
  height: 13px;
  background: var(--wa-in);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.am-checks {
  display: inline-flex;
  color: var(--wa-check);
  width: 16px;
  height: 11px;
  margin-left: 1px;
}

.am-checks svg {
  width: 16px;
  height: 11px;
  display: block;
}

/* Typing */
.am-typing {
  align-self: flex-start;
  display: none;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
  margin: 2px 0 4px;
  border-radius: 7.5px;
  border-top-left-radius: 0;
  background: var(--wa-in);
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  position: relative;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.am-typing::before {
  content: '';
  position: absolute;
  top: 0;
  left: -7px;
  width: 8px;
  height: 13px;
  background: var(--wa-in);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.am-typing.is-on {
  display: inline-flex;
  opacity: 1;
  transform: translateY(0);
}

.am-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--wa-muted);
  animation: amTypingDot 1.2s ease-in-out infinite;
}

.am-typing span:nth-child(2) { animation-delay: 0.15s; }
.am-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes amTypingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-3px); opacity: 1; }
}

/* Footer / composer — layout mobile WA */
.am-wa-input {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 8px 8px;
  background: #1A242B;
  flex-shrink: 0;
}

.am-wa-plus {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wa-muted);
  flex-shrink: 0;
  background: transparent;
}

.am-wa-plus svg {
  width: 24px;
  height: 24px;
}

.am-wa-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 21px;
  background: var(--wa-composer);
  min-height: 42px;
}

.am-wa-field-emoji {
  flex-shrink: 0;
  color: var(--wa-muted);
  display: flex;
}

.am-wa-field-emoji svg,
.am-wa-field-icons svg {
  width: 22px;
  height: 22px;
  display: block;
}

.am-wa-placeholder {
  flex: 1;
  font-size: 14.5px;
  color: var(--wa-muted);
  line-height: 1.2;
  font-weight: 400;
}

.am-wa-field-icons {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--wa-muted);
  flex-shrink: 0;
}

.am-wa-mic {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--wa-green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.am-wa-mic svg {
  width: 20px;
  height: 20px;
  fill: #111B21;
}

/* ── Quick replies (pop-up de soluções) ── */
.am-wa-footer {
  position: relative;
  flex-shrink: 0;
}

.am-wa-quick {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: calc(100% + 5px);
  z-index: 6;
  padding: 6px;
  border-radius: 12px;
  background: rgba(24, 34, 41, 0.97);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(172, 150, 255, 0.24);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 14px 34px rgba(0, 0, 0, 0.5),
    0 4px 14px rgba(42, 8, 135, 0.22);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.am-wa-quick.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.am-wa-quick-head {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 4px 5px;
  font-size: 9.5px;
  font-weight: 500;
  color: var(--wa-muted);
  letter-spacing: 0.02em;
}

.am-wa-quick-head svg {
  width: 11px;
  height: 11px;
  color: #AC96FF;
  flex-shrink: 0;
}

.am-wa-quick-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.am-quick-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(42, 57, 66, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--wa-text);
  font-family: var(--wa-font);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease;
}

.am-quick-chip:hover {
  background: rgba(118, 56, 234, 0.16);
  border-color: rgba(172, 150, 255, 0.5);
  transform: translateY(-1px);
}

.am-quick-chip:active {
  transform: translateY(0);
}

.am-quick-chip-ic {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(145deg, rgba(172, 150, 255, 0.3), rgba(42, 8, 135, 0.3));
  color: #E1D9FF;
}

.am-quick-chip-ic svg {
  width: 13px;
  height: 13px;
}

.am-quick-chip-txt {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

.am-quick-chip-arrow {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--wa-muted);
  opacity: 0.55;
  transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.am-quick-chip:hover .am-quick-chip-arrow {
  color: #E1D9FF;
  opacity: 1;
  transform: translateX(2px);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .am-window {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .am-msg {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .am-live-dot,
  .am-typing span {
    animation: none;
  }
  .am-wa-quick {
    transition: none;
  }
}

@media (max-width: 1024px) {
  .am-showcase { max-width: 460px; }
  .am-panel {
    padding: 12px;
  }
  .am-wa { height: clamp(440px, 68vw, 520px); }
}

@media (max-width: 600px) {
  .am-panel {
    padding: 10px;
    border-radius: 18px;
  }
  .am-window {
    border-radius: 12px;
  }
  .am-chrome-label { font-size: 11px; }
  .am-wa { height: 460px; }
  .am-wa-name { font-size: 14px; }
  .am-msg p { font-size: 12.8px; }
}
