/* Voiceflow Custom Launcher Style - Expertise.ai inspired */

#vf-custom-launcher {
  position: fixed;
  bottom: 25px; /* Slightly higher for visibility */
  left: 50%;
  transform: translateX(-50%) translateY(120px); /* Initially hidden off-screen */
  opacity: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  background: rgba(8, 8, 21, 0.85);
  border: 1.5px solid rgba(79, 82, 180, 0.5);
  border-radius: 50px;
  padding: 8px 15px;
  box-shadow: 0 0 25px rgba(79, 82, 180, 0.4), 0 0 50px rgba(79, 82, 180, 0.15);
  width: 90%;
  max-width: 550px;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
  cursor: pointer;
  backdrop-filter: blur(20px);
  pointer-events: none; /* Disable interaction when hidden */
}

#vf-custom-close {
  position: absolute;
  top: -10px;
  right: -8px; /* Moved further right, floating outside slightly */
  background: #4F52B4; /* Brand color instead of white */
  color: #FFFFFF; /* White icon */
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(79, 82, 180, 0.4);
  z-index: 10001;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
}

#vf-custom-launcher:hover #vf-custom-close {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-2px);
}

#vf-custom-close:hover {
  transform: scale(1.1) translateY(-2px);
  background: #5d61d1; /* Brighter brand color instead of white/grey */
}

@keyframes vf-pulse-glow {
  0% {
    box-shadow: 0 0 20px rgba(79, 82, 180, 0.4), 0 0 40px rgba(79, 82, 180, 0.15);
    border-color: rgba(79, 82, 180, 0.5);
  }
  50% {
    box-shadow: 0 0 35px rgba(79, 82, 180, 0.7), 0 0 70px rgba(79, 82, 180, 0.3);
    border-color: rgba(79, 82, 180, 1);
  }
  100% {
    box-shadow: 0 0 20px rgba(79, 82, 180, 0.4), 0 0 40px rgba(79, 82, 180, 0.15);
    border-color: rgba(79, 82, 180, 0.5);
  }
}

#vf-custom-launcher.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto; /* Enable interaction when visible */
  animation: vf-pulse-glow 3s infinite ease-in-out;
}

#vf-custom-launcher:hover {
  box-shadow: 0 0 35px rgba(79, 82, 180, 0.7), 0 0 70px rgba(79, 82, 180, 0.3);
  transform: translateX(-50%) translateY(-5px);
  border-color: rgba(79, 82, 180, 1);
  background: rgba(8, 8, 21, 0.95);
}

#vf-custom-launcher input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 15px;
  font-family: inherit;
  font-size: 16px;
  outline: none;
  color: #FFFFFF; /* White text for dark mode */
}

#vf-custom-launcher input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

#vf-custom-launcher .icon {
  width: 24px;
  height: 24px;
  margin-left: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
}

#vf-custom-launcher .send-btn {
  background: #4F52B4;
  color: white;
  border: none;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

#vf-custom-launcher .send-btn:hover {
  transform: scale(1.1);
}

#vf-custom-launcher .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #4F52B4;
  margin-right: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  font-weight: bold;
}

/* Fix Voiceflow widget positioning when open to be centered */
.vfrc-widget {
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  bottom: 100px !important; /* Move it up to avoid overlapping our custom bar */
  width: 90% !important;
  max-width: 450px !important;
  border-radius: 20px !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
  transition: all 0.3s ease-in-out !important;
}

/* Ensure the launcher stays hidden */
.vfrc-launcher {
  display: none !important;
}

@media (max-width: 600px) {
  #vf-custom-launcher {
    width: 95%;
    bottom: 15px;
  }
  .vfrc-widget {
    bottom: 80px !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 70vh !important;
    border-radius: 20px 20px 0 0 !important;
  }
}
