/* ── Layout do simulador ── */
.simulator-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--background);
}

/* Topbar do simulador (simula cabeçalho de app de mensagens) */
.sim-header {
  background: var(--primary);
  color: #fff;
  padding: .75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .875rem;
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.sim-header-back {
  background: none;
  border: none;
  color: rgba(255,255,255,.85);
  padding: .3rem;
  margin-left: -.3rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
}

.sim-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.sim-header-info { flex: 1; }

.sim-header-name {
  font-weight: 600;
  font-size: .9375rem;
  line-height: 1.2;
}

.sim-header-status {
  font-size: .75rem;
  color: rgba(255,255,255,.75);
}

.sim-header-actions {
  display: flex;
  gap: .25rem;
}

.sim-header-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.85);
  padding: .4rem;
  border-radius: var(--radius-sm);
  display: flex; align-items: center;
  transition: background .12s;
}
.sim-header-btn:hover { background: rgba(255,255,255,.15); }
.sim-header-btn svg { width: 18px; height: 18px; }

/* ── Área de mensagens ── */
.sim-messages {
  flex: 1;
  overflow-y: auto;
  padding: .875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .375rem;
  background: #e5ded8;
  /* textura sutil */
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='5' cy='5' r='1' fill='%23c9c0b5' opacity='.3'/%3E%3C/svg%3E");
}

.sim-date-divider {
  text-align: center;
  margin: .5rem 0;
}
.sim-date-divider span {
  background: rgba(255,255,255,.75);
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 600;
  padding: .2rem .7rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

/* Balões */
.sim-msg {
  display: flex;
  max-width: 72%;
  flex-direction: column;
}

.sim-msg.inbound  { align-self: flex-start; }
.sim-msg.outbound { align-self: flex-end; }

.sim-bubble {
  padding: .55rem .875rem;
  border-radius: var(--radius-lg);
  font-size: .9rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
}

.sim-msg.inbound .sim-bubble {
  background: #fff;
  color: var(--text);
  border-top-left-radius: var(--radius-sm);
}

.sim-msg.outbound .sim-bubble {
  background: #d9fdd3;
  color: #111;
  border-top-right-radius: var(--radius-sm);
}

.sim-msg-time {
  font-size: .68rem;
  color: rgba(0,0,0,.4);
  margin-top: .2rem;
  padding: 0 .25rem;
}

.sim-msg.outbound .sim-msg-time { text-align: right; }

/* Indicador de digitação */
.sim-typing {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .55rem .875rem;
  background: #fff;
  border-radius: var(--radius-lg);
  border-top-left-radius: var(--radius-sm);
  width: fit-content;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
  align-self: flex-start;
}

.sim-typing span {
  display: inline-block;
  width: 7px; height: 7px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing-dot 1.2s infinite ease-in-out;
}

.sim-typing span:nth-child(2) { animation-delay: .2s; }
.sim-typing span:nth-child(3) { animation-delay: .4s; }

@keyframes typing-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

/* ── Input area ── */
.sim-input-area {
  background: #f0f2f5;
  padding: .625rem .75rem;
  display: flex;
  align-items: flex-end;
  gap: .5rem;
  flex-shrink: 0;
  border-top: 1px solid rgba(0,0,0,.08);
}

.sim-input {
  flex: 1;
  background: #fff;
  border: none;
  border-radius: var(--radius-xl);
  padding: .65rem 1rem;
  font-size: .9375rem;
  line-height: 1.4;
  outline: none;
  resize: none;
  max-height: 100px;
  overflow-y: auto;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
  color: var(--text);
}

.sim-input::placeholder { color: var(--text-light); }

.sim-send-btn {
  width: 42px; height: 42px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s, transform .1s;
}
.sim-send-btn:hover   { background: var(--primary-dark); }
.sim-send-btn:active  { transform: scale(.93); }
.sim-send-btn:disabled { opacity: .5; pointer-events: none; }
.sim-send-btn svg { width: 20px; height: 20px; }

/* ── Nav de voltar (simulador em tela cheia) ── */
.sim-back-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .5rem 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .875rem;
  color: var(--text-muted);
}
.sim-back-bar a { color: var(--primary); }

/* ── Demo notice ── */
.demo-notice {
  background: var(--warning-light);
  color: #78350f;
  font-size: .8rem;
  text-align: center;
  padding: .4rem 1rem;
  border-bottom: 1px solid #fde68a;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .sim-msg { max-width: 88%; }
}
