/**
 * Smart Tips Styles
 * 智能Tips样式
 */

/* ================================
   小气泡提示（上下文提示）
   ================================ */

.smart-tip-bubble {
  position: absolute;
  background: linear-gradient(135deg, rgba(255, 215, 0, 1), rgba(255, 193, 7, 1));
  color: #000;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 9999999;
  max-width: 280px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease-out;
  pointer-events: auto;
}

.smart-tip-bubble.show {
  opacity: 1;
  transform: translateY(0);
}

.smart-tip-bubble.center {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  max-width: 320px;
  padding: 20px;
  font-size: 16px;
  text-align: center;
}

.smart-tip-bubble.center.show {
  transform: translate(-50%, -50%) scale(1);
}

/* 警告样式 */
.smart-tip-bubble.warning {
  background: linear-gradient(135deg, rgba(220, 53, 69, 1), rgba(255, 107, 107, 1));
  color: white;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 庆祝样式 */
.smart-tip-bubble.celebration {
  background: linear-gradient(135deg, rgba(40, 167, 69, 1), rgba(32, 201, 151, 1));
  color: white;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* 箭头指示器 */
.smart-tip-bubble.position-top::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid rgba(255, 215, 0, 0.95);
}

.smart-tip-bubble.position-bottom::after {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid rgba(255, 215, 0, 0.95);
}

.smart-tip-bubble.position-left::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 8px solid rgba(255, 215, 0, 0.95);
}

.smart-tip-bubble.position-right::after {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 8px solid rgba(255, 215, 0, 0.95);
}

.smart-tip-content {
  margin-right: 24px;
}

.smart-tip-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  padding: 0;
  width: 20px;
  height: 20px;
  line-height: 1;
}

.smart-tip-close:hover {
  opacity: 1;
}

/* ================================
   浮动卡片（功能/营销提示）
   ================================ */

.smart-tip-card {
  position: fixed;
  bottom: 80px;
  right: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  z-index: 9999999;
  max-width: 340px;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: auto;
}

.smart-tip-card.show {
  opacity: 1;
  transform: translateX(0);
}

/* 功能提示卡片（简洁版） */
.smart-tip-card.feature {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.95), rgba(118, 75, 162, 0.95));
  border: 2px solid rgba(102, 126, 234, 0.8);
  padding: 16px;
}

.smart-tip-card-simple {
  display: flex;
  align-items: center;
  gap: 12px;
}

.smart-tip-card-simple .smart-tip-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.smart-tip-card-simple .smart-tip-message {
  font-size: 15px;
  color: #ffffff;
  font-weight: 600;
  line-height: 1.6;
  flex: 1;
  padding-right: 24px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 营销卡片（丰富版） */
.smart-tip-card.marketing {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0;
  overflow: hidden;
}

.smart-tip-card.marketing.featured {
  border: 3px solid #ffd700;
  box-shadow: 0 12px 32px rgba(255, 215, 0, 0.4);
}

.smart-tip-card.marketing.urgent {
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
  }
  50% {
    box-shadow: 0 12px 36px rgba(255, 215, 0, 0.6);
  }
}

.smart-tip-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.smart-tip-card-header .smart-tip-icon {
  font-size: 32px;
}

.smart-tip-card-header .smart-tip-title {
  font-size: 16px;
  font-weight: bold;
  flex: 1;
}

.smart-tip-card-body {
  padding: 12px 16px 16px;
}

.smart-tip-card-body .smart-tip-message {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 8px;
  opacity: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.smart-tip-card-body .smart-tip-detail {
  font-size: 13px;
  font-weight: 500;
  opacity: 1;
  margin: 0;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  border-left: 3px solid rgba(255, 215, 0, 1);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.smart-tip-card .smart-tip-close {
  position: absolute;
  top: 10px;
  right: 10px;
  color: white;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  z-index: 1;
}

.smart-tip-card .smart-tip-close:hover {
  background: rgba(0, 0, 0, 0.4);
}

/* ================================
   高亮效果
   ================================ */

.smart-tip-highlight {
  position: relative;
  animation: highlightPulse 2s ease-in-out;
  z-index: 9999 !important;
}

@keyframes highlightPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(255, 215, 0, 0);
  }
}

/* 庆祝脉冲（购物车按钮） */
.celebration-pulse {
  animation: celebrationPulse 1s ease-in-out;
}

@keyframes celebrationPulse {
  0%, 100% {
    transform: scale(1);
  }
  25%, 75% {
    transform: scale(1.1);
  }
  50% {
    transform: scale(1.15);
  }
}

/* ================================
   响应式设计
   ================================ */

@media (max-width: 768px) {
  .smart-tip-bubble {
    max-width: 90vw;
    font-size: 13px;
  }

  .smart-tip-bubble.center {
    max-width: 90vw;
    font-size: 15px;
  }

  .smart-tip-card {
    right: 10px;
    bottom: 70px;
    max-width: calc(100vw - 20px);
  }

  .smart-tip-card-header .smart-tip-icon {
    font-size: 28px;
  }

  .smart-tip-card-header .smart-tip-title {
    font-size: 15px;
  }

  .smart-tip-card-body .smart-tip-message {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .smart-tip-bubble {
    font-size: 12px;
    padding: 10px 14px;
  }

  .smart-tip-card {
    bottom: 60px;
  }

  .smart-tip-card-header {
    padding: 12px 12px 10px;
  }

  .smart-tip-card-header .smart-tip-icon {
    font-size: 24px;
  }

  .smart-tip-card-header .smart-tip-title {
    font-size: 14px;
  }

  .smart-tip-card-body {
    padding: 10px 12px 12px;
  }

  .smart-tip-card-body .smart-tip-message {
    font-size: 12px;
  }

  .smart-tip-card-body .smart-tip-detail {
    font-size: 11px;
    padding: 6px 10px;
  }
}

/* ================================
   暗色模式支持（可选）
   ================================ */

@media (prefers-color-scheme: dark) {
  .smart-tip-bubble {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.9), rgba(255, 193, 7, 0.9));
  }

  .smart-tip-card.feature {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    border-color: rgba(102, 126, 234, 0.5);
  }

  .smart-tip-card-simple .smart-tip-message {
    color: #f0f0f0;
  }
}
