/**
 * Wenamy AI Chatbot Styles
 * Luxury floating chat widget
 */

/* Chatbot Widget Container */
#wenamy-chatbot {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999;
  font-family: 'Inter', sans-serif;
}

/* Toggle Button */
.chatbot-toggle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0a101d 0%, #1b263b 100%);
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(10, 16, 29, 0.4);
  transition: all 0.3s ease;
  position: relative;
  user-select: none;
  touch-action: none;
}

.chatbot-toggle:active {
  cursor: grabbing;
}

.chatbot-toggle:hover {
  box-shadow: 0 6px 25px rgba(10, 16, 29, 0.5);
}

.chatbot-toggle img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  pointer-events: none;
}

/* TALK TO ME Bubble */
.chatbot-bubble {
  position: absolute;
  bottom: 58px;
  right: 0;
  background: #ffffff;
  color: #0a101d;
  padding: 0.5rem 0.875rem;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
  animation: bubblePop 3s ease-in-out infinite;
  pointer-events: none;
  letter-spacing: 0.3px;
}

.chatbot-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 20px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #ffffff;
}

@keyframes bubblePop {
  0%, 100% { 
    opacity: 0;
    transform: translateY(10px) scale(0.9);
  }
  20%, 80% { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#wenamy-chatbot.chatbot-open .chatbot-bubble {
  display: none;
}

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

/* Chat Container */
.chatbot-container {
  position: absolute;
  bottom: 65px;
  right: 0;
  width: 380px;
  height: 500px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#wenamy-chatbot.chatbot-open .chatbot-container {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Header */
.chatbot-header {
  background: linear-gradient(135deg, #0a101d 0%, #1b263b 100%);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.chatbot-avatar {
  width: 44px;
  height: 44px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.chatbot-avatar img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.chatbot-info {
  flex: 1;
}

.chatbot-info h4 {
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.chatbot-status {
  color: #25d366;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.chatbot-status::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #25d366;
  border-radius: 50%;
  animation: blink 2s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.chatbot-close {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.chatbot-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.chatbot-close svg {
  width: 18px;
  height: 18px;
  color: #ffffff;
}

/* Messages Area */
.chatbot-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chatbot-message {
  display: flex;
  flex-direction: column;
  max-width: 85%;
}

.chatbot-message.user {
  align-self: flex-end;
}

.chatbot-message.bot {
  align-self: flex-start;
}

.message-bubble {
  padding: 1rem 1.25rem;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.chatbot-message.user .message-bubble {
  background: linear-gradient(135deg, #0a101d 0%, #1b263b 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chatbot-message.bot .message-bubble {
  background: #ffffff;
  color: #333333;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.message-time {
  font-size: 0.7rem;
  color: rgba(0, 0, 0, 0.4);
  margin-top: 0.25rem;
  padding: 0 0.5rem;
}

.chatbot-message.user .message-time {
  text-align: right;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 1rem 1.25rem !important;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-10px); }
}

/* Input Area */
.chatbot-input-container {
  padding: 1rem 1.5rem;
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  gap: 0.75rem;
}

.chatbot-input {
  flex: 1;
  padding: 0.875rem 1.25rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 100px;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: all 0.3s ease;
}

.chatbot-input:focus {
  border-color: #0a101d;
  box-shadow: 0 0 0 3px rgba(10, 16, 29, 0.1);
}

.chatbot-input::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

.chatbot-send {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #0a101d 0%, #1b263b 100%);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.chatbot-send:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(10, 16, 29, 0.3);
}

.chatbot-send svg {
  width: 20px;
  height: 20px;
  color: #ffffff;
}

/* Scrollbar Styling */
.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* Mobile Responsive */
@media (max-width: 480px) {
  #wenamy-chatbot {
    bottom: 1rem;
    right: 1rem;
  }
  
  .chatbot-toggle {
    width: 54px;
    height: 54px;
  }
  
  .chatbot-toggle svg {
    width: 24px;
    height: 24px;
  }
  
  .chatbot-container {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 70vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }
  
  #wenamy-chatbot.chatbot-open .chatbot-container {
    transform: translateY(0);
  }
}

/* Hide on very small screens if needed */
@media (max-width: 320px) {
  .chatbot-container {
    height: 80vh;
  }
}
