/* AI Lead Converter Pro - Frontend Styles */

#alc-chatbot-container {
  /* Core brand colors */
  --alc-primary: #667eea;
  --alc-secondary: #764ba2;
  --alc-accent: #f093fb;
  
  /* Text colors */
  --alc-text: #1f2937;
  --alc-muted: #6b7280;
  --alc-text-color-header: #111827;
  --alc-text-color-messages: #1f2937;
  --alc-text-color-muted: #6b7280;
  
  /* Background colors */
  --alc-bg: #ffffff;
  --alc-surface: #ffffff;
  --alc-bg-color-chat: #ffffff;
  --alc-bg-color-messages-ai: rgba(102,126,234,0.08);
  --alc-bg-color-input: #ffffff;
  
  /* Border & shadow */
  --alc-border: rgba(17, 24, 39, 0.12);
  --alc-border-color: rgba(17, 24, 39, 0.12);
  --alc-shadow: 0 12px 30px rgba(0,0,0,0.18);
  --alc-shadow-intensity: 12px;
  --alc-shadow-blur: 30px;
  
  /* Typography */
  --alc-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --alc-font-size-header: 14px;
  --alc-font-size-messages: 13px;
  --alc-font-size-input: 13px;
  --alc-font-size-popup: 13px;
  --alc-line-height: 1.35;
  
  /* Border radius */
  --alc-border-radius-button: 9999px;
  --alc-border-radius-chat: 18px;
  --alc-border-radius-messages: 14px;
  --alc-border-radius-input: 12px;
  --alc-avatar-border-radius: 50%;
  
  /* Gradient */
  --alc-gradient-angle: 135deg;

  position: fixed;
  inset: 0;
  z-index: 999999;
  pointer-events: none;
  font-family: var(--alc-font-family);
}

.alc-floating-button {
    position: absolute;
}

#alc-floating-button{
  right: 18px !important;
  bottom: 18px !important;
}

#alc-chat-window,
#alc-popup-bubble {
  pointer-events: auto;
}


#alc-chatbot-container * {
  box-sizing: border-box;
}

.alc-floating-button {
  /* IMPORTANT: must be positioned inside the fixed container so JS can place it */
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 9999px;
  cursor: pointer;
  user-select: none;
  outline: none;
}

.alc-button-ring {
  position: absolute;
  inset: -6px;
  border-radius: 9999px;
  background: conic-gradient(from 0deg, var(--alc-primary), var(--alc-accent), var(--alc-secondary), var(--alc-primary));
  animation: alc-rotate 1.6s linear infinite;
  filter: blur(0px);
}

.alc-floating-button::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 9999px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.35), transparent 55%);
  animation: alc-pulse 2.4s ease-in-out infinite;
}

.alc-button-avatar {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  overflow: hidden;
  background: var(--alc-bg);
  box-shadow: 0 12px 24px rgba(0,0,0,0.22);
}

.alc-button-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.alc-button-open .alc-button-ring,
.alc-button-open::after {
  animation-play-state: paused;
}

.alc-button-open .alc-button-ring {
  opacity: 0.35;
}

.alc-popup-bubble {
  position: absolute;
  max-width: 260px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.96);
  border: 1px solid var(--alc-border);
  box-shadow: 0 18px 30px rgba(0,0,0,0.14);
  color: var(--alc-text);
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.alc-popup-bubble p {
  margin: 0;
  font-size: 13px;
  line-height: 1.25;
}

.alc-popup-arrow {
  position: absolute;
  width: 10px;
  height: 10px;
  background: rgba(255,255,255,0.96);
  border-left: 1px solid var(--alc-border);
  border-bottom: 1px solid var(--alc-border);
  transform: rotate(45deg);
}

.alc-popup-close {
  position: absolute;
  top: 4px;
  right: 8px;
  border: none;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  color: var(--alc-muted);
  cursor: pointer;
}

.alc-chat-window {
  position: absolute;
  right: 0;
  bottom: 90px;
  width: 400px;
  height: 600px;
  max-height: 80vh;
  /* Frosted / glass look (blue-white) */
  background: linear-gradient(
    180deg,
    rgba(245, 250, 255, 0.82) 0%,
    rgba(237, 246, 255, 0.70) 55%,
    rgba(255, 255, 255, 0.60) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 18px;
  box-shadow: var(--alc-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.alc-chat-opening {
  transform: translateY(10px);
  opacity: 0;
  animation: alc-in 0.22s ease-out forwards;
}

.alc-chat-closing {
  animation: alc-out 0.18s ease-in forwards;
}

.alc-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  background: linear-gradient(135deg, rgba(102,126,234,0.10), rgba(240,147,251,0.10));
}

.alc-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.alc-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  border: 1px solid rgba(0,0,0,0.08);
  object-fit: cover;
}

.alc-header-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--alc-text);
}

.alc-header-status {
  font-size: 12px;
  color: var(--alc-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.alc-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34,197,94,0.14);
}

.alc-header-actions button {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: rgba(255,255,255,0.75);
  cursor: pointer;
  font-size: 18px;
  color: var(--alc-text);
}

.alc-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: rgba(255, 255, 255, 0.35);
}

.alc-message {
  display: flex;
  margin-bottom: 10px;
}

.alc-message-ai {
  justify-content: flex-start;
}

.alc-message-user {
  justify-content: flex-end;
}

.alc-message-bubble {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.35;
  border: 1px solid rgba(17, 24, 39, 0.08);
}

.alc-message-ai .alc-message-bubble {
  background: rgba(102,126,234,0.08);
  color: var(--alc-text);
}

.alc-message-user .alc-message-bubble {
  background: linear-gradient(135deg, rgba(102,126,234,0.95), rgba(118,75,162,0.95));
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.18);
}

.alc-message-time {
  margin-top: 6px;
  font-size: 11px;
  opacity: 0.75;
}

.alc-typing-indicator {
  padding: 10px 14px;
}

.alc-typing-indicator span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: rgba(17,24,39,0.35);
  margin-right: 4px;
  animation: alc-bounce 1.1s infinite;
}

.alc-typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.alc-typing-indicator span:nth-child(3) { animation-delay: 0.30s; }

.alc-chat-input {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(17, 24, 39, 0.08);
  background: rgba(245, 250, 255, 0.68);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#alc-message-input {
  flex: 1;
  resize: none;
  border: 1px solid rgba(17,24,39,0.14);
  border-radius: 12px;
  padding: 10px 10px;
  outline: none;
  font-size: 13px;
  line-height: 1.2;
}

#alc-message-input:focus {
  border-color: rgba(102,126,234,0.85);
  box-shadow: 0 0 0 4px rgba(102,126,234,0.16);
}

.alc-send-button {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--alc-primary), var(--alc-secondary));
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(0,0,0,0.15);
}

.alc-send-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@keyframes alc-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes alc-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(102,126,234,0.0); }
  50% { box-shadow: 0 0 0 18px rgba(102,126,234,0.12); }
}

@keyframes alc-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.55; }
  40% { transform: translateY(-4px); opacity: 1; }
}

@keyframes alc-in {
  to { transform: translateY(0); opacity: 1; }
}

@keyframes alc-out {
  to { transform: translateY(8px); opacity: 0; }
}

@media (max-width: 480px) {
  .alc-chat-window {
    width: calc(100vw - 24px);
    right: -6px;
    height: 70vh;
  }
}

/* Animation Speed Variants */
#alc-chatbot-container.alc-animate-slow .alc-button-ring {
  animation-duration: 3.2s;
}

#alc-chatbot-container.alc-animate-slow .alc-floating-button::after {
  animation-duration: 4.8s;
}

#alc-chatbot-container.alc-animate-slow .alc-chat-opening {
  animation-duration: 0.44s;
}

#alc-chatbot-container.alc-animate-slow .alc-chat-closing {
  animation-duration: 0.36s;
}

#alc-chatbot-container.alc-animate-fast .alc-button-ring {
  animation-duration: 0.8s;
}

#alc-chatbot-container.alc-animate-fast .alc-floating-button::after {
  animation-duration: 1.2s;
}

#alc-chatbot-container.alc-animate-fast .alc-chat-opening {
  animation-duration: 0.11s;
}

#alc-chatbot-container.alc-animate-fast .alc-chat-closing {
  animation-duration: 0.09s;
}

/* Animation Toggles */
#alc-chatbot-container.alc-no-ring .alc-button-ring {
  display: none;
}

#alc-chatbot-container.alc-no-pulse .alc-floating-button::after {
  display: none;
}

#alc-chatbot-container.alc-no-animations .alc-chat-opening,
#alc-chatbot-container.alc-no-animations .alc-chat-closing {
  animation: none;
  opacity: 1;
  transform: none;
}

/* Touch-friendly spacing for mobile */
#alc-chatbot-container.alc-touch-friendly .alc-chat-input {
  padding: 14px;
}

#alc-chatbot-container.alc-touch-friendly #alc-message-input {
  padding: 14px;
  min-height: 48px;
}

#alc-chatbot-container.alc-touch-friendly .alc-send-button {
  width: 48px;
  height: 48px;
}

#alc-chatbot-container.alc-touch-friendly .alc-message-bubble {
  padding: 14px 16px;
}
