/* ==========================================================================
   EXECUTIVE-GRADE REAL-TIME LIVE CONCIERGE & SUPPORT WIDGET - MOHD IRSHAD
   Enterprise Polish, Verified Agent Identity, Fluid Micro-Animations & Trust
   ========================================================================== */

/* 1. FLOATING LAUNCHER TRIGGER */
.front-chat-launcher {
  position: fixed;
  bottom: 26px;
  right: 26px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Interactive Speech Bubble Greeting (Hidden) */
.chat-greeting-bubble {
  display: none !important;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  padding: 0.65rem 1rem 0.65rem 0.75rem;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: floatGreeting 4s ease-in-out infinite;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.chat-greeting-bubble:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: #8b5cf6;
  box-shadow: 0 16px 42px rgba(124, 58, 237, 0.22);
}

@keyframes floatGreeting {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.greeting-avatar-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.greeting-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #8b5cf6;
}

.greeting-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #ffffff;
  box-shadow: 0 0 6px #10b981;
}

.greeting-text-meta {
  display: flex;
  flex-direction: column;
}

.greeting-agent-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.greeting-agent-name .verified-icon {
  color: #3b82f6;
  font-size: 0.75rem;
}

.greeting-tagline {
  font-size: 0.76rem;
  font-weight: 600;
  color: #64748b;
}

.btn-greeting-dismiss {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0 0 0.35rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.btn-greeting-dismiss:hover {
  color: #0f172a;
}

/* Pulsing Round Launcher Action Button */
.btn-chat-bubble-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 50%, #ec4899 100%);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.45), 0 0 20px rgba(236, 72, 153, 0.25);
  position: relative;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-chat-bubble-toggle:hover {
  transform: scale(1.08) rotate(4deg);
  box-shadow: 0 16px 40px rgba(124, 58, 237, 0.6), 0 0 24px rgba(236, 72, 153, 0.35);
}

.btn-chat-bubble-toggle::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid #8b5cf6;
  opacity: 0.8;
  animation: pulseRing 2.2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulseRing {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.18); opacity: 0; }
  100% { transform: scale(0.95); opacity: 0; }
}

.chat-icon-state-closed,
.chat-icon-state-opened {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-icon-state-opened {
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
}

.front-chat-window.open ~ .front-chat-launcher .chat-icon-state-closed,
.btn-chat-bubble-toggle.is-active .chat-icon-state-closed {
  opacity: 0;
  transform: rotate(90deg) scale(0.6);
}

.front-chat-window.open ~ .front-chat-launcher .chat-icon-state-opened,
.btn-chat-bubble-toggle.is-active .chat-icon-state-opened {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.chat-unread-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 900;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
  animation: badgePop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes badgePop {
  0% { transform: scale(0); }
  80% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   2. LUXURY EXECUTIVE CHAT WINDOW
   ========================================================================== */
.front-chat-window {
  position: fixed;
  bottom: 100px;
  right: 26px;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 26px;
  box-shadow: 0 28px 80px -10px rgba(15, 23, 42, 0.32), 0 0 0 1px rgba(255, 255, 255, 0.9) inset;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99998;
  transform: translateY(28px) scale(0.92);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.36s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Executive Header */
.front-chat-head {
  background: linear-gradient(135deg, #0b0f19 0%, #1e1b4b 55%, #311042 100%);
  padding: 1.2rem 1.3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.front-chat-head::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
}

.front-chat-brand-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.front-agent-avatar-box {
  position: relative;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}

.front-agent-photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(139, 92, 246, 0.8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.agent-live-pulse-indicator {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10b981;
  border: 2.5px solid #0b0f19;
  box-shadow: 0 0 10px #10b981;
}

.front-chat-head-titles {
  display: flex;
  flex-direction: column;
}

.agent-title-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.agent-title-row h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.08rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.01em;
}

.verified-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.agent-status-sub {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  color: #cbd5e1;
  margin-top: 0.15rem;
  font-weight: 500;
}

.online-pulse-bullet {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  box-shadow: 0 0 6px #10b981;
}

/* Header Action Toolbar */
.front-chat-head-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-head-tool-action,
.btn-front-chat-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-head-tool-action:hover,
.btn-front-chat-close:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
  color: #ffffff;
}

.btn-wa-shortcut {
  background: rgba(37, 211, 102, 0.18);
  border-color: rgba(37, 211, 102, 0.35);
  color: #25d366;
  font-size: 1.05rem;
}

.btn-wa-shortcut:hover {
  background: #25d366;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
}

/* 3. CHAT MESSAGES BODY STREAM */
.front-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.15rem;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.25) transparent;
}

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

.front-chat-body::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.25);
  border-radius: 9999px;
}

/* Welcome Concierge Card */
.front-chat-welcome-card {
  background: #ffffff;
  border: 1.5px solid #ede9fe;
  border-radius: 20px;
  padding: 1.2rem;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.07);
  position: relative;
  overflow: hidden;
}

.front-chat-welcome-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
}

.welcome-card-header {
  margin-bottom: 0.5rem;
}

.welcome-card-header h5 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  line-height: 1.3;
}

.front-chat-welcome-card p {
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.5;
  margin: 0 0 1rem 0;
}

/* Quick Suggestion Chips */
.front-chat-quick-chips {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-chip-btn {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  color: #0f172a;
  padding: 0.65rem 0.95rem;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.chip-content-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.chip-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.chip-icon-badge.purple { background: #ede9fe; color: #7c3aed; }
.chip-icon-badge.blue { background: #e0e7ff; color: #4f46e5; }
.chip-icon-badge.emerald { background: #d1fae5; color: #059669; }
.chip-icon-badge.green { background: #dcfce7; color: #16a34a; }

.chip-text-group {
  display: flex;
  flex-direction: column;
}

.chip-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  color: #0f172a;
}

.chip-subtitle {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 500;
}

.chip-arrow {
  color: #94a3b8;
  font-size: 0.72rem;
  transition: transform 0.2s ease, color 0.2s ease;
}

.chat-chip-btn:hover {
  background: #ffffff;
  border-color: #8b5cf6;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.12);
  transform: translateX(4px);
}

.chat-chip-btn:hover .chip-title {
  color: #6d28d9;
}

.chat-chip-btn:hover .chip-arrow {
  color: #6d28d9;
  transform: translateX(3px);
}

/* 4. CHAT MESSAGE BUBBLES */
.front-msg-bubble-wrap {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  max-width: 86%;
  animation: msgEntrance 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes msgEntrance {
  0% { opacity: 0; transform: translateY(10px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.front-msg-bubble-wrap.admin {
  align-self: flex-start;
}

.front-msg-bubble-wrap.visitor {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-agent-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #8b5cf6;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.msg-bubble-stack {
  display: flex;
  flex-direction: column;
}

.front-msg-bubble-content {
  padding: 0.75rem 1.05rem;
  border-radius: 18px;
  font-size: 0.85rem;
  line-height: 1.5;
  word-break: break-word;
  position: relative;
}

/* Admin Message Bubble (Clean Crisp Light) */
.front-msg-bubble-wrap.admin .front-msg-bubble-content {
  background: #ffffff;
  color: #0f172a;
  border: 1.5px solid #e2e8f0;
  border-bottom-left-radius: 4px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

/* Visitor Message Bubble (Rich Modern Gradient) */
.front-msg-bubble-wrap.visitor .front-msg-bubble-content {
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 50%, #9333ea 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.3);
}

.front-msg-time-tag {
  font-size: 0.65rem;
  color: #94a3b8;
  margin-top: 0.25rem;
  font-weight: 600;
}

.front-msg-bubble-wrap.visitor .front-msg-time-tag {
  text-align: right;
  color: #64748b;
}

/* 5. LIVE TYPING INDICATOR */
.chat-typing-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.5rem;
  animation: fadeIn 0.2s ease;
}

.typing-avatar img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #8b5cf6;
}

.typing-bubble {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.45rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.typing-bubble span {
  font-size: 0.74rem;
  font-weight: 600;
  color: #64748b;
}

.typing-dots {
  display: flex;
  gap: 3px;
}

.typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8b5cf6;
  animation: typingDot 1.4s infinite ease-in-out both;
}

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

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

/* 6. CHAT FOOTER & INPUT BAR */
.front-chat-foot-wrapper {
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
}

.front-chat-foot {
  padding: 0.85rem 1.15rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.front-chat-input-pill {
  flex: 1;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 18px;
  display: flex;
  align-items: center;
  padding: 0.3rem 0.4rem 0.3rem 0.95rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.front-chat-input-pill:focus-within {
  background: #ffffff;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12);
}

.front-chat-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.85rem;
  color: #0f172a;
  outline: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.front-chat-input::placeholder {
  color: #94a3b8;
  font-size: 0.82rem;
}

.input-wa-pill-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #dcfce7;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.input-wa-pill-btn:hover {
  background: #25d366;
  color: #ffffff;
  transform: scale(1.06);
}

.btn-front-send {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 50%, #ec4899 100%);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.38);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.btn-front-send:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.55);
}

.btn-front-send:active {
  transform: scale(0.96);
}

/* Micro Trust & Security Bar */
.front-chat-security-bar {
  padding: 0.4rem 1.15rem 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.front-chat-security-bar i {
  color: #10b981;
  font-size: 0.72rem;
}

/* 7. RESPONSIVE BREAKPOINTS */
@media (max-width: 768px) {
  .front-chat-launcher {
    bottom: 84px !important;
    right: 18px !important;
  }
  
  .btn-chat-bubble-toggle {
    width: 52px !important;
    height: 52px !important;
    font-size: 1.35rem !important;
  }

  .chat-greeting-bubble {
    display: none !important;
  }

  .front-chat-window {
    width: calc(100vw - 24px) !important;
    right: 12px !important;
    bottom: 80px !important;
    height: 82vh !important;
    max-height: 560px !important;
    border-radius: 22px !important;
  }
}
