.icon-btn .icon-lucide,
.icon-btn.icon-lucide {
  width: 1.125rem;
  height: 1.125rem;
}

.chatbot-fab-icon--close .icon-lucide.icon-fab-close,
.chatbot-fab-icon--close svg.icon-fab-close {
  width: 1.25rem;
  height: 1.25rem;
  max-width: 1.25rem;
  max-height: 1.25rem;
}

.contact-popup-close-icon.icon-lucide {
  width: 1.25rem;
  height: 1.25rem;
}

.contact-submit-check.icon-lucide {
  width: 1rem;
  height: 1rem;
}

.chatbot-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1050;
}

#chatbot-toggle {
  width: 4rem;
  height: 4rem;
  border: none;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  padding: 0;
  transition: transform 0.2s, background 0.25s;
  position: relative;
  background: transparent;
}

.chatbot-fab-body {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
}

.chatbot-fab-icon--open img {
  animation: chatbotImgFloat 3s ease-in-out infinite;
}

.chatbot-eye-bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e0f2fe, #22d3ee 55%, #0891b2);
  box-shadow: 0 0 5px rgba(34, 211, 238, 0.9);
  opacity: 0;
  z-index: 3;
  pointer-events: none;
  transform: translate(-50%, 0);
}

.chatbot-eye-bubble-1 {
  width: 5px;
  height: 5px;
  left: 38%;
  top: 36%;
  animation: chatbotEyeBubble 2.2s ease-out infinite;
}

.chatbot-eye-bubble-2 {
  width: 9px;
  height: 9px;
  left: 58%;
  top: 32%;
  animation: chatbotEyeBubble 2.6s ease-out infinite;
  animation-delay: 0.5s;
}

.chatbot-eye-bubble-3 {
  width: 4px;
  height: 4px;
  left: 48%;
  top: 34%;
  animation: chatbotEyeBubble 2s ease-out infinite;
  animation-delay: 1s;
}

@keyframes chatbotImgFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes chatbotEyeBubble {
  0% {
    transform: translate(-50%, 0) scale(0.2);
    opacity: 0;
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -2px) scale(0.7);
  }
  70% {
    opacity: 0.85;
  }
  100% {
    transform: translate(-50%, -14px) scale(1);
    opacity: 0;
  }
}

#chatbot-toggle.is-open .chatbot-eye-bubble {
  animation: none;
  opacity: 0;
}

#chatbot-toggle.is-open .chatbot-fab-icon--open img {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .chatbot-fab-icon--open img,
  .chatbot-eye-bubble {
    animation: none !important;
  }
}

#chatbot-toggle:hover {
  transform: scale(1.05);
}

#chatbot-toggle.is-open {
  background: linear-gradient(135deg, #06b6d4, #2563eb);
  box-shadow: 0 12px 40px rgba(6, 182, 212, 0.45);
}

.chatbot-fab-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s, transform 0.2s;
}

.chatbot-fab-icon--close {
  color: #fff;
  font-size: 1.5rem;
  opacity: 0;
  transform: rotate(-90deg) scale(0.8);
}

#chatbot-toggle.is-open .chatbot-fab-icon--open {
  opacity: 0;
  transform: scale(0.8);
}

#chatbot-toggle.is-open .chatbot-fab-icon--close {
  opacity: 1;
  transform: rotate(0) scale(1);
}

#chatbot-toggle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#chatbot-window {
  position: absolute;
  bottom: 5.5rem;
  right: 0;
  width: 24rem;
  max-width: calc(100vw - 2rem);
  height: 37.5rem;
  max-height: calc(100vh - 9rem);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  border: 1px solid #e5e7eb;
  background: #fff;
}

#chatbot-window .chat-header {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, var(--dcube-cyan), var(--dcube-blue));
  color: #fff;
  padding: 1.5rem;
}

.chat-header-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background-image: radial-gradient(circle, #fff 1px, transparent 1px);
  background-size: 20px 20px;
  animation: chatPatternSlide 8s linear infinite;
  pointer-events: none;
}

@keyframes chatPatternSlide {
  0% { transform: translateX(0); }
  100% { transform: translateX(20px); }
}

.chat-header-inner {
  position: relative;
  z-index: 1;
}

.chat-header-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  animation: chatHeaderAvatarPulse 2s ease-in-out infinite;
}

.chat-header-avatar .icon-bot {
  width: 1.5rem;
  height: 1.5rem;
  color: #fff;
  animation: chatHeaderIconWiggle 3s ease-in-out infinite;
}

@keyframes chatHeaderAvatarPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes chatHeaderIconWiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(10deg); }
  75% { transform: rotate(-10deg); }
}

.chat-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.9;
  font-size: 0.875rem;
}

.chat-status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #4ade80;
  animation: chatStatusPulse 1.5s ease-in-out infinite;
}

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

#chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  background: #f9fafb;
}

.chat-bubble {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.chat-bubble.bot {
  background: #fff;
  border: 1px solid #e5e7eb;
}

.chat-bubble.user {
  background: linear-gradient(90deg, var(--dcube-cyan), var(--dcube-blue));
  color: #fff;
  margin-left: auto;
}

.chat-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-avatar-bot {
  background: linear-gradient(135deg, var(--dcube-cyan), var(--dcube-blue));
}

.chat-avatar-user {
  background: linear-gradient(135deg, #6b7280, #4b5563);
}

.chat-avatar .icon-bot,
.chat-avatar .icon-user {
  width: 1rem;
  height: 1rem;
  color: #fff;
}

.chat-footer {
  padding: 1rem;
  background: #fff;
  border-top: 1px solid #e5e7eb;
}

.chat-input-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.chat-input {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25;
  color: #111827;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input::placeholder {
  color: #9ca3af;
}

.chat-input:focus {
  outline: none;
  border-color: #06b6d4;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
  background: #fff;
}

.chat-send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  min-width: 3rem;
  padding: 0;
  border: none;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #06b6d4, #2563eb);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  box-shadow: 0 8px 20px rgba(6, 182, 212, 0.4);
  transform: scale(1.05);
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.chat-footer-note {
  margin: 0.5rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  color: #9ca3af;
}

/* dcube-services index only — smaller close FAB when chat is open */
body:has(.hero-section) #chatbot-toggle.is-open {
  width: 3.25rem;
  height: 3.25rem;
}

body:has(.hero-section) #chatbot-toggle.is-open .chatbot-fab-icon--close {
  font-size: 1.125rem;
}

body:has(.hero-section) #chatbot-toggle.is-open .chatbot-fab-icon--close .icon-lucide.icon-fab-close,
body:has(.hero-section) #chatbot-toggle.is-open .chatbot-fab-icon--close svg.icon-fab-close {
  width: 1.125rem;
  height: 1.125rem;
  max-width: 1.125rem;
  max-height: 1.125rem;
}

body:has(.hero-section) #chatbot-window {
  bottom: 4.25rem;
}
