/* Modern Interactive Chatbot & Site Styles */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  --accent-color: #10b981;
  --bg-dark: #0f172a;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --bot-msg-bg: #f1f5f9;
  --user-msg-bg: #4f46e5;
  --chat-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --border-radius: 16px;
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #f8fafc;
  color: var(--text-main);
  line-height: 1.5;
}

/* Page Layout */
.hero-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top right, #e0e7ff 0%, #f8fafc 50%, #f1f5f9 100%);
  padding: 2rem;
  text-align: center;
}

.hero-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 3rem;
  border-radius: 24px;
  max-width: 650px;
  box-shadow: var(--chat-shadow);
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.demo-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--primary-gradient);
  color: #ffffff;
  font-weight: 600;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
  transition: all 0.3s ease;
}

.demo-trigger-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 20px -3px rgba(79, 70, 229, 0.4);
}

/* Floating Chat Trigger Button */
.chat-square-floating {
  position: fixed;
  bottom: 28px;
  right: 6px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.4);
  z-index: 9999;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-square-floating:hover {
  transform: scale(1.08);
}

.chat-square-floating svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.chat-badge-pulse {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background-color: var(--accent-color);
  border: 2.5px solid #ffffff;
  border-radius: 50%;
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  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 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Chat Popup Window */
.chat-pop-sm {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: var(--border-radius);
  box-shadow: var(--chat-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.chat-pop-sm.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

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

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

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.chat-header-title h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.chat-header-title p {
  font-size: 12px;
  opacity: 0.85;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.online-dot {
  width: 8px;
  height: 8px;
  background-color: #34d399;
  border-radius: 50%;
  display: inline-block;
}

.chat-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Chat Messages Body */
.chat-messages-container {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: #f8fafc;
  scroll-behavior: smooth;
}

.chat-messages-container::-webkit-scrollbar {
  width: 5px;
}
.chat-messages-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Message Bubbles */
.msg-row {
  display: flex;
  margin-bottom: 4px;
  animation: fadeInMsg 0.3s ease forwards;
}

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

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

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

.msg-bubble {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.45;
  position: relative;
  word-break: break-word;
}

.msg-row.bot .msg-bubble {
  background-color: #ffffff;
  color: var(--text-main);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  border: 1px solid #e2e8f0;
}

.msg-row.user .msg-bubble {
  background: var(--primary-gradient);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

/* Interactive Option Pills */
.options-pills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  animation: fadeInMsg 0.4s ease forwards;
}

.option-pill-btn {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  color: var(--primary-color);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.option-pill-btn:hover {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(79, 70, 229, 0.2);
}

.option-pill-btn.selected {
  background: var(--primary-gradient);
  color: #ffffff;
  border-color: transparent;
  pointer-events: none;
}

/* Inline Inputs (Name & Phone Number) */
.chat-input-box {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px;
  margin-top: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  animation: fadeInMsg 0.3s ease forwards;
}

.chat-input-box input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input-box input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.chat-input-box button {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.chat-input-box button:hover {
  opacity: 0.95;
}

.input-error-msg {
  color: #ef4444;
  font-size: 12px;
  margin-top: 6px;
  font-weight: 500;
  display: none;
}

/* Typing Indicator Animation */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: #ffffff;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
  border: 1px solid #e2e8f0;
}

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

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

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}
