/* ============================================================
   FUSION DEVELOPERS — 24/7 AI CHATBOT WIDGET
   Glass UI / Navy & Gold Theme
   ============================================================ */

:root {
  --chat-gold: #C8A96E;
  --chat-gold-glow: rgba(200, 169, 110, 0.4);
  --chat-navy: #0A1412;
  --chat-dark: #060C0A;
  --chat-glass: rgba(18, 28, 26, 0.94);
  --chat-border: rgba(200, 169, 110, 0.32);
  --chat-sand: #EBE1CE;
  --chat-muted: rgba(235, 225, 206, 0.65);
}

/* Floating Launcher Button */
#fusion-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #1E332D 0%, #121C1A 65%, #0A1412 100%);
  border: 1.5px solid var(--chat-gold);
  box-shadow: 0 8px 30px var(--chat-gold-glow), 0 4px 12px rgba(0,0,0,0.5);
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

#fusion-chat-launcher:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 36px rgba(201, 162, 39, 0.65);
}

#fusion-chat-launcher svg {
  width: 28px;
  height: 28px;
  fill: var(--chat-gold);
  transition: transform 0.3s ease;
}

#fusion-chat-launcher.active svg {
  transform: rotate(90deg);
}

/* Pulse badge */
.chat-pulse-badge {
  position: absolute;
  top: 0;
  right: 0;
  width: 13px;
  height: 13px;
  background: #10B981;
  border: 2px solid var(--chat-dark);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.9);
}

/* Chat Modal Window */
#fusion-chat-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 570px;
  max-height: calc(100vh - 120px);
  background: var(--chat-glass);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--chat-border);
  border-radius: 20px;
  box-shadow: 0 24px 60px -15px rgba(0, 0, 0, 0.8), 0 0 20px rgba(201, 162, 39, 0.15);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1), transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Header */
.fusion-chat-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(26, 46, 40, 0.85) 0%, rgba(10, 20, 18, 0.98) 100%);
  border-bottom: 1px solid var(--chat-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fusion-chat-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fusion-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle, #C8A96E 0%, #0A1412 85%);
  border: 1.5px solid var(--chat-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--chat-dark);
}

.fusion-chat-title h3 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.15rem;
  color: var(--chat-sand);
  line-height: 1.2;
}

.fusion-chat-title p {
  margin: 0;
  font-size: 0.75rem;
  color: #10B981;
  display: flex;
  align-items: center;
  gap: 5px;
}

.fusion-chat-title p::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
}

.fusion-chat-close {
  background: transparent;
  border: none;
  color: var(--chat-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.fusion-chat-close:hover {
  color: var(--chat-sand);
  background: rgba(255,255,255,0.08);
}

/* Chat Body / Messages */
.fusion-chat-messages {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.fusion-chat-messages::-webkit-scrollbar {
  width: 5px;
}
.fusion-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(201, 162, 39, 0.25);
  border-radius: 4px;
}

.chat-bubble {
  max-width: 84%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-break: break-word;
  animation: fadeInBubble 0.25s ease-out;
}

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

.chat-bubble.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--chat-sand);
  border-bottom-left-radius: 4px;
}

.chat-bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #C9A227 0%, #9B7B19 100%);
  color: #0A1120;
  font-weight: 500;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(201, 162, 39, 0.25);
}

.chat-bubble p {
  margin: 0 0 8px;
  color: inherit;
  font-size: inherit;
}
.chat-bubble p:last-child {
  margin-bottom: 0;
}
.chat-bubble ul, .chat-bubble ol {
  margin: 6px 0;
  padding-left: 18px;
}
.chat-bubble li {
  margin-bottom: 4px;
}

/* Quick Action Chips */
.chat-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chat-chip {
  background: rgba(201, 162, 39, 0.12);
  border: 1px solid rgba(201, 162, 39, 0.35);
  color: var(--chat-sand);
  font-size: 0.76rem;
  padding: 6px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-chip:hover {
  background: var(--chat-gold);
  color: #0A1120;
  border-color: var(--chat-gold);
}

/* Input Area */
.fusion-chat-input-area {
  padding: 12px 16px;
  background: rgba(10, 17, 32, 0.95);
  border-top: 1px solid var(--chat-border);
  display: flex;
  gap: 10px;
  align-items: center;
}

.fusion-chat-input-area input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--chat-sand);
  font-size: 0.88rem;
  padding: 10px 14px;
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s;
}

.fusion-chat-input-area input:focus {
  border-color: var(--chat-gold);
  background: rgba(255, 255, 255, 0.1);
}

.fusion-chat-send {
  background: var(--chat-gold);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.fusion-chat-send:hover {
  background: #dfb638;
  transform: scale(1.05);
}

.fusion-chat-send svg {
  width: 18px;
  height: 18px;
  fill: #0A1120;
}

/* WhatsApp Handoff Bar */
.chat-whatsapp-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(37, 211, 102, 0.15);
  border: 1px solid rgba(37, 211, 102, 0.35);
  color: #25D366;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  margin-top: 6px;
  transition: all 0.2s;
}

.chat-whatsapp-cta:hover {
  background: #25D366;
  color: #0A1120;
}

@media(max-width: 480px) {
  #fusion-chat-window {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 86px;
    height: calc(100vh - 110px);
  }
}
