/* Global Styles & Variables */
:root {
  --whatsapp-teal: #005e54;
  --whatsapp-dark-green: #128c7e;
  --whatsapp-light-green: #25d366;
  --whatsapp-guest-bubble: #D9FDD2;
  --whatsapp-host-bubble: #ffffff;
  --whatsapp-bg: #efeae2;
  --text-dark: #303235;
  --text-light: #53676b;
  --font-main: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --choice-container-height: 0px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  height: 100%;
  width: 100%;
  font-family: var(--font-main);
  background-color: var(--whatsapp-bg);
  color: var(--text-dark);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#__next {
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  z-index: 9999;
}

/* Social Proof Live Counter Badge */
.live-proof-badge {
  position: fixed;
  top: 62px;
  right: 12px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  z-index: 999999;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  pointer-events: none;
  animation: fadeIn 0.4s ease;
}

.live-dot {
  width: 7px;
  height: 7px;
  background-color: #25d366;
  border-radius: 50%;
  box-shadow: 0 0 8px #25d366;
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

/* User Bar Header (WhatsApp style) */
.user-bar {
  width: 100%;
  height: 55px;
  background: var(--whatsapp-teal);
  color: #fff;
  padding: 0 12px;
  font-size: 24px;
  position: fixed;
  z-index: 99999;
  display: flex;
  align-items: center;
  top: 0;
  left: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.user-bar .back {
  font-size: 20px;
  cursor: pointer;
  margin-right: 6px;
  display: flex;
  align-items: center;
}

.user-bar .avatar {
  width: 36px;
  height: 36px;
  margin-right: 10px;
  flex-shrink: 0;
}

.user-bar .avatar img {
  border-radius: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1);
}

.user-bar .name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.user-bar .name span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
}

.user-bar .status {
  display: block;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 1px;
}

.user-bar .actions {
  font-size: 20px;
  margin-left: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.user-bar .actions:hover {
  opacity: 1;
}

/* Main Container */
.typebot-container {
  flex: 1;
  margin-top: 55px;
  display: flex;
  flex-direction: column;
  background-image: url('https://cdn.jsdelivr.net/gh/packtypebot/free-template-packtypebot/background-light.png');
  background-size: initial !important;
  background-repeat: repeat-x !important;
  background-color: #e5ddd5;
  height: calc(100vh - 55px);
  position: relative;
  overflow: hidden;
}

/* Chat View Area */
.typebot-chat-view {
  flex: 1;
  overflow-y: auto;
  padding: 20px 15px;
  padding-bottom: calc(75px + var(--choice-container-height));
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
  transition: padding-bottom 0.25s ease;
}

.typebot-chat-view > .flex:first-child {
  padding-top: 30px;
}

/* Commercial Account Warning Banner */
.info-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 10px 0 20px 0;
}

.info-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #d5f4f0;
  border-radius: 10px;
  padding: 10px 14px;
  width: fit-content;
  max-width: 450px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.05);
  font-size: 14px;
}

@media (max-width: 500px) {
  .info-container {
    max-width: 90% !important;
  }
}

.info-container p {
  color: #53676b;
  margin: 0;
  font-size: 13px;
  line-height: 1.3;
}

/* Messages Container */
.messages-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Host & Guest Message Bubbles */
.typebot-host-bubble,
.typebot-guest-bubble {
  position: relative;
  max-width: 85%;
  padding: 8px 12px 10px 12px;
  font-size: 15px;
  line-height: 1.45;
  box-shadow: 0 1px 1px rgba(0,0,0,0.13);
  word-wrap: break-word;
  animation: popIn 0.25s ease-out forwards;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Host Bubbles */
.typebot-host-bubble {
  align-self: flex-start;
  background-color: var(--whatsapp-host-bubble);
  color: var(--text-dark);
  border-radius: 0px 8px 8px 8px;
  margin-left: 42px;
  margin-bottom: 4px;
  padding-right: 14px;
}

.typebot-host-bubble::before,
.typebot-host-bubble > .bubble-typing::after {
  position: absolute;
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0px 10px 10px 0;
  border-color: transparent #fff transparent transparent;
  top: 0;
  left: -10px;
}

.items-start {
  display: flex;
  align-items: flex-start;
  position: relative;
}

.avatar-figure {
  position: absolute;
  left: -42px;
  top: 0;
  margin: 0;
}

.avatar-figure img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

/* Guest Bubbles */
.typebot-guest-bubble {
  align-self: flex-end;
  background-color: var(--whatsapp-guest-bubble);
  color: #000000;
  border-radius: 8px 0px 8px 8px;
  margin-right: 10px;
  margin-bottom: 4px;
}

.typebot-guest-bubble::after {
  position: absolute;
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0px 0 10px 10px;
  border-color: transparent transparent transparent var(--whatsapp-guest-bubble);
  top: 0;
  right: -10px;
}

/* Bubble Text Content */
.slate-html-container {
  margin-bottom: 4px;
}

.slate-html-container p {
  margin-bottom: 4px;
}

.slate-html-container p:last-child {
  margin-bottom: 0;
}

/* Timestamp & Double Check Icons */
.bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  float: right;
  margin-left: 12px;
  margin-top: 2px;
  font-size: 11px;
  color: #8696a0;
}

#checkIcon {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  z-index: 99;
}

#checkIcon path:nth-child(1) {  
  animation: showIcon 250ms ease forwards;
  animation-delay: 500ms;
}

#checkIcon path:nth-child(2) {  
  animation: showIcon 250ms ease forwards;
  animation-delay: 400ms;
}

@keyframes showIcon {
  to { stroke-dashoffset: 0; }
}

/* Typing Indicator Bubble */
.bubble-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: #ffffff;
  border-radius: 0 8px 8px 8px;
  position: relative;
  box-shadow: 0 1px 1px rgba(0,0,0,0.13);
  width: fit-content;
}

.dot {
  width: 7px;
  height: 7px;
  background-color: #9095A0;
  border-radius: 50%;
  animation: bounce 1.3s infinite ease-in-out;
}

.dot1 { animation-delay: 0s; }
.dot2 { animation-delay: 0.2s; }
.dot3 { animation-delay: 0.4s; }

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

/* Video Embed Frames - FULL UNCUT HEIGHT & PERMANENT VISIBILITY */
.typebot-embed-wrapper {
  width: 100%;
  max-width: 580px;
  margin: 10px 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.18);
  background-color: #000000;
  position: relative;
  display: block !important;
}

.typebot-embed-container {
  position: relative;
  width: 100%;
  height: 520px;
}

.typebot-embed-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

@media (max-width: 600px) {
  .typebot-embed-container {
    height: 380px;
  }
}

/* Input Container & Floating Choice Options */
.typebot-input-container {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 580px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: transparent;
  pointer-events: none;
}

.typebot-input-container * {
  pointer-events: auto;
}

.choice-options-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
  background: rgba(229, 221, 213, 0.94);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  box-shadow: 0 -2px 15px rgba(0,0,0,0.15);
  animation: slideUp 0.3s ease-out;
}

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

.typebot-button {
  background-color: var(--whatsapp-dark-green);
  color: #FFFFFF;
  border: none;
  border-radius: 25px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0,0,0,0.22);
  transition: transform 0.15s ease, background-color 0.2s, box-shadow 0.2s;
  text-align: center;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.3;
  flex-shrink: 0;
}

.typebot-button.btn-checkout-cta {
  background: linear-gradient(135deg, #128c7e 0%, #07c654 100%);
  font-size: 16px;
  font-weight: 800;
  padding: 16px 22px;
  animation: pulseGlow 1.8s infinite ease-in-out;
  box-shadow: 0 4px 15px rgba(7, 198, 84, 0.45);
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 15px rgba(7, 198, 84, 0.45); }
  50% { transform: scale(1.02); box-shadow: 0 6px 22px rgba(7, 198, 84, 0.7); }
}

.typebot-button:hover {
  background-color: #0d7065;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.28);
}

.typebot-button:active {
  transform: scale(0.98);
}

/* Realistic WhatsApp Footer Input Bar Mock */
.footer-input-mock {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  transition: opacity 0.2s, transform 0.2s;
}

.footer-input-mock.has-choices {
  display: none;
}

.mock-input-box {
  flex: 1;
  background: #ffffff;
  border-radius: 25px;
  height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.mock-icon {
  font-size: 22px;
  color: #8696a0;
  cursor: pointer;
}

.mock-icon.clip {
  transform: rotate(-45deg);
}

.mock-placeholder {
  flex: 1;
  font-size: 15px;
  color: #8696a0;
  user-select: none;
}

.mock-mic-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--whatsapp-dark-green);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  cursor: pointer;
  flex-shrink: 0;
}

/* Utilities */
.hide {
  display: none !important;
}

/* Audio Unlock Overlay */
.start-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.start-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 32px 24px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 12px 35px rgba(0,0,0,0.35);
  animation: fadeInCard 0.4s ease-out;
}

@keyframes fadeInCard {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.start-avatar {
  width: 84px;
  height: 84px;
  margin: 0 auto 16px auto;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--whatsapp-teal);
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

.start-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.start-card h2 {
  font-size: 20px;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.start-card p {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 24px;
  line-height: 1.4;
}

.start-btn {
  background-color: #25d366;
  color: #ffffff;
  border: none;
  border-radius: 30px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45);
  transition: transform 0.2s, background-color 0.2s;
}

.start-btn:hover {
  background-color: #20bd5a;
  transform: scale(1.03);
}

.security-foot {
  margin-top: 18px;
  font-size: 12px;
  color: #8696a0;
}
