/* ==========================================================================
   Central 67 - Simulador B2B & Mock de WhatsApp
   ========================================================================== */

:root {
  --sim-wa-header: #075E54;
  --sim-wa-header-dark: #054C44;
  --sim-wa-bg: #EFEAE2;
  --sim-bubble-bot: #FFFFFF;
  --sim-bubble-user: #D9FDD3;
  --sim-accent-green: #25D366;
  --sim-text-dark: #111B21;
  --sim-text-muted: #667781;
  --sim-card-bg: #FFFFFF;
  --sim-border: rgba(255, 255, 255, 0.08);
}

.simulator-section {
  background: rgba(11, 19, 41, 0.85);
  padding: 50px 0 70px;
  border-top: 1px solid var(--border-glass);
  border-bottom: 1px solid var(--border-glass);
}

/* Integração Hero + Simulador */
.hero-showcase {
  padding-bottom: 60px;
}

.hero-container-single {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-content-center {
  max-width: 820px;
  text-align: center;
  margin-bottom: 40px;
}

.hero-content-center h1 {
  margin-left: auto;
  margin-right: auto;
}

.hero-content-center .hero-subtitle {
  margin-left: auto;
  margin-right: auto;
  max-width: 680px;
}

.hero-actions-center {
  justify-content: center;
}

.hero-stats-center {
  justify-content: center;
  margin-top: 24px;
}

.simulator-wrapper-hero {
  width: 100%;
  max-width: 1060px;
  margin-top: 20px;
  padding-top: 36px;
  border-top: 1px solid var(--border-glass);
}

.simulator-header-hero {
  text-align: center;
  margin-bottom: 28px;
}

#simulator-app {
  max-width: 1040px;
  margin: 0 auto;
}

.sim-container {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-radius: 20px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  border: 1px solid var(--border-accent);
}

@media (max-width: 960px) {
  .sim-container {
    border-radius: 16px;
  }
}

/* Tabs dos Segmentos */
.sim-tabs-wrapper {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.sim-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 4px;
}

.sim-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(21, 34, 68, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.sim-tab:hover {
  background: var(--bg-surface-hover);
  color: var(--text-main);
  border-color: var(--primary);
}

.sim-tab.active {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(226, 183, 116, 0.3);
}

.sim-tab-icon {
  font-size: 1.2rem;
}

/* Interface Mock WhatsApp */
.sim-phone-frame {
  display: flex;
  flex-direction: column;
  background: var(--sim-wa-bg);
  position: relative;
  height: 640px;
}

.sim-header {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--sim-wa-header);
  color: #ffffff;
  padding: 14px 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 2;
}

.sim-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

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

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

.sim-subtitle {
  font-size: 0.8rem;
  opacity: 0.85;
}

.sim-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-image: radial-gradient(#d1d7db 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Balões de Mensagem WhatsApp */
.sim-bubble {
  max-width: 84%;
  padding: 8px 12px;
  border-radius: 8px;
  position: relative;
  font-size: 0.92rem;
  line-height: 1.4;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.13);
  animation: simFadeIn 0.25s ease-out forwards;
}

@keyframes simFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sim-bubble-bot {
  align-self: flex-start;
  background: #FFFFFF;
  color: #111B21;
  border-top-left-radius: 0;
}

.sim-bubble-user {
  align-self: flex-end;
  background: #E7FFDB;
  color: #111B21;
  border-top-right-radius: 0;
}

.sim-bubble-content {
  word-break: break-word;
  white-space: pre-wrap;
}

.sim-bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  margin-top: 3px;
  font-size: 0.68rem;
  color: #667781;
}

.sim-check {
  color: #53BDEB;
  font-size: 0.75rem;
  font-weight: bold;
}

.sim-wa-link {
  color: #027EB5;
  text-decoration: underline;
  word-break: break-all;
}

/* Indicador Digitando */
.sim-typing-bubble {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  background: #FFFFFF;
}

.sim-typing-dot {
  width: 6px;
  height: 6px;
  background: #8696A0;
  border-radius: 50%;
  animation: simTyping 1.4s infinite ease-in-out;
}

.sim-typing-dot:nth-child(1) { animation-delay: 0s; }
.sim-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.sim-typing-dot:nth-child(3) { animation-delay: 0.4s; }

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

/* Quick Replies Chips */
.sim-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 16px;
  background: rgba(240, 242, 245, 0.95);
  border-top: 1px solid #D1D7DB;
  scrollbar-width: none;
}

.sim-chip {
  background: #FFFFFF;
  border: 1px solid #D1D7DB;
  border-radius: 16px;
  padding: 7px 14px;
  font-size: 0.82rem;
  color: #111B21;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  font-weight: 500;
}

.sim-chip:hover {
  background: #E9EDEF;
  border-color: #8696A0;
  color: #075E54;
}

/* Barra de Entrada */
.sim-input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #F0F2F5;
  border-top: 1px solid #D1D7DB;
}

.sim-input {
  flex: 1;
  padding: 10px 16px;
  background: #FFFFFF;
  border: 1px solid #FFFFFF;
  border-radius: 20px;
  color: #111B21;
  font-size: 0.93rem;
  outline: none;
  transition: border-color 0.2s;
}

.sim-input:focus {
  border-color: #075E54;
}

.sim-send-btn {
  width: 40px;
  height: 40px;
  background: #075E54;
  color: #FFFFFF;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  flex-shrink: 0;
}

.sim-send-btn:hover {
  background: #054C44;
}

.sim-send-btn:active {
  transform: scale(0.95);
}

/* Painel de Inteligência (Disposto Horizontalmente Abaixo do Chat) */
.sim-sidebar {
  background: #152244;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-left: none;
  border-top: 1px solid var(--border-glass);
  box-sizing: border-box;
  width: 100%;
}

.sim-sidebar-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 16px;
}

.sim-sidebar-header {
  flex: 1;
  min-width: 260px;
}

.sim-sidebar-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sim-sidebar-desc {
  font-size: 0.88rem;
  color: #94A3B8;
  line-height: 1.4;
}

.sim-state-wrapper {
  margin-bottom: 0;
  display: flex;
  align-items: center;
}

.sim-state-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border-glass);
}

.sim-state-badge[data-state="HANDOFF"] {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.4);
}

.sim-slots-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sim-slots-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
}

.sim-slots-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  width: 100%;
}

.sim-slot-empty {
  grid-column: 1 / -1;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 12px 16px;
  background: rgba(11, 19, 41, 0.4);
  border-radius: 8px;
  border: 1px dashed var(--border-glass);
}

.sim-slot-item {
  background: rgba(11, 19, 41, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s;
}

.sim-slot-item:hover {
  border-color: var(--primary);
}

.sim-slot-key {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.sim-slot-val {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  word-break: break-word;
}

.sim-sidebar-cta {
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: flex-end;
}

.sim-cta-btn {
  width: auto;
  min-width: 240px;
  justify-content: center;
}

@media (max-width: 768px) {
  .sim-sidebar {
    padding: 20px 16px;
  }
  .sim-sidebar-top-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .sim-cta-btn {
    width: 100%;
  }
}
