/* ============================================================
   chat-widget.css — AIWF Floating Chat Widget
   Replaces GoHighLevel chat widget (removed 2026-03-28)
   ============================================================ */

/* --- Launcher Button --- */
#aiwf-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2147483640;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #194BBE, #2563eb);
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(25, 75, 190, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#aiwf-chat-launcher:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 28px rgba(25, 75, 190, 0.5);
}

#aiwf-chat-launcher svg {
  width: 28px;
  height: 28px;
  fill: #fff;
}

#aiwf-chat-launcher .close-icon {
  display: none;
}

#aiwf-chat-launcher.open .chat-icon {
  display: none;
}

#aiwf-chat-launcher.open .close-icon {
  display: block;
}

/* --- Nudge Bubble --- */
#aiwf-chat-nudge {
  position: fixed;
  bottom: 92px;
  right: 24px;
  z-index: 2147483639;
  background: linear-gradient(135deg, #194BBE, #FFD700);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  white-space: nowrap;
  animation: aiwfNudgePulse 2s ease-in-out infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#aiwf-chat-nudge.visible {
  opacity: 1;
}

@keyframes aiwfNudgePulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* --- Chat Panel --- */
#aiwf-chat-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  z-index: 2147483641;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

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

/* --- Header --- */
.aiwf-chat-header {
  background: linear-gradient(135deg, #194BBE, #2563eb);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.aiwf-chat-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.aiwf-chat-header-info h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.aiwf-chat-header-info p {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: 0.85;
}

/* --- Messages Area --- */
.aiwf-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aiwf-chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
}

.aiwf-chat-msg.bot {
  align-self: flex-start;
  background: #f0f4ff;
  color: #1a1a2e;
  border-bottom-left-radius: 4px;
}

.aiwf-chat-msg.user {
  align-self: flex-end;
  background: #194BBE;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.aiwf-chat-msg.system {
  align-self: center;
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 13px;
  text-align: center;
  border-radius: 10px;
}

.aiwf-chat-msg.error {
  align-self: center;
  background: #ffeaea;
  color: #c62828;
  font-size: 13px;
  text-align: center;
  border-radius: 10px;
}

/* --- Typing Indicator --- */
.aiwf-chat-typing {
  display: none;
  align-self: flex-start;
  padding: 10px 14px;
  background: #f0f4ff;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  gap: 4px;
}

.aiwf-chat-typing.visible {
  display: flex;
}

.aiwf-chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #194BBE;
  opacity: 0.4;
  animation: aiwfTypingDot 1.2s infinite;
}

.aiwf-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.aiwf-chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes aiwfTypingDot {
  0%, 80%, 100% { opacity: 0.4; transform: scale(1); }
  40% { opacity: 1; transform: scale(1.2); }
}

/* --- Input Area --- */
.aiwf-chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
  background: #fafafa;
}

.aiwf-chat-input input {
  flex: 1;
  border: 1px solid #d1d5db;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.aiwf-chat-input input:focus {
  border-color: #194BBE;
}

.aiwf-chat-input button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #194BBE;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.aiwf-chat-input button:hover {
  background: #1e40af;
}

.aiwf-chat-input button:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.aiwf-chat-input button svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

/* --- Powered By --- */
.aiwf-chat-powered {
  text-align: center;
  font-size: 11px;
  color: #9ca3af;
  padding: 6px;
  background: #fafafa;
  border-top: 1px solid #f0f0f0;
}

/* --- Contact Form Styles (on contact page) --- */
#aiwf-contact-form .form-group {
  margin-bottom: 16px;
}

#aiwf-contact-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 14px;
  color: #1a1a2e;
}

#aiwf-contact-form label .required {
  color: #c62828;
}

#aiwf-contact-form input,
#aiwf-contact-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

#aiwf-contact-form input:focus,
#aiwf-contact-form textarea:focus {
  outline: none;
  border-color: #194BBE;
  box-shadow: 0 0 0 3px rgba(25, 75, 190, 0.1);
}

#aiwf-contact-form textarea {
  resize: vertical;
}

.contact-submit-btn {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.contact-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-status {
  margin-top: 12px;
  padding: 0;
  font-size: 14px;
  text-align: center;
  min-height: 20px;
}

.form-status-success {
  color: #2e7d32;
  font-weight: 600;
  padding: 12px;
  background: #e8f5e9;
  border-radius: 8px;
}

.form-status-error {
  color: #c62828;
  font-weight: 600;
  padding: 12px;
  background: #ffeaea;
  border-radius: 8px;
}

/* --- Mobile Responsive --- */
@media (max-width: 480px) {
  #aiwf-chat-panel {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    max-width: 100vw;
    border-radius: 0;
  }

  #aiwf-chat-launcher {
    bottom: 16px;
    right: 16px;
    width: 54px;
    height: 54px;
  }

  #aiwf-chat-nudge {
    bottom: 78px;
    right: 16px;
    font-size: 13px;
  }
}
