/* ==========================================================================
   NAIKE FOOTWEAR TRIMS & HARDWARE - NATIVE AI ASSISTANT FLOATING WIDGET
   Design System: Warm Neutral Ivory, Industrial Navy & High-Visibility Orange
   ========================================================================== */

/* 1. 悬浮球启动按钮与欢迎引导气泡容器 */
.naike-ai-launcher-wrap {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 99998;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}

/* 悬浮引导气泡 */
.naike-ai-bubble-hint {
  pointer-events: auto;
  margin-bottom: 12px;
  background: #ffffff;
  border: 1px solid #e6e0d5;
  border-radius: 16px;
  padding: 10px 16px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.25s ease, opacity 0.25s ease, box-shadow 0.25s ease;
  animation: naikeFloat 3s ease-in-out infinite;
  max-width: 320px;
}
.naike-ai-bubble-hint:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
}
.naike-ai-bubble-hint .bubble-close {
  color: #94a3b8;
  font-size: 16px;
  margin-left: auto;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.naike-ai-bubble-hint .bubble-close:hover {
  color: #ea580c;
}

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

/* 2. WhatsApp 官方直连悬浮按钮 */
.naike-whatsapp-btn {
  pointer-events: auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #25D366;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, background 0.2s ease;
  margin-bottom: 10px;
  position: relative;
}
.naike-whatsapp-btn:hover {
  background: #20ba5a;
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 32px rgba(37, 211, 102, 0.55);
}
.naike-whatsapp-btn:active {
  transform: scale(0.95);
}
.naike-whatsapp-btn svg {
  width: 28px;
  height: 28px;
  fill: #ffffff;
}
.naike-whatsapp-tooltip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background: #0f172a;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.naike-whatsapp-tooltip::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 100%;
  margin-top: -4px;
  border-width: 4px;
  border-style: solid;
  border-color: transparent transparent transparent #0f172a;
}
.naike-whatsapp-btn:hover .naike-whatsapp-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* 3. AI 智能球启动按钮 */
.naike-ai-launcher-btn {
  pointer-events: auto;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: 0 10px 28px rgba(2, 132, 199, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}
.naike-ai-launcher-btn:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 14px 36px rgba(2, 132, 199, 0.6);
}
.naike-ai-launcher-btn:active {
  transform: scale(0.95);
}

/* 翠绿色呼吸在线脉冲 */
.naike-ai-online-ping {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
}
.naike-ai-online-ping::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #22c55e;
  opacity: 0.8;
  animation: naikePing 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes naikePing {
  0% { transform: scale(0.8); opacity: 0.9; }
  75%, 100% { transform: scale(2.2); opacity: 0; }
}

.naike-ai-launcher-btn .icon-open,
.naike-ai-launcher-btn .icon-close {
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.naike-ai-launcher-btn .icon-close {
  display: none;
}
body.naike-ai-open .naike-ai-launcher-btn .icon-open {
  display: none;
}
body.naike-ai-open .naike-ai-launcher-btn .icon-close {
  display: block;
}

/* 4. AI 聊天主面板 */
.naike-ai-panel {
  position: fixed;
  bottom: 104px;
  right: 28px;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 130px);
  background: #ffffff;
  border: 1px solid #e6e0d5;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  z-index: 99999;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.96);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.naike-ai-panel.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* 顶部导航头 */
.naike-ai-header {
  padding: 16px 20px;
  background: #0f172a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.naike-ai-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.naike-ai-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.35);
}
.naike-ai-header-info h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}
.naike-ai-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 2px;
}
.naike-ai-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.8);
}
.naike-ai-header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
.naike-ai-tool-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #cbd5e1;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.naike-ai-tool-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* 消息流容器 */
.naike-ai-messages {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  background: #fcfbf9;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

/* 欢迎卡片 */
.naike-ai-welcome-box {
  background: #ffffff;
  border: 1px solid #e6e0d5;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
.naike-ai-welcome-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}
.naike-ai-welcome-desc {
  font-size: 12.5px;
  line-height: 1.5;
  color: #64748b;
  margin-bottom: 12px;
}
.naike-ai-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.naike-ai-badge {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

/* AI 聊天窗内的 WhatsApp 条 */
.naike-ai-wa-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534 !important;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 14px;
  transition: all 0.2s ease;
}
.naike-ai-wa-chip:hover {
  background: #dcfce7;
  border-color: #86efac;
}

/* 快捷问题芯片组 */
.naike-ai-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.naike-ai-pill-btn {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  color: #1e293b;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.naike-ai-pill-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #0284c7;
  transform: translateX(3px);
}

/* 对话消息体 */
.naike-ai-msg {
  display: flex;
  gap: 10px;
  max-width: 90%;
}
.naike-ai-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.naike-ai-msg.ai {
  align-self: flex-start;
}
.naike-ai-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}
.naike-ai-msg.user .naike-ai-msg-avatar {
  background: #0284c7;
}
.naike-ai-msg-bubble {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.naike-ai-msg.user .naike-ai-msg-bubble {
  background: #0284c7;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}
.naike-ai-msg.ai .naike-ai-msg-bubble {
  background: #ffffff;
  border: 1px solid #e6e0d5;
  color: #1e293b;
  border-bottom-left-radius: 4px;
}
.naike-ai-msg-bubble strong {
  font-weight: 700;
  color: inherit;
}
.naike-ai-msg-bubble ul, .naike-ai-msg-bubble ol {
  margin: 6px 0;
  padding-left: 18px;
}
.naike-ai-msg-bubble li {
  margin-bottom: 4px;
}
.naike-ai-msg-bubble p {
  margin: 4px 0;
}

/* 答复底部行动按钮 */
.naike-ai-action-group {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.naike-ai-action-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #25D366;
  color: #ffffff !important;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
}
.naike-ai-action-wa-btn:hover {
  background: #20ba5a;
}
.naike-ai-action-btn {
  background: #ea580c;
  color: #ffffff;
  border: none;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25);
  transition: all 0.2s ease;
}
.naike-ai-action-btn:hover {
  background: #c2410c;
  transform: translateY(-1px);
}

/* 打字等待波浪 */
.naike-ai-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}
.naike-ai-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: naikeTypingDot 1.4s infinite ease-in-out both;
}
.naike-ai-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.naike-ai-typing-dot:nth-child(2) { animation-delay: -0.16s; }

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

/* 底部输入框 */
.naike-ai-footer {
  padding: 14px 18px;
  background: #ffffff;
  border-top: 1px solid #e6e0d5;
}
.naike-ai-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 6px 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.naike-ai-input-row:focus-within {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
  background: #ffffff;
}
.naike-ai-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 13.5px;
  color: #1e293b;
  resize: none;
  max-height: 90px;
  padding: 4px 0;
  font-family: inherit;
}
.naike-ai-input::placeholder {
  color: #94a3b8;
}
.naike-ai-send-btn {
  background: #0284c7;
  color: #ffffff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.naike-ai-send-btn:hover:not(:disabled) {
  background: #0369a1;
}
.naike-ai-send-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

.naike-ai-powered-by {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 8px;
}

/* 响应式适配移动端 */
@media (max-width: 480px) {
  .naike-ai-panel {
    right: 12px;
    bottom: 84px;
    width: calc(100vw - 24px);
    height: calc(100vh - 100px);
  }
  .naike-ai-launcher-wrap {
    right: 16px;
    bottom: 16px;
  }
}
