/* ==========================================================================
   Interactive WhatsApp Mobile Simulator (Live Sandbox)
   Dockable phone tester allowing real-time buyer conversations with AI Sultan
   ========================================================================== */

/* Floating Launch Button */
.simulator-floating-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--primary-500);
  color: #064E35;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg), 0 0 0 3px rgba(0, 231, 133, 0.3);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 50;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.simulator-floating-toggle:hover {
  transform: translateY(-2px);
  background: var(--primary-600);
  color: #FFFFFF;
}

/* Simulator Modal / Drawer */
.simulator-drawer {
  position: fixed;
  top: 0;
  right: -460px;
  width: 440px;
  height: 100vh;
  background: #FFFFFF;
  box-shadow: -5px 0 25px rgba(0,0,0,0.15);
  z-index: 60;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.simulator-drawer.open {
  right: 0;
}

.simulator-drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF;
}

.simulator-drawer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--slate-900);
}

.simulator-body {
  flex: 1;
  background: var(--slate-100);
  padding: 16px;
  display: flex;
  justify-content: center;
  overflow-y: auto;
}

/* Phone Bezel Frame */
.mobile-device-frame {
  width: 100%;
  max-width: 380px;
  background: #000000;
  border-radius: 40px;
  padding: 10px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25), inset 0 0 2px 2px #334155;
  display: flex;
  flex-direction: column;
  position: relative;
  height: 720px;
}

/* Dynamic Island */
.phone-notch {
  width: 110px;
  height: 24px;
  background: #000000;
  border-radius: 20px;
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.notch-camera {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #111827;
}

/* Phone Screen */
.phone-screen {
  flex: 1;
  background: #EFEAE2;
  border-radius: 32px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Phone Status Bar */
.phone-status-bar {
  height: 38px;
  background: #075E54;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 20px 6px;
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 600;
}

/* WhatsApp In-App Header */
.phone-wa-header {
  background: #075E54;
  color: #FFFFFF;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.phone-wa-identity {
  display: flex;
  align-items: center;
  gap: 8px;
}

.phone-wa-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #075E54;
  font-size: 0.9rem;
}

.phone-wa-names h5 {
  color: #FFFFFF;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.phone-wa-names span {
  font-size: 0.68rem;
  color: #A7F3D0;
  display: block;
}

/* Phone Chat Body */
.phone-chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-image: radial-gradient(#CBD5E1 1px, transparent 1px);
  background-size: 16px 16px;
}

.sim-msg {
  max-width: 82%;
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.35;
  box-shadow: 0 1px 1px rgba(0,0,0,0.08);
}

.sim-msg.user {
  background: #E7FCE3;
  align-self: flex-end;
  border-top-right-radius: 2px;
}

.sim-msg.bot {
  background: #FFFFFF;
  align-self: flex-start;
  border-top-left-radius: 2px;
}

.sim-time {
  font-size: 0.65rem;
  color: var(--slate-400);
  text-align: right;
  margin-top: 2px;
}

/* Typing indicator in simulator */
.sim-typing {
  align-self: flex-start;
  background: #FFFFFF;
  padding: 8px 12px;
  border-radius: 12px;
  display: none;
  align-items: center;
  gap: 4px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.08);
}

.sim-typing.active {
  display: flex;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--slate-400);
  animation: typingBounce 1.2s infinite ease-in-out;
}

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

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Phone Quick Prompt Chips */
.phone-quick-prompts {
  padding: 8px 10px;
  background: #F8FAFC;
  border-top: 1px solid var(--slate-200);
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.quick-chip {
  padding: 4px 8px;
  border-radius: var(--radius-full);
  background: #FFFFFF;
  border: 1px solid var(--slate-200);
  font-size: 0.72rem;
  color: var(--slate-700);
  white-space: nowrap;
  cursor: pointer;
}

.quick-chip:hover {
  background: var(--primary-50);
  border-color: var(--primary-300);
  color: var(--primary-800);
}

/* Phone Composer */
.phone-composer {
  padding: 8px 10px;
  background: #F0F2F5;
  display: flex;
  align-items: center;
  gap: 8px;
}

.phone-composer input {
  flex: 1;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 20px;
  padding: 7px 12px;
  font-size: 0.82rem;
}

.phone-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #00A884;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* WhatsApp Flow Modal Simulator */
.wa-flow-sheet {
  position: absolute;
  bottom: -100%;
  left: 0;
  right: 0;
  background: #FFFFFF;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
  transition: bottom 0.25s ease;
  z-index: 25;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wa-flow-sheet.open {
  bottom: 0;
}
