/* Vivid Chat Widget Stylesheet */
:root {
  --vivid-chat-primary: #FC4D36;
  --vivid-chat-primary-hover: #e03f29;
  --vivid-chat-bg: #1e1e24;
  --vivid-chat-window-bg: rgba(22, 22, 28, 0.95);
  --vivid-chat-text-main: #f5f5f7;
  --vivid-chat-text-muted: #9a9ab0;
  --vivid-chat-border: rgba(255, 255, 255, 0.08);
  --vivid-chat-bubble-bot: #2c2c35;
  --vivid-chat-bubble-user: #FC4D36;
  --vivid-chat-radius: 16px;
  --vivid-chat-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Floating Launcher */
#vivid-chat-widget-root {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999999;
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-sizing: border-box;
}

#vivid-chat-widget-root * {
  box-sizing: border-box;
}

#vivid-chat-launcher {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--vivid-chat-primary);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(252, 77, 54, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#vivid-chat-launcher:hover {
  transform: scale(1.1) rotate(5deg);
  background-color: var(--vivid-chat-primary-hover);
  box-shadow: 0 6px 20px rgba(252, 77, 54, 0.6);
}

#vivid-chat-launcher svg {
  width: 28px;
  height: 28px;
  transition: transform 0.25s ease;
}

/* Chat Window */
#vivid-chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: 580px;
  border-radius: var(--vivid-chat-radius);
  background: var(--vivid-chat-window-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--vivid-chat-border);
  box-shadow: var(--vivid-chat-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
  transform-origin: bottom right;
}

.vivid-chat-window-hidden {
  opacity: 0;
  transform: scale(0.85) translate(10px, 20px);
  pointer-events: none;
}

.vivid-chat-window-visible {
  opacity: 1;
  transform: scale(1) translate(0, 0);
  pointer-events: auto;
}

/* Chat Header */
.vivid-chat-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
  border-bottom: 1px solid var(--vivid-chat-border);
}

.vivid-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vivid-chat-avatar-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.vivid-chat-avatar-svg {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.vivid-chat-avatar-svg svg {
  width: 20px;
  height: 20px;
}

.vivid-chat-bot-name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.3px;
}

.vivid-chat-bot-status {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.vivid-chat-status-dot {
  width: 7px;
  height: 7px;
  background-color: #00e676;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px #00e676;
  animation: pulse 2s infinite;
}

.vivid-chat-header-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.vivid-chat-header-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transform: rotate(9deg);
}

.vivid-chat-header-close svg {
  width: 18px;
  height: 18px;
}

/* Chat Body */
.vivid-chat-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.vivid-chat-body::-webkit-scrollbar {
  width: 4px;
}

.vivid-chat-body::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* Message Bubbles */
.vivid-chat-msg {
  display: flex;
  width: 100%;
}

.vivid-chat-msg-bot {
  justify-content: flex-start;
}

.vivid-chat-msg-user {
  justify-content: flex-end;
}

.vivid-chat-msg-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.vivid-chat-msg-bot .vivid-chat-msg-bubble {
  background-color: var(--vivid-chat-bubble-bot);
  color: var(--vivid-chat-text-main);
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.vivid-chat-msg-user .vivid-chat-msg-bubble {
  background-color: var(--vivid-chat-bubble-user);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(252, 77, 54, 0.2);
}

/* Suggestions chips */
.vivid-chat-chips {
  padding: 10px 16px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  max-height: 110px;
  overflow-y: auto;
}

.vivid-chat-chip-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--vivid-chat-primary);
  color: var(--vivid-chat-primary);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-weight: 500;
}

.vivid-chat-chip-btn:hover {
  background-color: var(--vivid-chat-primary);
  color: #ffffff !important;
  transform: translateY(-1px);
}

/* Chat Footer / Input */
.vivid-chat-footer {
  padding: 14px 18px 10px;
  border-top: 1px solid var(--vivid-chat-border);
  background-color: rgba(16, 16, 20, 0.8);
}

.vivid-chat-input-wrapper {
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--vivid-chat-border);
  border-radius: 24px;
  padding: 6px 14px;
  transition: border-color 0.2s;
}

.vivid-chat-input-wrapper:focus-within {
  border-color: rgba(252, 77, 54, 0.5);
  background-color: rgba(255, 255, 255, 0.06);
}

#vivid-chat-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--vivid-chat-text-main);
  font-size: 13.5px;
  padding: 4px 6px;
  resize: none;
  max-height: 70px;
  font-family: inherit;
  line-height: 1.4;
}

#vivid-chat-input::placeholder {
  color: var(--vivid-chat-text-muted);
}

#vivid-chat-send {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

#vivid-chat-send:hover {
  background-color: rgba(255, 255, 255, 0.06);
  transform: scale(1.08) translate(1px, -1px);
}

#vivid-chat-send svg {
  width: 18px;
  height: 18px;
}

.vivid-chat-brand {
  text-align: center;
  font-size: 10px;
  color: var(--vivid-chat-text-muted);
  margin-top: 8px;
  letter-spacing: 0.2px;
}

.vivid-chat-brand a {
  color: var(--vivid-chat-text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.vivid-chat-brand a:hover {
  color: var(--vivid-chat-primary);
  text-decoration: underline;
}

/* Typing Indicator Animation */
.vivid-chat-typing-indicator .vivid-chat-msg-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 18px;
}

.vivid-chat-typing-indicator .dot {
  width: 6px;
  height: 6px;
  background-color: var(--vivid-chat-text-muted);
  border-radius: 50%;
  opacity: 0.5;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}

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

/* Keyframe Animations */
@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(0, 230, 118, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0); }
}

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

.vivid-chat-animate-fade-in {
  animation: message-fade-in 0.25s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;
}

@keyframes message-fade-in {
  0% { opacity: 0; transform: translateY(12px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Responsive Rules */
@media (max-width: 450px) {
  #vivid-chat-widget-root {
    bottom: 0px !important;
    right: 0px !important;
    left: 0px !important;
    width: 100% !important;
  }
  
  #vivid-chat-launcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
  }

  .vivid-chat-opened #vivid-chat-launcher {
    display: none; /* Hide when chat window is active on mobile */
  }

  #vivid-chat-window {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
  }
  
  .vivid-chat-window-hidden {
    transform: translateY(100%);
  }

  .vivid-chat-window-visible {
    transform: translateY(0);
  }
}
