/* Withfrontier AI Scout Design System */
:root {
  --brand-navy: #0a192f;
  --brand-navy-light: #112240;
  --brand-white: #ffffff;
  --text-main: #333333;
  --text-muted: #8892b0;
  --accent-color: #64ffda; /* Subtle accent for interaction points */
  --shadow-main: 0 10px 30px rgba(0, 0, 0, 0.15);
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: #f5f7fa;
}

/* Floating Chat Bubble */
.chat-launcher {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 65px;
  height: 65px;
  background-color: var(--brand-navy);
  border-radius: 50%;
  box-shadow: var(--shadow-main);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-launcher.hidden {
  display: none;
}

.chat-launcher svg {
  width: 32px;
  height: 32px;
  fill: var(--brand-white);
}

/* Chat Container */
.chat-window {
  position: fixed;
  bottom: 110px;
  right: 30px;
  width: 400px;
  max-width: calc(100vw - 60px);
  height: 600px;
  max-height: calc(100vh - 150px);
  background-color: var(--brand-white);
  border-radius: 16px;
  box-shadow: var(--shadow-main);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.chat-window.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chat-window.expanded {
  width: 100vw;
  height: 100vh;
  bottom: 0;
  right: 0;
  border-radius: 0;
  max-width: 100vw;
  max-height: 100vh;
}

/* Header */
.chat-header {
  background-color: var(--brand-navy);
  color: var(--brand-white);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.header-info h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.header-info p {
  font-size: 12px;
  opacity: 0.8;
  letter-spacing: 0.5px;
}

.header-controls {
  display: flex;
  gap: 10px;
}

.control-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  padding: 4px;
}

.control-btn:hover {
  opacity: 1;
}

/* Messages Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  scroll-behavior: smooth;
}

/* Message Bubbles */
.message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
}

.bot-message {
  align-self: flex-start;
  background-color: #f1f4f8;
  color: var(--text-main);
  border-bottom-left-radius: 4px;
}

.user-message {
  align-self: flex-end;
  background-color: var(--brand-navy);
  color: var(--brand-white);
  border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.typing-indicator {
  display: none;
  align-self: flex-start;
  padding: 12px 16px;
  background-color: #f1f4f8;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  gap: 4px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background-color: #cbd5e0;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

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

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

/* Input Area */
.chat-input-container {
  padding: 20px;
  border-top: 1px solid #edf2f7;
  background-color: var(--brand-white);
}

.chat-input-wrapper {
  display: flex;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 4px 16px;
  align-items: center;
}

#chat-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0;
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

#send-btn {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--brand-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
}

/* Quick Replies */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.quick-reply-btn {
  background: transparent;
  border: 1px solid var(--brand-navy);
  color: var(--brand-navy);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-reply-btn:hover {
  background-color: var(--brand-navy);
  color: var(--brand-white);
}

/* Scrollbar Style */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

/* Footer Credit */
.chat-footer {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.8;
}

.chat-footer img {
  height: 18px;
  object-fit: contain;
}
