/**
 * Website-Matched AI Support Chatbot Stylesheet
 * Native mybrandplease.com luxury cosmetic brand visual identity.
 * Features:
 * - Floating Teaser Pill
 * - Dynamic message rows with timestamps & copy button
 * - Clean responsive window with auto-expanding input
 * - High-end product cards with direct MOQ inquiry actions
 * - Accessible focus rings & smooth micro-interactions
 */

:root {
  --chat-primary: var(--primary-two, #EE2D7A);
  --chat-primary-dark: #c2185b;
  --chat-primary-light: var(--primary, #FFEFF2);
  --chat-primary-gradient: linear-gradient(135deg, #EE2D7A 0%, #d81b60 100%);
  --chat-font: var(--font_Lato, 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  --chat-heading-font: var(--font_Playfair, 'Playfair Display', Georgia, serif);
  
  --chat-bg: var(--white, #ffffff);
  --chat-bg-soft: #FAF8F5;
  --chat-border: #f1e4e8;
  --chat-border-darker: var(--border-color2, #DADADA);
  --chat-text: var(--text-color-one, #0C0C0C);
  --chat-text-muted: var(--text-color-two, #5B5B5B);
  
  --chat-user-bubble: linear-gradient(135deg, #EE2D7A 0%, #c2185b 100%);
  --chat-user-text: #ffffff;
  --chat-bot-bubble: #ffffff;
  --chat-bot-text: var(--text-color-one, #0C0C0C);
  --chat-shadow: 0 16px 48px rgba(0, 0, 0, 0.12), 0 2px 14px rgba(238, 45, 122, 0.08);
  --chat-radius: 20px;
  --chat-zindex: 99999;
}

/* Scoped Chatbot Isolation */
#ai-chatbot-root {
  all: initial;
  font-family: var(--chat-font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--chat-text);
  box-sizing: border-box;
}

#ai-chatbot-root *,
#ai-chatbot-root *::before,
#ai-chatbot-root *::after {
  box-sizing: border-box;
  font-family: inherit;
}

/* Floating Teaser Pill */
.chat-teaser-pill {
  position: fixed;
  bottom: 96px;
  right: 26px;
  background: #ffffff;
  border: 1px solid var(--chat-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(238, 45, 122, 0.1);
  padding: 10px 14px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  z-index: var(--chat-zindex);
  max-width: 280px;
  font-size: 12.5px;
  font-weight: 600;
  color: #1e293b;
  animation: bounceIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transition: transform 0.2s, box-shadow 0.2s;
}
.chat-teaser-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}
.chat-teaser-pill__avatar {
  font-size: 16px;
  flex-shrink: 0;
}
.chat-teaser-pill__text {
  line-height: 1.3;
  flex: 1;
}
.chat-teaser-pill__close {
  background: none;
  border: none;
  font-size: 16px;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 2px;
}
.chat-teaser-pill__close:hover {
  color: #0f172a;
}

/* Floating Notification Pill (Directly above launcher button) */
.chat-notification-pill {
  position: fixed;
  bottom: 96px;
  right: 26px;
  background: #ffffff;
  border: 2px solid var(--chat-primary, #ee2d7a);
  box-shadow: 0 12px 36px rgba(238, 45, 122, 0.32), 0 4px 14px rgba(0, 0, 0, 0.12);
  padding: 10px 16px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  z-index: 2147483647 !important;
  max-width: 380px;
  min-width: 220px;
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
  animation: notifBounceIn 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275), notifGlowPulse 2.8s infinite ease-in-out;
  transition: transform 0.2s, box-shadow 0.2s;
  user-select: none;
}

.chat-notification-pill:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 16px 42px rgba(238, 45, 122, 0.45), 0 0 16px rgba(238, 45, 122, 0.35);
}

.chat-notification-pill__icon {
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  animation: notifIconWiggle 3s infinite ease-in-out;
}

@keyframes notifIconWiggle {
  0%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(-12deg); }
  20%, 40% { transform: rotate(12deg); }
  50% { transform: rotate(0deg); }
}

@keyframes notifBounceIn {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.8);
  }
  60% {
    opacity: 1;
    transform: translateY(-6px) scale(1.03);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes notifGlowPulse {
  0% {
    box-shadow: 0 12px 36px rgba(238, 45, 122, 0.30), 0 4px 14px rgba(0, 0, 0, 0.10);
    border-color: #ee2d7a;
  }
  50% {
    box-shadow: 0 16px 44px rgba(238, 45, 122, 0.55), 0 0 20px rgba(238, 45, 122, 0.45);
    border-color: #ff5e98;
  }
  100% {
    box-shadow: 0 12px 36px rgba(238, 45, 122, 0.30), 0 4px 14px rgba(0, 0, 0, 0.10);
    border-color: #ee2d7a;
  }
}

.chat-notification-pill__text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
}

.chat-notification-pill__badge {
  background: var(--chat-primary-gradient, linear-gradient(135deg, #ee2d7a 0%, #ff5e98 100%));
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 14px;
  min-width: 20px;
  text-align: center;
  line-height: 14px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(238, 45, 122, 0.4);
}

.chat-notification-pill__close {
  background: rgba(148, 163, 184, 0.15);
  border: none;
  color: #64748b;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
  transition: all 0.2s;
}

.chat-notification-pill__close:hover {
  background: rgba(238, 45, 122, 0.2);
  color: #ee2d7a;
  transform: scale(1.1);
}

#ai-chatbot-root.chat-open .chat-notification-pill,
.chat-launcher.is-open ~ .chat-notification-pill {
  display: none !important;
}

/* Floating Launcher Button */
.chat-launcher {
  position: fixed;
  bottom: 26px;
  right: 26px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--chat-primary-gradient);
  color: #ffffff;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 26px rgba(238, 45, 122, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--chat-zindex);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  outline: none;
}

.chat-launcher:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 30px rgba(238, 45, 122, 0.58);
}

.chat-launcher:active {
  transform: scale(0.95);
}

.chat-launcher svg {
  width: 27px;
  height: 27px;
  fill: currentColor;
}

.chat-launcher .chat-icon-close {
  display: none;
}

.chat-launcher.is-open .chat-icon-msg,
#ai-chatbot-root.chat-open .chat-launcher .chat-icon-msg {
  display: none;
}

.chat-launcher.is-open .chat-icon-close,
#ai-chatbot-root.chat-open .chat-launcher .chat-icon-close {
  display: block;
}

/* Launcher Badge & Pulse */
.chat-launcher__badge {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 15px;
  height: 15px;
  background: #10b981;
  border: 2.5px solid #ffffff;
  border-radius: 50%;
  transition: background 0.3s, transform 0.3s;
}

.chat-launcher__badge.has-unread {
  background: #ee2d7a;
  box-shadow: 0 0 10px rgba(238, 45, 122, 0.8);
  animation: chat-badge-pulse 1.4s infinite alternate ease-in-out;
}

@keyframes chat-badge-pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.35); }
}

.chat-launcher__pulse {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
  opacity: 0.5;
  z-index: -1;
  animation: chat-pulse 2.4s infinite;
}

@keyframes chat-pulse {
  0% { transform: scale(1); opacity: 0.5; }
  70% { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* Chat Container Window */
.chat-window {
  position: fixed;
  bottom: 98px;
  right: 26px;
  width: 410px;
  max-width: calc(100vw - 32px);
  height: 630px;
  max-height: calc(100vh - 120px);
  background: var(--chat-bg);
  border-radius: var(--chat-radius);
  box-shadow: var(--chat-shadow);
  border: 1px solid var(--chat-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: var(--chat-zindex);
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(0.96);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.chat-window.is-open,
#ai-chatbot-root.chat-open .chat-window {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Clean, Light Header */
.chat-header {
  padding: 14px 18px;
  background: #ffffff;
  color: var(--chat-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--chat-border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.chat-header__info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.chat-header__logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  max-height: 38px;
  max-width: 140px;
}

.chat-header__logo-img {
  max-height: 36px;
  max-width: 135px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.chat-header__title-wrap {
  min-width: 0;
}

.chat-header__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--chat-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header__subtitle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.chat-header__status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
}

.chat-header__status-text {
  font-size: 11px;
  color: #10b981;
  font-weight: 600;
}

.chat-header__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-header__btn {
  background: none;
  border: none;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--chat-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 12px;
  font-weight: 600;
}

.chat-header__btn:hover {
  background: var(--chat-primary-light);
  color: var(--chat-primary);
}

.chat-header__btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

#chat-escalate-btn {
  background: var(--chat-primary-light);
  color: var(--chat-primary);
  padding: 4px 10px;
  border-radius: 20px;
  display: none;
  animation: escalatePopIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#chat-escalate-btn:hover {
  background: var(--chat-primary);
  color: #ffffff;
}

@keyframes escalatePopIn {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Smart Human Executive Escalation Card */
.chat-escalate-card {
  margin: 8px 0 4px;
  background: #fff5f8;
  border: 1px solid #fecdd3;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(238, 45, 122, 0.06);
  animation: messageFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 92%;
}

.chat-escalate-card__header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.chat-escalate-card__icon {
  font-size: 16px;
  line-height: 1.2;
  flex-shrink: 0;
  margin-top: 1px;
}

.chat-escalate-card__content {
  flex: 1;
  min-width: 0;
}

.chat-escalate-card__title {
  font-size: 12.5px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 2px;
  line-height: 1.3;
}

.chat-escalate-card__subtitle {
  font-size: 11.5px;
  color: #64748b;
  margin: 0;
  line-height: 1.35;
}

.chat-escalate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--chat-primary, #EE2D7A), #db2777);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(238, 45, 122, 0.22);
  width: fit-content;
}

.chat-escalate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(238, 45, 122, 0.32);
}

.chat-escalate-btn:active {
  transform: scale(0.97);
}

.chat-escalate-btn:disabled {
  opacity: 0.8;
  cursor: not-allowed;
  transform: none;
}

.chat-escalate-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Live Chat Status Banner */
.chat-live-banner {
  background: #1e293b;
  color: #ffffff;
  padding: 8px 16px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  animation: slideDown 0.3s ease;
}
.chat-live-banner .badge {
  background: var(--chat-primary, #EE2D7A);
  color: #fff;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

/* Messages Body */
.chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: var(--chat-bg-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chat-body::-webkit-scrollbar {
  width: 5px;
}
.chat-body::-webkit-scrollbar-track {
  background: transparent;
}
.chat-body::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: 4px;
}

/* Message Rows */
.chat-msg-row {
  display: flex;
  flex-direction: column;
  width: 100%;
  animation: messageFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.chat-msg-user {
  align-items: flex-end;
}
.chat-msg-assistant,
.chat-msg-executive {
  align-items: flex-start;
}
.chat-msg-system {
  align-items: center;
}

/* Chat Bubbles */
.chat-bubble {
  max-width: 85%;
  padding: 11px 15px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.45;
  word-wrap: break-word;
  position: relative;
}

.chat-bubble-user {
  background: var(--chat-user-bubble);
  color: var(--chat-user-text);
  border-bottom-right-radius: 4px;
  box-shadow: 0 3px 10px rgba(238, 45, 122, 0.25);
}

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

.chat-bubble-executive {
  background: #ffffff;
  color: var(--chat-bot-text);
  border: 1px solid #fecdd3;
  border-left: 4px solid var(--chat-primary, #EE2D7A);
  border-bottom-left-radius: 4px;
  box-shadow: 0 4px 12px rgba(238, 45, 122, 0.08);
}

.chat-bubble-system {
  background: #f1f5f9;
  color: #475569;
  font-size: 11.5px;
  padding: 5px 14px;
  border-radius: 20px;
  text-align: center;
  border: 1px solid #e2e8f0;
}
.chat-system-tag {
  font-weight: 700;
  color: #64748b;
  margin-right: 4px;
}

.chat-sender-header {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--chat-primary, #EE2D7A);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-bubble-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px solid #f1f5f9;
  font-size: 10.5px;
}
.chat-bubble-footer.user-footer {
  justify-content: flex-end;
  border-top: none;
  margin-top: 2px;
  padding-top: 0;
}

.chat-msg-time {
  color: #94a3b8;
  font-size: 10px;
}
.chat-msg-time.user-time {
  color: rgba(255, 255, 255, 0.75);
}

.chat-copy-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  transition: all 0.2s;
}
.chat-copy-btn:hover {
  background: #f1f5f9;
  color: var(--chat-primary);
}
.chat-copy-btn svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

/* Typing Indicator */
.chat-typing-row {
  animation: messageFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-bubble-typing {
  display: inline-flex !important;
  align-items: center !important;
  padding: 10px 16px !important;
  min-height: 38px !important;
  background: #ffffff !important;
  border: 1px solid var(--chat-border, #f1e4e8) !important;
  border-bottom-left-radius: 4px !important;
  border-radius: 16px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  box-sizing: border-box !important;
}

.chat-ai-typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 16px;
}

.chat-ai-typing-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--chat-primary, #EE2D7A);
  opacity: 0.35;
  transform: translateY(0) scale(0.9);
  animation: aiTypingBounce 1.3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.chat-ai-typing-dot:nth-child(1) {
  animation-delay: 0s;
}
.chat-ai-typing-dot:nth-child(2) {
  animation-delay: 0.18s;
}
.chat-ai-typing-dot:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes aiTypingBounce {
  0%, 100% {
    opacity: 0.35;
    transform: translateY(0) scale(0.9);
  }
  40% {
    opacity: 1;
    transform: translateY(-5px) scale(1.08);
  }
  60% {
    opacity: 0.85;
    transform: translateY(-1px) scale(1);
  }
}

.chat-typing {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 8px 14px !important;
  width: auto !important;
  max-width: 100% !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}
.chat-typing-label {
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: var(--chat-bot-text, #1e293b) !important;
  white-space: nowrap !important;
  display: inline-block !important;
  width: auto !important;
  height: auto !important;
  border-radius: 0 !important;
  background: transparent !important;
  animation: none !important;
  margin-right: 4px !important;
}
.chat-typing-dots {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  height: auto !important;
  width: auto !important;
  background: transparent !important;
  border-radius: 0 !important;
  animation: none !important;
}
.chat-typing-dot {
  display: inline-block !important;
  width: 6px !important;
  height: 6px !important;
  background: var(--chat-primary, #EE2D7A) !important;
  border-radius: 50% !important;
  animation: typingDotBounce 1.4s infinite ease-in-out !important;
}
.chat-typing-dot:nth-child(2) { animation-delay: 0.2s !important; }
.chat-typing-dot:nth-child(3) { animation-delay: 0.4s !important; }

@keyframes typingDotBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Quick Actions Bar */
.chat-quick-actions {
  display: flex;
  gap: 6px;
  padding: 8px 16px;
  overflow-x: auto;
  background: #ffffff;
  border-top: 1px solid var(--chat-border);
  scrollbar-width: none;
}
.chat-quick-actions::-webkit-scrollbar {
  display: none;
}
.chat-quick-btn {
  white-space: nowrap;
  background: var(--chat-primary-light);
  color: var(--chat-primary-dark);
  border: 1px solid rgba(238, 45, 122, 0.2);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.chat-quick-btn:hover {
  background: var(--chat-primary);
  color: #ffffff;
  border-color: var(--chat-primary);
  transform: translateY(-1px);
}

/* Product Cards Grid */
.chat-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin: 6px 0;
  width: 100%;
}
.chat-product-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.chat-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}
.chat-prod-img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  background: #f8fafc;
}
.chat-prod-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.chat-prod-title {
  font-size: 12.5px;
  font-weight: 700;
  margin: 0 0 3px 0;
  color: #1e293b;
  line-height: 1.3;
}
.chat-prod-price {
  font-size: 12px;
  font-weight: 700;
  color: var(--chat-primary, #EE2D7A);
  margin-bottom: 4px;
}
.chat-prod-desc {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 8px;
  line-height: 1.3;
  flex: 1;
}
.chat-prod-actions {
  display: flex;
  gap: 6px;
}
.chat-prod-btn {
  flex: 1;
  text-align: center;
  background: #f1f5f9;
  color: #334155;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 6px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.chat-prod-btn:hover {
  background: var(--chat-primary, #EE2D7A);
  color: #ffffff;
}
.chat-prod-btn.secondary {
  background: var(--chat-primary-light);
  color: var(--chat-primary);
}
.chat-prod-btn.secondary:hover {
  background: var(--chat-primary);
  color: #ffffff;
}

/* Input Footer */
.chat-footer {
  padding: 10px 14px 8px;
  background: #ffffff;
  border-top: 1px solid var(--chat-border);
}
.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 4px 6px 4px 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.chat-form:focus-within {
  border-color: var(--chat-primary);
  box-shadow: 0 0 0 3px rgba(238, 45, 122, 0.12);
  background: #ffffff;
}
.chat-attach-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 6px 2px;
  color: #94a3b8;
  transition: color 0.2s;
}
.chat-attach-btn:hover {
  color: var(--chat-primary);
}
.chat-attach-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.chat-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 6px 0;
  font-size: 13.5px;
  color: #1e293b;
  resize: none;
  outline: none;
  max-height: 120px;
  min-height: 24px;
  line-height: 1.4;
}
.chat-input::placeholder {
  color: #94a3b8;
}
.chat-send {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--chat-primary-gradient);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s, box-shadow 0.2s;
}
.chat-send:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 10px rgba(238, 45, 122, 0.35);
}
.chat-send svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}
.chat-footer-note {
  font-size: 10px;
  color: #94a3b8;
  text-align: center;
  margin-top: 4px;
}
.chat-footer-note kbd {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 9px;
  font-family: inherit;
  color: #475569;
}

/* Feedback Modal */
.chat-feedback-modal {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}
.chat-feedback-card {
  background: #ffffff;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 320px;
  text-align: center;
}
.chat-feedback-card h5 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #1e293b;
}
.chat-feedback-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.csat-star {
  font-size: 24px;
  cursor: pointer;
  color: #cbd5e1;
  transition: color 0.2s, transform 0.2s;
}
.csat-star.active,
.csat-star:hover {
  color: #f59e0b;
  transform: scale(1.15);
}

/* Executive Escalation Cards & In-Chat Form */
.chat-escalate-card {
  margin: 12px 0;
  background: #ffffff;
  border: 1px solid #fecdd3;
  border-left: 4px solid var(--chat-primary, #EE2D7A);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 4px 16px rgba(238, 45, 122, 0.08);
  animation: messageFadeIn 0.3s ease;
}
.chat-escalate-card__header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}
.chat-escalate-card__icon {
  font-size: 20px;
  line-height: 1;
}
.chat-escalate-card__title {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 2px;
}
.chat-escalate-card__subtitle {
  font-size: 12px;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
}
.chat-escalate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: linear-gradient(135deg, var(--chat-primary, #EE2D7A), #db2777);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 3px 10px rgba(238, 45, 122, 0.25);
}
.chat-escalate-btn:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 5px 14px rgba(238, 45, 122, 0.35);
}
.chat-escalate-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* In-Chat Executive Connection Form Card */
.chat-escalate-form-card {
  margin: 14px 0;
  background: #ffffff;
  border: 1px solid #fed7aa;
  border-left: 4px solid var(--chat-primary, #EE2D7A);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  animation: bounceIn 0.35s ease;
}
.chat-escalate-form-card__header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}
.chat-escalate-form-card__icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(238, 45, 122, 0.1);
  color: var(--chat-primary, #EE2D7A);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-escalate-form-card__title {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 2px 0;
}
.chat-escalate-form-card__subtitle {
  font-size: 11.5px;
  color: #64748b;
  margin: 0;
  line-height: 1.35;
}
.chat-escalate-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chat-form-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #334155;
}
.chat-form-required {
  color: #ef4444;
}
.chat-form-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  font-size: 12.5px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: #1e293b;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.chat-form-input:focus {
  background: #ffffff;
  border-color: var(--chat-primary, #EE2D7A);
  box-shadow: 0 0 0 3px rgba(238, 45, 122, 0.15);
}
.chat-form-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 11.5px;
  line-height: 1.35;
  padding: 6px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.chat-form-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}
.chat-form-btn--primary {
  background: linear-gradient(135deg, var(--chat-primary, #EE2D7A), #db2777);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(238, 45, 122, 0.25);
}
.chat-form-btn--primary:hover:not(:disabled) {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(238, 45, 122, 0.35);
}
.chat-form-btn--secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.chat-form-btn--secondary:hover:not(:disabled) {
  background: #e2e8f0;
  color: #1e293b;
}
.chat-form-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.chat-btn-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #ffffff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Animations */
@keyframes messageFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes bounceIn {
  0% { opacity: 0; transform: translateY(14px) scale(0.9); }
  60% { opacity: 1; transform: translateY(-4px) scale(1.02); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Resolved / Ended Conversation Card */
.chat-resolved-card {
  margin: 16px auto;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  animation: bounceIn 0.4s ease;
  max-width: 92%;
}
.chat-resolved-icon {
  font-size: 24px;
  margin-bottom: 6px;
}
.chat-resolved-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
}
.chat-resolved-desc {
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
  margin-bottom: 12px;
}
.chat-start-fresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--chat-primary, #EE2D7A), #db2777);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 3px 10px rgba(238, 45, 122, 0.28);
}
.chat-start-fresh-btn:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(238, 45, 122, 0.4);
}
.chat-input:disabled,
#chat-input-textarea:disabled {
  background-color: #f1f5f9 !important;
  color: #94a3b8 !important;
  cursor: not-allowed !important;
}
.chat-send-btn:disabled,
#chat-send-btn:disabled,
.chat-attach-btn:disabled,
#chat-attach-btn:disabled {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

/* Mobile Responsive (<576px) */
@media (max-width: 575.98px) {
  .chat-window {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
  }
  .chat-launcher {
    bottom: 16px;
    right: 16px;
  }
  .chat-teaser-pill {
    bottom: 84px;
    right: 16px;
    max-width: calc(100vw - 32px);
  }
  .chat-notification-pill {
    bottom: 84px !important;
    right: 16px !important;
    left: 16px !important;
    max-width: calc(100vw - 32px) !important;
    width: auto !important;
  }
}

