/* Opto Vida Chat Bot - Bubble CSS */

#vida-chatbot-bubble {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 380px;
  height: 500px;
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 12px;
  box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu",
    "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
}

#vida-chatbot-bubble.is-closed {
  display: none;
}

#vida-chatbot-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: auto !important;
  min-width: 112px;
  max-width: calc(100vw - 32px);
  height: 48px !important;
  padding: 0 16px;
  border: 0;
  border-radius: 999px !important;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.06em;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  z-index: 10000;
}

#vida-chatbot-launcher.is-visible {
  display: flex;
  animation: vidaLauncherPulse 3s ease-in-out infinite;
}

@keyframes vidaLauncherPulse {
  0%,
  100% {
    transform: translateZ(0) scale(1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  }
  50% {
    transform: translateZ(0) scale(1.03);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.34);
  }
}

@media (prefers-reduced-motion: reduce) {
  #vida-chatbot-launcher.is-visible {
    animation: none;
  }
}

/* Header */
.vida-chatbot-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 16px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.vida-chatbot-title {
  font-weight: 600;
  font-size: 15px;
}

.vida-chatbot-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.3s;
}

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

/* Messages Container */
.vida-chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f9fafb;
}

/* Message Bubbles */
.vida-chatbot-message {
  display: flex;
  margin-bottom: 8px;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.vida-chatbot-message.user {
  justify-content: flex-end;
}

.vida-chatbot-message.bot {
  justify-content: flex-start;
}

.vida-chatbot-message-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 12px;
  word-wrap: break-word;
  font-size: 14px;
  line-height: 1.4;
}

.vida-chatbot-message.user .vida-chatbot-message-bubble {
  background: #667eea;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.vida-chatbot-message.bot .vida-chatbot-message-bubble {
  background: #e8eaed;
  color: #202124;
  border-bottom-left-radius: 4px;
}

/* Form */
.vida-chatbot-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #dcdcde;
  flex-shrink: 0;
  background: #fff;
  border-radius: 0 0 12px 12px;
}

.vida-chatbot-input {
  flex: 1;
  border: 1px solid #dcdcde;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.vida-chatbot-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.vida-chatbot-send {
  background: #667eea;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  font-weight: 600;
  flex-shrink: 0;
}

.vida-chatbot-send:hover {
  background: #5568d3;
}

.vida-chatbot-send:active {
  transform: scale(0.95);
}

.vida-chatbot-send.is-waiting,
.vida-chatbot-send:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.vida-chatbot-input:disabled {
  background: #f3f4f6;
  color: #6b7280;
  cursor: not-allowed;
}

/* Typing Indicator */
.vida-chatbot-typing .vida-chatbot-message-bubble {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.vida-chatbot-typing-text {
  font-size: 13px;
  color: #4b5563;
}

.vida-chatbot-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.vida-chatbot-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #667eea;
  animation: vidaTypingPulse 1s infinite ease-in-out;
}

.vida-chatbot-typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.vida-chatbot-typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes vidaTypingPulse {
  0%,
  80%,
  100% {
    transform: scale(0.7);
    opacity: 0.45;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Product Cards */
.vida-chat-products {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.vida-product-card {
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  gap: 12px;
  transition: all 0.2s;
  cursor: pointer;
}

.vida-product-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-color: #667eea;
}

.vida-product-image {
  width: 70px;
  height: 70px;
  object-fit: cover;
  flex-shrink: 0;
}

.vida-product-info {
  flex: 1;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.vida-product-title {
  font-size: 12px;
  font-weight: 600;
  margin: 0;
  color: #202124;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.vida-product-price {
  font-size: 13px;
  color: #667eea;
  font-weight: 600;
  margin: 4px 0 0 0;
}

.vida-product-link {
  font-size: 11px;
  color: #667eea;
  text-decoration: none;
  margin-top: 4px;
  transition: color 0.2s;
}

.vida-product-link:hover {
  color: #764ba2;
  text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  #vida-chatbot-bubble {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .vida-chatbot-header {
    border-radius: 0;
  }

  .vida-chatbot-form {
    border-radius: 0;
  }

  .vida-chatbot-message-bubble {
    max-width: 85%;
    font-size: 13px;
  }

  #vida-chatbot-launcher {
    right: 14px;
    bottom: 14px;
    width: auto !important;
    min-width: 96px;
    max-width: calc(100vw - 28px);
    height: 44px;
    padding: 0 12px;
    font-size: 12px;
  }
}

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

.vida-chatbot-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.vida-chatbot-messages::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}

.vida-chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: #999;
}
