/**
 * 纳爱斯牙膏 - 挤压动画效果
 */

/* 牙膏管容器 */
.toothpaste-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 牙膏管互动区域 */
.toothpaste-interactive {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden; /* 防止内容溢出 */
}

/* 牙膏管样式 */
.toothpaste-tube {
  position: relative;
  width: 200px;
  height: 120px;
  cursor: pointer;
  transform-origin: center;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.1));
}

/* 牙膏管悬停效果 */
.toothpaste-tube:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 6px 5px rgba(0, 0, 0, 0.15));
}

/* 牙膏管点击效果 */
.toothpaste-tube:active {
  transform: scale(0.98);
}

/* 牙膏挤出效果 */
.toothpaste-paste {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  height: 0;
  width: 0;
  background: linear-gradient(to right, rgba(255,255,255,0.9), rgba(255,255,255,0.7));
  border-radius: 10px;
  z-index: 15;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 牙膏挤压动画 */
@keyframes squeezeToothpaste {
  0% {
    width: 0;
    height: 0;
    opacity: 0;
    left: 50%;
    transform: translate(-80%, -50%);
  }
  20% {
    width: 20px;
    height: 10px;
    opacity: 1;
    left: 50%;
    transform: translate(-70%, -50%);
  }
  40% {
    width: 40px;
    height: 15px;
    left: 50%;
    transform: translate(-60%, -50%);
  }
  60% {
    width: 60px;
    height: 18px;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  80% {
    width: 80px;
    height: 20px;
    left: 50%;
    transform: translate(-40%, -50%);
  }
  100% {
    width: 100px;
    height: 22px;
    left: 50%;
    transform: translate(-30%, -50%);
    opacity: 1;
  }
}

/* 牙膏管挤压动画 */
@keyframes tubePress {
  0% {
    transform: scale(1, 1);
  }
  30% {
    transform: scale(1.05, 0.95);
  }
  60% {
    transform: scale(1.1, 0.9);
  }
  100% {
    transform: scale(1, 1);
  }
}

/* 牙膏管扭曲动画 */
@keyframes tubeTwist {
  0% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-3deg);
  }
  75% {
    transform: rotate(3deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

/* 牙刷动画 */
@keyframes brushMove {
  0% {
    transform: translateX(-10px) rotate(-5deg);
  }
  50% {
    transform: translateX(10px) rotate(5deg);
  }
  100% {
    transform: translateX(-10px) rotate(-5deg);
  }
}

/* 泡沫动画 */
@keyframes bubbleRise {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.7;
  }
  100% {
    transform: translateY(-100px) scale(0.5);
    opacity: 0;
  }
}

/* 应用挤牙膏动画 */
.toothpaste-squeeze {
  animation: squeezeToothpaste 1s forwards;
}

/* 应用牙膏管挤压动画 */
.tube-press {
  animation: tubePress 0.5s ease-in-out;
}

/* 应用牙膏管扭曲动画 */
.tube-twist {
  animation: tubeTwist 0.5s ease-in-out;
}

/* 应用刷牙动画 */
.brushing-animation {
  animation: brushMove 0.5s ease-in-out infinite;
}

/* 牙刷元素 */
.toothbrush-element {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  opacity: 0;
  transition: opacity 0.5s ease;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

/* 泡沫容器 */
.bubble-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 25;
}

/* 泡沫样式 */
.bubble {
  position: absolute;
  border-radius: 50%;
  opacity: 0.7;
  animation: bubbleRise 2s ease-in forwards;
  box-shadow: 0 0 2px rgba(255, 255, 255, 0.5);
}

/* 完成消息 */
.completion-message {
  position: absolute;
  top: 10px;
  right: 10px;
  width: auto;
  height: auto;
  padding: 6px 12px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  animation: fadeIn 0.5s ease-in;
  z-index: 30;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(209, 213, 219, 0.3);
}

/* 表情容器 */
.emoji-container {
  width: 18px;
  height: 18px;
  background-color: #10B981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
}

/* 文字容器 - 横向文字 */
.vertical-text {
  font-size: 12px;
  color: #10B981;
  font-weight: 500;
  margin: 0;
}

/* 淡入动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 淡出动画 */
@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* 牙膏流动动画 */
@keyframes flowPaste {
  0% {
    width: 100px;
    height: 22px;
    opacity: 1;
    transform: translate(-30%, -50%);
  }
  50% {
    width: 110px;
    height: 25px;
    opacity: 0.8;
    transform: translate(-25%, -50%);
  }
  100% {
    width: 20px;
    height: 30px;
    opacity: 0.2;
    transform: translate(-20%, -40%);
  }
}

/* 应用牙膏流动动画 */
.toothpaste-flow {
  animation: flowPaste 2s ease-out forwards !important;
}

/* 指导文本 */
.toothpaste-instruction {
  text-align: center;
  font-size: 14px;
  animation: pulse 2s infinite;
}

/* 脉冲动画 */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
} 