/* animations.css - 动画效果样式 */

/* 淡入动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 1s ease-in;
}

/* 从下方滑入 */
@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.slide-up {
  animation: slideUp 0.8s ease-out;
}

/* 从左侧滑入 */
@keyframes slideInLeft {
  from {
    transform: translateX(-50px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-in-left {
  animation: slideInLeft 0.8s ease-out;
}

/* 从右侧滑入 */
@keyframes slideInRight {
  from {
    transform: translateX(50px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-in-right {
  animation: slideInRight 0.8s ease-out;
}

/* 脉动动画 */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.pulse {
  animation: pulse 2s infinite;
}

/* 摇摆动画 - 适用于尤克里里图标等 */
@keyframes swing {
  0% {
    transform: rotate(0deg);
  }
  10% {
    transform: rotate(10deg);
  }
  30% {
    transform: rotate(-10deg);
  }
  50% {
    transform: rotate(6deg);
  }
  70% {
    transform: rotate(-6deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

.swing:hover {
  animation: swing 1s ease;
  transform-origin: top center;
}

/* 波浪效果 - 适用于海洋相关主题元素 */
@keyframes wave {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 100% 0;
  }
}

.wave-bg {
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--primary-color));
  background-size: 200% 200%;
  animation: wave 3s linear infinite;
}

/* 渐变文本效果 */
@keyframes textGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.gradient-text {
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textGradient 5s linear infinite;
}

/* 滚动显示动画 - 用于在滚动时显示元素 */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* 时间线动画 */
@keyframes timelineAppear {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.timeline-item-left .timeline-content {
  animation: timelineAppear 0.8s ease-out;
}

@keyframes timelineAppearRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.timeline-item-right .timeline-content {
  animation: timelineAppearRight 0.8s ease-out;
}

/* 闪烁效果 - 可用于强调某些元素 */
@keyframes blink {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

.blink {
  animation: blink 2s infinite;
}

/* 卡片悬停时的动画 */
.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

/* 按钮点击效果 */
.btn:active {
  transform: scale(0.98);
}

/* 加载动画 */
@keyframes spinner {
  to {
    transform: rotate(360deg);
  }
}

.loading {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spinner 1s linear infinite;
}