/* ==========================================================================
   NAIKE GIFTS - NATIVE AI ASSISTANT FLOATING WIDGET STYLES
   ========================================================================== */

/* 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 #e2e8f0;
  border-radius: 16px;
  padding: 10px 16px;
  box-shadow: 0 12px 32px rgba(15, 34, 55, 0.16);
  font-size: 13.5px;
  font-weight: 600;
  color: #0f2237;
  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: 280px;
}
.naike-ai-bubble-hint:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(15, 34, 55, 0.2);
}
.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: #0f2237;
}

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

/* WhatsApp 悬浮按钮 (位于 AI 按钮上方) */
.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: #0f2237;
  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 #0f2237;
}
.naike-whatsapp-btn:hover .naike-whatsapp-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* 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: 12px;
  transition: all 0.2s ease;
}
.naike-ai-wa-chip:hover {
  background: #dcfce7;
  border-color: #86efac;
  transform: translateY(-1px);
}
.naike-ai-wa-chip svg {
  flex-shrink: 0;
}

.naike-ai-launcher-btn {
  pointer-events: auto;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f2237 0%, #1e3a5f 100%);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(15, 34, 55, 0.35);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  position: relative;
}
.naike-ai-launcher-btn:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 16px 40px rgba(15, 34, 55, 0.45);
}
.naike-ai-launcher-btn:active {
  transform: scale(0.96);
}

.naike-ai-launcher-btn .icon-open,
.naike-ai-launcher-btn .icon-close {
  position: absolute;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.naike-ai-launcher-btn .icon-open {
  opacity: 1;
  transform: rotate(0) scale(1);
}
.naike-ai-launcher-btn .icon-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}
.naike-ai-open .naike-ai-launcher-btn .icon-open {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}
.naike-ai-open .naike-ai-launcher-btn .icon-close {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.naike-ai-online-ping {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #ffffff;
}
.naike-ai-online-ping::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid #10b981;
  animation: pingGreen 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes pingGreen {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* 2. 聊天主面板 */
.naike-ai-panel {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 390px;
  height: 590px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(15, 34, 55, 0.22);
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  z-index: 99999;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.naike-ai-panel.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* 头部 Header */
.naike-ai-header {
  background: linear-gradient(135deg, #0f2237 0%, #173557 100%);
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.naike-ai-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.naike-ai-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b35 0%, #ff8f5a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.35);
  font-size: 20px;
  flex-shrink: 0;
}
.naike-ai-header-info h4 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 2px;
  color: #ffffff;
  letter-spacing: -0.01em;
}
.naike-ai-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #94a3b8;
}
.naike-ai-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}
.naike-ai-header-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}
.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: background 0.2s, color 0.2s;
  font-size: 14px;
}
.naike-ai-tool-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* 消息内容展示区 */
.naike-ai-messages {
  flex-grow: 1;
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f8fafc;
  scroll-behavior: smooth;
}
.naike-ai-messages::-webkit-scrollbar {
  width: 6px;
}
.naike-ai-messages::-webkit-scrollbar-track {
  background: transparent;
}
.naike-ai-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

/* 欢迎引导卡片 */
.naike-ai-welcome-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 14px rgba(15, 34, 55, 0.04);
}
.naike-ai-welcome-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f2237;
  margin-bottom: 6px;
}
.naike-ai-welcome-desc {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 12px;
}
.naike-ai-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.naike-ai-badge {
  font-size: 11px;
  font-weight: 700;
  background: #eff6ff;
  color: #2563eb;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #dbeafe;
}

/* 快捷提问胶囊 */
.naike-ai-suggestions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.naike-ai-pill-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.naike-ai-pill-btn:hover {
  background: #ffffff;
  border-color: #ff6b35;
  color: #ff6b35;
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.12);
}

/* 消息气泡 */
.naike-ai-msg {
  display: flex;
  gap: 10px;
  max-width: 92%;
  animation: msgFadeIn 0.3s ease;
}
@keyframes msgFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.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: #ff6b35;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}

.naike-ai-msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
}

.naike-ai-msg.user .naike-ai-msg-bubble {
  background: linear-gradient(135deg, #0f2237 0%, #1e3a5f 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(15, 34, 55, 0.18);
}

.naike-ai-msg.ai .naike-ai-msg-bubble {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
  box-shadow: 0 4px 14px rgba(15, 34, 55, 0.05);
}

.naike-ai-msg.ai .naike-ai-msg-bubble strong {
  color: #0f2237;
}
.naike-ai-msg.ai .naike-ai-msg-bubble ul,
.naike-ai-msg.ai .naike-ai-msg-bubble ol {
  padding-left: 20px;
  margin: 6px 0;
}
.naike-ai-msg.ai .naike-ai-msg-bubble li {
  margin-bottom: 4px;
}
.naike-ai-msg.ai .naike-ai-msg-bubble p {
  margin-bottom: 8px;
}
.naike-ai-msg.ai .naike-ai-msg-bubble p:last-child {
  margin-bottom: 0;
}

/* 询价引导快捷按钮 */
.naike-ai-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 14px;
  background: #ff6b35;
  color: #ffffff !important;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease, transform 0.2s ease;
}
.naike-ai-action-btn:hover {
  background: #e55a2b;
  transform: translateY(-1px);
}

/* 打字等待指示器 */
.naike-ai-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 18px;
}
.naike-ai-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  animation: typingDot 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 typingDot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; background: #ff6b35; }
}

/* 底部输入框 */
.naike-ai-footer {
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.naike-ai-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 6px 8px 6px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.naike-ai-input-row:focus-within {
  border-color: #ff6b35;
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
  background: #ffffff;
}
.naike-ai-input {
  flex-grow: 1;
  border: none;
  background: transparent;
  font-size: 13.5px;
  color: #0f2237;
  outline: none;
  font-family: inherit;
  resize: none;
  max-height: 80px;
  line-height: 1.4;
}
.naike-ai-input::placeholder {
  color: #94a3b8;
}
.naike-ai-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #ff6b35;
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.naike-ai-send-btn:hover:not(:disabled) {
  background: #0f2237;
  transform: translateY(-1px);
}
.naike-ai-send-btn:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
}

.naike-ai-powered-by {
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.naike-ai-powered-by strong {
  color: #64748b;
}

/* 移动端全屏响应式 */
@media (max-width: 480px) {
  .naike-ai-launcher-wrap {
    bottom: 20px;
    right: 20px;
  }
  .naike-ai-panel {
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }
  .naike-ai-bubble-hint {
    display: none;
  }
}
