@charset "utf-8";

/* Chat Icon */
#chatIcon {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 70px;
  height: 70px;
  cursor: pointer;
  z-index: 9999;
  border-radius: 50%;
  overflow: hidden;
  transition: transform 0.25s ease;
}

#chatIcon:hover {
  transform: scale(1.12) translateY(-3px);
}

/* Lottie + Image layering */
#chatIcon img,
#chatIcon lottie-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Fallback visible by default */
#chatFallback {
  object-fit: contain;
}

/* Hide fallback when lottie loads */
#chatIcon.lottie-loaded #chatFallback {
  display: none;
}

/* Pulse animation */
@keyframes chatPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(7,133,230,0.6);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(7,133,230,0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(7,133,230,0);
  }
}

#chatIcon.pulse {
  animation: chatPulse 2s infinite;
}

/* Prompt Bubble */
#chatPrompt {
  position: fixed;
  bottom: 100px;
  right: 20px;
  background: #fff;
  color: #070f20;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 11px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 9999;
  animation: promptFadeIn 0.5s ease forwards;
}

#promptClose {
  background: transparent;
  border: none;
  font-size: 14px;
  cursor: pointer;
  opacity: 0.6;
}

#promptClose:hover {
  opacity: 1;
}

#chatPrompt.hidden {
  display: none;
}

#chatPrompt::after {
  content: "";
  position: absolute;
  bottom: -8px;
  right: 28px;
  border-width: 8px 8px 0 8px;
  border-style: solid;
  border-color: #ffffff transparent transparent transparent;
}

/* Chat Popup */
#chatPopup {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 440px;
  height: 600px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.4);
  overflow: hidden;
  opacity: 0;
  transform: translateY(40px) scale(0.95);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

#chatPopup.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chat-header {
  height: 48px;
  background: #0785e6;
  color: #fff;
  padding: 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.chat-header button {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.85);
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.chat-header button:hover {
  transform: scale(1.1);
}

.chat-iframe {
  width: 100%;
  height: calc(100% - 48px);
  border: none;
}

/* Mobile */
@media (max-width: 768px) {
  #chatPopup {
    width: 100%;
    height: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }
}

@keyframes promptFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
