/* ══════════════════════════════════════════════════════════
   LXWYER UP — HELP CHATBOT WIDGET
   Matches the dark premium aesthetic of the main site
══════════════════════════════════════════════════════════ */

/* ─── Chatbot Toggle Button ─── */
.chatbot-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid rgba(37, 99, 235, 0.3);
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 24px rgba(37, 99, 235, 0.35),
    0 0 0 0 rgba(37, 99, 235, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: chatbot-pulse 2.5s infinite;
}

.chatbot-toggle:hover {
  transform: scale(1.08);
  box-shadow:
    0 6px 32px rgba(37, 99, 235, 0.5),
    0 0 0 0 rgba(37, 99, 235, 0.4);
}

.chatbot-toggle:active {
  transform: scale(0.95);
}

.chatbot-toggle svg {
  width: 28px;
  height: 28px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.chatbot-toggle .chatbot-icon-close {
  position: absolute;
  transform: rotate(90deg) scale(0);
  opacity: 0;
}

.chatbot-toggle.active .chatbot-icon-chat {
  transform: rotate(-90deg) scale(0);
  opacity: 0;
}

.chatbot-toggle.active .chatbot-icon-close {
  transform: rotate(0deg) scale(1);
  opacity: 1;
}

.chatbot-toggle.active {
  animation: none;
  background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
}

@keyframes chatbot-pulse {
  0%, 100% {
    box-shadow:
      0 4px 24px rgba(37, 99, 235, 0.35),
      0 0 0 0 rgba(37, 99, 235, 0.4);
  }
  50% {
    box-shadow:
      0 4px 24px rgba(37, 99, 235, 0.35),
      0 0 0 12px rgba(37, 99, 235, 0);
  }
}

/* ─── Notification Badge ─── */
.chatbot-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #000;
  animation: chatbot-badge-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes chatbot-badge-pop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

.chatbot-toggle.active .chatbot-badge {
  display: none;
}

/* ─── Chat Window ─── */
.chatbot-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  z-index: 9998;
  width: 380px;
  max-height: 560px;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.6),
    0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);

  /* Hidden by default */
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ─── Chat Header ─── */
.chatbot-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.12) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.chatbot-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.3);
}

.chatbot-header-avatar svg {
  width: 20px;
  height: 20px;
  color: #fff;
}

.chatbot-header-info {
  flex: 1;
  min-width: 0;
}

.chatbot-header-title {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.925rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.chatbot-header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.75rem;
  color: #888888;
  margin-top: 2px;
}

.chatbot-header-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  animation: chatbot-status-blink 2s infinite;
}

@keyframes chatbot-status-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ─── Messages Container ─── */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 280px;
  max-height: 360px;
  scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar {
  width: 4px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ─── Message Bubbles ─── */
.chatbot-msg {
  display: flex;
  gap: 10px;
  animation: chatbot-msg-in 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes chatbot-msg-in {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.chatbot-msg--bot {
  align-self: flex-start;
  max-width: 88%;
}

.chatbot-msg--user {
  align-self: flex-end;
  flex-direction: row-reverse;
  max-width: 82%;
}

.chatbot-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.chatbot-msg--bot .chatbot-msg-avatar {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
}

.chatbot-msg--user .chatbot-msg-avatar {
  background: rgba(255, 255, 255, 0.08);
}

.chatbot-msg-avatar svg {
  width: 14px;
  height: 14px;
  color: #fff;
}

.chatbot-msg-bubble {
  padding: 12px 16px;
  border-radius: 14px;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.855rem;
  line-height: 1.55;
  letter-spacing: -0.005em;
}

.chatbot-msg--bot .chatbot-msg-bubble {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #e5e5e5;
  border-top-left-radius: 4px;
}

.chatbot-msg--user .chatbot-msg-bubble {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border-top-right-radius: 4px;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

/* ─── Quick Actions / Suggested Questions ─── */
.chatbot-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  animation: chatbot-msg-in 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.1s both;
}

.chatbot-quick-btn {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.08);
  color: #93b4f5;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.chatbot-quick-btn:hover {
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(37, 99, 235, 0.45);
  color: #bdd0fa;
  transform: translateY(-1px);
}

.chatbot-quick-btn:active {
  transform: scale(0.97);
}

/* ─── Typing Indicator ─── */
.chatbot-typing {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
  animation: chatbot-msg-in 0.3s ease;
}

.chatbot-typing-dots {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  border-top-left-radius: 4px;
}

.chatbot-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #888888;
  animation: chatbot-typing-bounce 1.4s infinite ease-in-out;
}

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

@keyframes chatbot-typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* ─── Input Area ─── */
.chatbot-input-area {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.chatbot-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  color: #ffffff;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.chatbot-input::placeholder {
  color: #555555;
}

.chatbot-input:focus {
  border-color: rgba(37, 99, 235, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.chatbot-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.chatbot-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.4);
}

.chatbot-send-btn:active {
  transform: scale(0.95);
}

.chatbot-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.chatbot-send-btn svg {
  width: 18px;
  height: 18px;
}

/* ─── Phone CTA inside chat ─── */
.chatbot-phone-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12) 0%, rgba(16, 185, 129, 0.08) 100%);
  border: 1px solid rgba(37, 99, 235, 0.2);
  animation: chatbot-msg-in 0.4s ease 0.2s both;
}

.chatbot-phone-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  animation: chatbot-phone-ring 1.5s ease-in-out infinite;
}

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

.chatbot-phone-icon svg {
  width: 16px;
  height: 16px;
  color: #fff;
}

.chatbot-phone-info {
  flex: 1;
}

.chatbot-phone-label {
  font-size: 0.72rem;
  color: #888;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.chatbot-phone-number {
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.chatbot-phone-number a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.2s ease;
}

.chatbot-phone-number a:hover {
  color: #3b82f6;
}

/* ─── Powered By Footer ─── */
.chatbot-powered {
  text-align: center;
  padding: 8px;
  font-size: 0.65rem;
  color: #444;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  font-family: 'Inter', -apple-system, sans-serif;
  letter-spacing: 0.02em;
}

.chatbot-powered span {
  color: #2563eb;
  font-weight: 600;
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
  .chatbot-window {
    right: 12px;
    left: 12px;
    bottom: 90px;
    width: auto;
    max-height: 70vh;
  }

  .chatbot-toggle {
    bottom: 18px;
    right: 18px;
    width: 54px;
    height: 54px;
  }

  .chatbot-toggle svg {
    width: 24px;
    height: 24px;
  }

  .chatbot-messages {
    min-height: 200px;
    max-height: 50vh;
  }
}

/* ─── Welcome tooltip on first load ─── */
.chatbot-tooltip {
  position: fixed;
  bottom: 96px;
  right: 28px;
  z-index: 9997;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 18px;
  max-width: 240px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);

  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.chatbot-tooltip-text {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 0.82rem;
  color: #e5e5e5;
  line-height: 1.45;
}

.chatbot-tooltip-text strong {
  color: #2563eb;
}

.chatbot-tooltip-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 1rem;
  padding: 2px;
  line-height: 1;
}

.chatbot-tooltip-close:hover {
  color: #aaa;
}

/* Arrow pointing down to the button */
.chatbot-tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 24px;
  width: 12px;
  height: 12px;
  background: rgba(10, 10, 10, 0.95);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transform: rotate(45deg);
}

@media (max-width: 480px) {
  .chatbot-tooltip {
    right: 12px;
    bottom: 80px;
  }
}
