/* Floating AI Chat Button */
.ai-chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.ai-chat-fab:hover {
  transform: scale(1.05);
}

.ai-chat-fab__button {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #667eea 100%);
  background-size: 300% 300%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
  border: none;
  position: relative;
  animation: gradientShift 8s ease infinite;
  cursor: pointer;
}

.ai-chat-fab__button::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2, #f093fb, #4facfe, #00f2fe);
  background-size: 300% 300%;
  opacity: 0.6;
  filter: blur(12px);
  z-index: -1;
  animation: gradientShift 8s ease infinite, pulse 3s ease-in-out infinite;
}

.ai-chat-fab__icon {
  width: 32px;
  height: 32px;
  color: white;
  position: relative;
  z-index: 1;
  animation: float 3s ease-in-out infinite;
}

.ai-chat-fab__tooltip {
  background: white;
  color: #1a1a2e;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateX(10px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
}

.ai-chat-fab__tooltip::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, #667eea, #764ba2, #f093fb, #4facfe);
  border-radius: 12px;
  z-index: -1;
  opacity: 0.5;
  animation: gradientShift 8s ease infinite;
}

.ai-chat-fab__tooltip::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 0 8px 8px;
  border-color: transparent transparent transparent white;
}

.ai-chat-fab__tooltip.show {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* Sparkles Effect */
.ai-chat-fab__sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: white;
  border-radius: 50%;
  pointer-events: none;
}

.ai-chat-fab__sparkle:nth-child(1) {
  top: 10%;
  left: 20%;
  animation: sparkle 2s ease-in-out infinite;
}

.ai-chat-fab__sparkle:nth-child(2) {
  top: 80%;
  left: 80%;
  animation: sparkle 2.5s ease-in-out infinite 0.5s;
}

.ai-chat-fab__sparkle:nth-child(3) {
  top: 30%;
  right: 15%;
  animation: sparkle 3s ease-in-out infinite 1s;
}

.ai-chat-fab__sparkle:nth-child(4) {
  bottom: 20%;
  left: 15%;
  animation: sparkle 2.2s ease-in-out infinite 1.5s;
}

/* Animations */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

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

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

/* Hide on chat page */
body[data-page="chat"] .ai-chat-fab {
  display: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .ai-chat-fab {
    bottom: 16px;
    right: 16px;
  }
  
  .ai-chat-fab__button {
    width: 56px;
    height: 56px;
  }
  
  .ai-chat-fab__icon {
    width: 28px;
    height: 28px;
  }
  
  .ai-chat-fab__tooltip {
    font-size: 13px;
    padding: 10px 14px;
  }
}
