/* ══════════════════════════════════════════════════════════════════
   social.css  –  Floating Buttons + Premium Live Chat Widget  v3.0
   ══════════════════════════════════════════════════════════════════ */

/* ── Floating Contact Buttons (LEFT) ───────────────────────────── */
.floating-contact-wrap {
  position: fixed;
  bottom: 30px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 999999;
}

/* Each button is now a pill with icon + label */
.floating-contact-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff !important;
  text-decoration: none;
  border-radius: 50px;
  padding: 0 18px 0 0;
  height: 48px;
  box-shadow: 0 8px 24px -4px rgba(0,0,0,0.28);
  transition: transform 0.3s cubic-bezier(0.175,0.885,0.32,1.275),
              box-shadow 0.3s ease,
              width 0.35s cubic-bezier(0.16,1,0.3,1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  /* start collapsed – icon only */
  width: 48px;
  padding-right: 0;
}
.floating-contact-btn:hover {
  width: 170px;
  padding-right: 18px;
  transform: translateY(-3px);
  box-shadow: 0 14px 30px -6px rgba(0,0,0,0.35);
}
.floating-contact-btn.whatsapp {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
}
.floating-contact-btn.phone {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

/* Icon circle inside the pill */
.fc-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255,255,255,0.18);
  position: relative;
  z-index: 1;
}
.fc-icon svg { width:22px; height:22px; fill:currentColor; }
.floating-contact-btn.phone .fc-icon svg { fill:none; stroke:currentColor; stroke-width:2; }

/* Label – hidden until hover expands pill */
.fc-label {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s ease 0.05s, transform 0.25s ease 0.05s;
  pointer-events: none;
  white-space: nowrap;
}
.floating-contact-btn:hover .fc-label {
  opacity: 1;
  transform: translateX(0);
}

/* Pulse ring on icon */
.floating-contact-btn::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 48px; height: 48px;
  border-radius: 50%;
  pointer-events: none;
}
.floating-contact-btn.whatsapp::before {
  box-shadow: 0 0 0 0 rgba(37,211,102,0.5);
  animation: wpPulse 2.5s infinite;
}
.floating-contact-btn.phone::before {
  box-shadow: 0 0 0 0 rgba(59,130,246,0.5);
  animation: phPulse 2.5s infinite;
}
@keyframes wpPulse {
  0%   { transform: scale(1); opacity: 0.7; }
  70%  { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}
@keyframes phPulse {
  0%   { transform: scale(1); opacity: 0.7; }
  70%  { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

@media (max-width: 768px) {
  .floating-contact-wrap,
  .live-chat-wrap {
    display: none !important;
  }
}

/* ══════════════════════════════════════════════════════════════════
   PREMIUM LIVE CHAT WIDGET
   ══════════════════════════════════════════════════════════════════ */

.live-chat-wrap {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999999;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ── Trigger Button ─────────────────────────────────────────────── */
.live-chat-trigger {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff !important;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px -5px rgba(79,70,229,0.5);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.175,0.885,0.32,1.275), box-shadow 0.3s;
  position: relative;
  animation: triggerPulse 3s infinite;
}
.live-chat-trigger:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 0 0 6px rgba(99,102,241,0.15), 0 15px 35px -5px rgba(79,70,229,0.6);
  animation: none;
}
.live-chat-trigger svg {
  width: 24px; height: 24px;
  stroke: currentColor; fill: none;
}
@keyframes triggerPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}
.live-chat-trigger .badge {
  position: absolute; top:-3px; right:-3px;
  min-width: 19px; height: 19px; padding: 0 4px;
  background: #ef4444; border: 2.5px solid #fff;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #fff;
  animation: badgeBounce 2s ease-in-out infinite;
}
@keyframes badgeBounce {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.18); }
}

/* ── Chat Box ───────────────────────────────────────────────────── */
.live-chat-box {
  position: absolute;
  bottom: 0; right: 70px;
  width: 380px;
  height: 500px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 25px 60px -12px rgba(15,23,42,0.28), 0 0 0 1px rgba(15,23,42,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0; visibility: hidden;
  transform: translateX(14px) scale(0.96);
  transform-origin: bottom right;
  transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
}
.live-chat-box.open {
  opacity: 1; visibility: visible;
  transform: translateX(0) scale(1);
}

/* ── Compact Header ─────────────────────────────────────────────── */
.chat-header {
  position: relative;
  padding: 14px 16px 12px;       /* ← reduced from 22px */
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 45%, #4338ca 100%);
  overflow: hidden;
  flex-shrink: 0;
}
.chat-header-bg {
  position: absolute; inset: 0;
  pointer-events: none; overflow: hidden;
}
.chat-header-bg::before {
  content: '';
  position: absolute; top:-30px; right:-30px;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(139,92,246,0.45) 0%, transparent 70%);
  border-radius: 50%;
}
.chat-header-bg::after {
  content: '';
  position: absolute; bottom:-20px; left:-10px;
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(99,102,241,0.35) 0%, transparent 70%);
  border-radius: 50%;
}
.chat-header-content { position: relative; z-index: 1; }

.chat-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;       /* ← reduced */
}
.chat-agents-row { display: flex; align-items: center; }
.chat-agent-avatar {
  width: 30px; height: 30px;  /* ← reduced from 36px */
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px; color: #fff;
  border: 2px solid rgba(255,255,255,0.3);
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  flex-shrink: 0;
}
.chat-close-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
  width: 28px; height: 28px;
  border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.chat-close-btn:hover {
  background: rgba(255,255,255,0.25); color: #fff;
  transform: rotate(90deg);
}
.chat-header-title {
  font-size: 18px;           /* ← reduced from 22px */
  font-weight: 800; color: #fff;
  letter-spacing: -0.4px;
  margin-bottom: 2px;
}
.chat-header-subtitle {
  font-size: 11.5px;
  color: rgba(255,255,255,0.7);
  line-height: 1.4;
  margin-bottom: 8px;        /* ← reduced */
}
.chat-header-subtitle strong { color: rgba(255,255,255,0.95); }
.chat-online-status {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px; padding: 3px 10px;
  font-size: 11px; color: rgba(255,255,255,0.9); font-weight: 600;
}
.chat-pulse-dot {
  width: 7px; height: 7px;
  background: #4ade80; border-radius: 50%; display: inline-block;
  animation: statusPulse 2s infinite;
}
@keyframes statusPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.3); opacity: 0.6; }
}

/* ── Messages Body ──────────────────────────────────────────────── */
.chat-body {
  flex: 1;
  padding: 14px 14px 10px;
  overflow-y: auto;
  background: #f8fafc;
  display: flex; flex-direction: column; gap: 8px;
  scroll-behavior: smooth;
  min-height: 0;             /* ← flex fix so it doesn't overflow */
}
.chat-body::-webkit-scrollbar { width: 4px; }
.chat-body::-webkit-scrollbar-track { background: transparent; }
.chat-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* Date divider */
.chat-date-divider {
  display: flex; align-items: center; gap: 8px; margin: 2px 0;
}
.chat-date-divider::before,
.chat-date-divider::after { content:''; flex:1; height:1px; background:#e2e8f0; }
.chat-date-divider span {
  font-size: 10px; font-weight: 700; color: #94a3b8;
  letter-spacing: 0.5px; text-transform: uppercase;
}

/* Message groups */
.chat-msg-group {
  display: flex; align-items: flex-end; gap: 7px;
}
.chat-agent-mini-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 10px; color: #fff;
  align-self: flex-end;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.chat-msg-stack { display: flex; flex-direction: column; gap: 3px; max-width: calc(100% - 34px); }
.chat-agent-name {
  font-size: 10px; font-weight: 700; color: #64748b;
  margin-bottom: 1px; padding-left: 2px;
}

/* Bubbles */
.chat-msg {
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13px; line-height: 1.5;
  position: relative;
  animation: msgIn 0.3s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes msgIn {
  from { opacity:0; transform: translateY(6px) scale(0.97); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}
.chat-msg.incoming {
  background: #fff; color: #1e293b;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border: 1px solid rgba(15,23,42,0.06);
}
.chat-msg.outgoing {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff; border-bottom-right-radius: 4px;
  margin-left: auto; max-width: 82%;
  box-shadow: 0 6px 18px -4px rgba(99,102,241,0.35);
  display: flex; flex-direction: column; align-items: flex-end;
}
.chat-msg-bubble { word-break: break-word; }
.chat-msg-time {
  display: flex; align-items: center; gap: 3px;
  font-size: 9px; color: #94a3b8;
  margin-top: 3px; align-self: flex-end;
}
.chat-msg.outgoing .chat-msg-time { color: rgba(255,255,255,0.6); }

/* Typing indicator */
.typing-indicator { padding: 11px 14px !important; }
.typing-dots { display: inline-flex; gap: 4px; align-items: center; }
.typing-dots span {
  width: 7px; height: 7px; background: #94a3b8;
  border-radius: 50%; display: inline-block;
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.30s; }
@keyframes typingBounce {
  0%,60%,100% { transform: translateY(0); }
  30%          { transform: translateY(-6px); }
}

/* Quick reply chips */
.chat-quick-replies {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 2px; padding-left: 33px;
}
.chat-chip {
  border: 1.5px solid #6366f1; color: #6366f1;
  background: rgba(99,102,241,0.06);
  border-radius: 20px; padding: 5px 12px;
  font-size: 11.5px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: all 0.2s ease; white-space: nowrap;
}
.chat-chip:hover {
  background: #6366f1; color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

/* ── Footer / Input ─────────────────────────────────────────────── */
.chat-footer {
  padding: 8px 10px;
  background: #fff;
  border-top: 1px solid #f1f5f9;
  display: flex; align-items: center; gap: 7px;
  flex-shrink: 0;
}
.chat-input-wrap {
  flex: 1;
  display: flex; align-items: center;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 24px;
  padding: 0 4px 0 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.chat-input-wrap:focus-within {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
  background: #fff;
}
.chat-input-field {
  flex: 1; border: none; background: transparent;
  padding: 8px 0; font-size: 13px;
  font-family: inherit; color: #1e293b; outline: none;
}
.chat-input-field::placeholder { color: #94a3b8; }
.chat-emoji-btn {
  background: none; border: none; color: #94a3b8;
  cursor: pointer; padding: 5px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s, background 0.2s; flex-shrink: 0;
}
.chat-emoji-btn:hover { color: #6366f1; background: rgba(99,102,241,0.08); }
.chat-send-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(99,102,241,0.4);
}
.chat-send-btn:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(99,102,241,0.5); }
.chat-send-btn svg { width:15px; height:15px; fill:currentColor; }

/* Powered by bar */
.chat-powered {
  text-align: center; font-size: 10px; color: #94a3b8;
  padding: 4px 12px 7px; background: #fff; flex-shrink: 0;
}
.chat-powered strong { color: #475569; }

/* Emoji picker */
.chat-emoji-picker {
  position: absolute; bottom: 62px; left: 10px; right: 10px;
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 14px; padding: 8px 10px;
  display: grid; grid-template-columns: repeat(6,1fr); gap: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: all 0.25s cubic-bezier(0.16,1,0.3,1);
  z-index: 10;
}
.chat-emoji-picker.open { opacity:1; visibility:visible; transform:translateY(0); }
.chat-emoji-picker span {
  font-size: 19px; cursor: pointer; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 4px;
  transition: background 0.15s, transform 0.15s;
}
.chat-emoji-picker span:hover { background: #f1f5f9; transform: scale(1.25); }

/* Mobile */
@media (max-width: 480px) {
  .live-chat-box {
    width: calc(100vw - 20px);
    right: 0; bottom: 68px; height: 440px;
    transform: translateY(10px) scale(0.97);
    transform-origin: bottom right;
  }
  .live-chat-box.open { transform: translateY(0) scale(1); }
}

/* bounce for inline typing dots fallback */
@keyframes bounce {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
