/* chatbot.css - Chatbot UI Styles */

:root {
  --chat-primary: #e0072d;
  --chat-primary-hover: #b80524;
  --chat-bg: rgba(255, 255, 255, 0.95);
  --chat-text: #333333;
  --chat-border: rgba(224, 7, 45, 0.2);
  --chat-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  --bot-msg-bg: #f4f4f5;
  --user-msg-bg: var(--chat-primary);
  --user-msg-text: #ffffff;
}

/* Chatbot Container Variables */
#vg-chatbot-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: 'Inter', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* Chat Trigger Button */
.vg-chat-trigger {
  width: 60px;
  height: 60px;
  background-color: var(--chat-primary);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(224, 7, 45, 0.4);
  transition: transform 0.3s ease, background-color 0.3s ease;
  position: relative;
}

.vg-chat-trigger:hover {
  transform: scale(1.05);
  background-color: var(--chat-primary-hover);
}

.vg-chat-trigger svg {
  width: 30px;
  height: 30px;
  fill: #ffffff;
  transition: opacity 0.3s ease;
}

.vg-chat-trigger .close-icon {
  position: absolute;
  opacity: 0;
  width: 24px;
  height: 24px;
}

.vg-chat-trigger.open .chat-icon {
  opacity: 0;
}

.vg-chat-trigger.open .close-icon {
  opacity: 1;
}

/* Notification Badge */
.vg-chat-badge {
  position: absolute;
  top: 0;
  right: 0;
  background-color: #10b981;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid white;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Chat Window */
.vg-chat-window {
  width: 350px;
  height: 500px;
  max-height: calc(100vh - 100px);
  background: var(--chat-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--chat-border);
  border-radius: 16px;
  box-shadow: var(--chat-shadow);
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transform-origin: bottom right;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.vg-chat-window.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Header */
.vg-chat-header {
  background: linear-gradient(135deg, var(--chat-primary), #a60420);
  color: white;
  padding: 16px;
  display: flex;
  align-items: center;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

.vg-chat-avatar {
  width: 40px;
  height: 40px;
  background-color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.vg-chat-avatar svg {
  width: 24px;
  height: 24px;
  fill: var(--chat-primary);
}

.vg-chat-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.vg-chat-title p {
  margin: 0;
  font-size: 12px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #ffffff;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
}

/* Messages Area */
.vg-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: rgba(255, 255, 255, 0.5);
}

.vg-chat-messages::-webkit-scrollbar {
  width: 6px;
}

.vg-chat-messages::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.1);
  border-radius: 4px;
}

.msg-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  animation: slideIn 0.3s ease forwards;
}

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

.msg-bot {
  align-self: flex-start;
}

.msg-user {
  align-self: flex-end;
}

.msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.msg-bot .msg-bubble {
  background-color: var(--bot-msg-bg);
  color: var(--chat-text);
  border-bottom-left-radius: 4px;
}

.msg-user .msg-bubble {
  background-color: var(--user-msg-bg);
  color: var(--user-msg-text);
  border-bottom-right-radius: 4px;
}

/* Action Buttons within Bot Messages */
.vg-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.vg-chat-action-btn {
  background: white;
  border: 1px solid var(--chat-primary);
  color: var(--chat-primary);
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  flex: 1 1 calc(50% - 8px);
  text-align: center;
}

.vg-chat-action-btn:hover {
  background: var(--chat-primary);
  color: white;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background-color: var(--bot-msg-bg);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  width: fit-content;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: #999;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Input Area */
.vg-chat-input-area {
  padding: 12px;
  background: white;
  border-top: 1px solid rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  gap: 8px;
}

.vg-chat-input {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  background-color: #f8fafc;
}

.vg-chat-input:focus {
  border-color: var(--chat-primary);
  background-color: white;
}

.vg-chat-send {
  background: var(--chat-primary);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: white;
  transition: transform 0.2s, background-color 0.2s;
}

.vg-chat-send:hover {
  background: var(--chat-primary-hover);
  transform: scale(1.05);
}

.vg-chat-send svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.vg-chat-send:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  transform: none;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .vg-chat-window {
    width: calc(100vw - 40px);
    height: calc(100vh - 120px);
  }
}
