:root {
  --primary-color: #6366f1;
  --secondary-color: #a855f7;
  --bg-dark: #0f172a;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --bot-msg-bg: #1e293b;
  --user-msg-bg: #4f46e5;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --primary-gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}


* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}



/* Floating Action Button */
#launcher-wrapper {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 120px;
  height: 120px;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#launcher-text-svg {
  position: absolute;
  width: 120%;
  height: 120%;
  top: -10%;
  pointer-events: none;
}

#chat-widget-launcher {
  position: relative;
  width: 65px;
  height: 65px;
  border-radius: 50%;
  background: var(--primary-gradient);
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  z-index: 2;
  color: white;
}

#chat-widget-launcher svg {
  width: 30px;
  height: 30px;
  fill: white;
}

#chat-widget-launcher:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 30px rgba(79, 70, 229, 0.6);
}

textPath {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  fill: rgba(255, 255, 255, 0.85);
}

#chat-widget-launcher:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 15px 35px rgba(99, 102, 241, 0.6);
}

#chat-widget-launcher svg {
  width: 30px;
  height: 30px;
  fill: white;
}

/* Chat Container */
#chat-widget-container {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 400px;
  height: 600px;
  max-width: calc(100vw - 60px);
  max-height: calc(100vh - 150px);
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 1000;
  overflow: hidden;
}

#chat-widget-container.active {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
}

/* Header */
.chat-header {
  padding: 20px;
  background: linear-gradient(to right, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bot-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bot-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: white;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

#bot-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.bot-status {
  display: flex;
  flex-direction: column;
}

.bot-name {
  font-weight: 600;
  font-size: 1rem;
}

.status-indicator {
  font-size: 0.75rem;
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
}

/* Message Area */
.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border) transparent;
}

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

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 10px;
}

.message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  position: relative;
  animation: messageIn 0.3s ease-out;
}

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

.bot-message {
  align-self: flex-start;
  background: var(--bot-msg-bg);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--glass-border);
}

/* Markdown Rendering Styles */
.bot-message p { margin-bottom: 8px; }
.bot-message p:last-child { margin-bottom: 0; }
.bot-message ul, .bot-message ol { 
  margin-left: 18px; 
  margin-bottom: 8px; 
}
.bot-message li { margin-bottom: 4px; }
.bot-message a { color: var(--secondary-color); font-weight: 600; }

.user-message {
  align-self: flex-end;
  background: var(--user-msg-bg);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

/* Input Area */
.chat-input-container {
  padding: 15px 20px 25px;
  background: rgba(15, 23, 42, 0.5);
  border-top: 1px solid var(--glass-border);
}

.chat-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  padding: 8px 16px;
  transition: var(--transition);
}

.chat-input-wrapper:focus-within {
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.08);
}

input#chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  padding: 8px 0;
}

button#send-btn {
  background: var(--primary-color);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
}

button#send-btn:hover {
  background: var(--secondary-color);
  transform: scale(1.1);
}

button#send-btn svg {
  width: 18px;
  height: 18px;
  fill: white;
  margin-left: 2px;
}

/* Handoff Message Styles */
.handoff-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
  border: 1px solid var(--primary-color);
  padding: 15px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.handoff-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}

.handoff-btn:hover {
  background: var(--secondary-color);
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  width: 60px;
}

.dot {
  width: 6px;
  height: 6px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

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