/* Animations.css - 集中管理所有动画效果 */

/* ============================================
   Keyframe Animations
   ============================================ */

/* 淡入动画 - 从下方淡入上滑 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 淡入动画 - 从左侧淡入 */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 淡入动画 - 从右侧淡入 */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 缩放动画 - 从小到大 */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

/* 脉冲动画 - 轻微放大缩小 */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* 浮动动画 - 上下浮动 */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* 发光动画 - 边框发光效果 */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(196, 30, 58, 0.2), 0 0 10px rgba(196, 30, 58, 0.1);
  }
  50% {
    box-shadow: 0 0 15px rgba(196, 30, 58, 0.4), 0 0 25px rgba(196, 30, 58, 0.2);
  }
}

/* 旋转动画 */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* 页面加载动画 - 顶部进度条 */
@keyframes loadingBar {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

/* ============================================
   Animation Utility Classes
   ============================================ */

/* 基础动画类 - 初始状态为隐藏 */
.animate {
  opacity: 0;
  animation-fill-mode: forwards;
  animation-duration: 0.6s;
  animation-timing-function: ease-out;
}

/* 淡入上滑 */
.animate-fadeInUp {
  animation-name: fadeInUp;
}

/* 淡入左侧 */
.animate-fadeInLeft {
  animation-name: fadeInLeft;
}

/* 淡入右侧 */
.animate-fadeInRight {
  animation-name: fadeInRight;
}

/* 缩放淡入 */
.animate-scaleIn {
  animation-name: scaleIn;
}

/* 简单淡入 */
.animate-fadeIn {
  animation-name: fadeIn;
}

/* 动画延迟类 - 创建交错动画效果 */
.animate-delay-1 {
  animation-delay: 0.1s;
}

.animate-delay-2 {
  animation-delay: 0.2s;
}

.animate-delay-3 {
  animation-delay: 0.3s;
}

.animate-delay-4 {
  animation-delay: 0.4s;
}

.animate-delay-5 {
  animation-delay: 0.5s;
}

.animate-delay-6 {
  animation-delay: 0.6s;
}

/* 持续动画类 - 持续播放的动画 */
.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

/* ============================================
   Page Load Animation
   ============================================ */

/* 页面加载遮罩 */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary, #FFFFFF);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.loaded {
  opacity: 0;
  visibility: hidden;
}

.page-loader-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--border-color, #DEE2E6);
  border-top-color: var(--color-primary, #C41E3A);
  border-radius: 50%;
  animation: rotate 0.8s linear infinite;
}

/* 页面加载进度条 */
.page-loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary, #C41E3A), var(--color-primary-light, #E63946));
  z-index: 10000;
  animation: loadingBar 1s ease-out forwards;
}

/* ============================================
   Hover Animations
   ============================================ */

/* 卡片悬停 - 提升 + 发光 */
.hover-lift {
  transition: all var(--transition-base, 300ms ease);
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 
    0 12px 24px rgba(0, 0, 0, 0.12),
    0 8px 16px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(196, 30, 58, 0.1);
}

/* 卡片悬停 - 强烈提升 */
.hover-lift-strong {
  transition: all var(--transition-base, 300ms ease);
}

.hover-lift-strong:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.15),
    0 12px 24px rgba(0, 0, 0, 0.1),
    0 0 0 2px rgba(196, 30, 58, 0.2);
}

/* 卡片悬停 - 边框发光 */
.hover-glow {
  transition: all var(--transition-base, 300ms ease);
  border: 2px solid transparent;
}

.hover-glow:hover {
  box-shadow: 
    0 0 0 3px rgba(196, 30, 58, 0.1),
    0 0 20px rgba(196, 30, 58, 0.2),
    0 10px 20px rgba(0, 0, 0, 0.1);
  border-color: var(--color-primary, #C41E3A);
}

/* 按钮悬停 - 发光效果 */
.btn-hover-glow {
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base, 300ms ease);
}

.btn-hover-glow::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn-hover-glow:hover::before {
  width: 300px;
  height: 300px;
}

/* 链接悬停 - 下划线动画 */
.hover-underline {
  position: relative;
}

.hover-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary, #C41E3A);
  transition: width var(--transition-base, 300ms ease);
}

.hover-underline:hover::after {
  width: 100%;
}

/* 图片悬停 - 缩放 */
.hover-zoom {
  overflow: hidden;
}

.hover-zoom img {
  transition: transform var(--transition-slow, 500ms ease);
}

.hover-zoom:hover img {
  transform: scale(1.1);
}

/* 图标悬停 - 旋转 */
.hover-rotate {
  transition: transform var(--transition-base, 300ms ease);
}

.hover-rotate:hover {
  transform: rotate(360deg);
}

/* ============================================
   Scroll Reveal Animations
   ============================================ */

/* 滚动触发动画的元素初始状态 */
[data-scroll] {
  opacity: 0;
  transition: all 0.6s ease-out;
}

[data-scroll="fade-up"] {
  transform: translateY(40px);
}

[data-scroll="fade-left"] {
  transform: translateX(-40px);
}

[data-scroll="fade-right"] {
  transform: translateX(40px);
}

[data-scroll="zoom-in"] {
  transform: scale(0.9);
}

/* 滚动触发后的状态 */
[data-scroll].is-visible {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}

/* ============================================
   Hero Section Animations
   ============================================ */

/* Hero 内容动画 */
.hero-content {
  animation: fadeInUp 1s ease-out forwards;
}

.hero-title {
  animation: fadeInUp 1s ease-out 0.2s forwards;
  opacity: 0;
}

.hero-subtitle {
  animation: fadeInUp 1s ease-out 0.4s forwards;
  opacity: 0;
}

.hero-points {
  animation: fadeInUp 1s ease-out 0.6s forwards;
  opacity: 0;
}

.hero-point {
  animation: fadeInUp 1s ease-out forwards;
  opacity: 0;
}

.hero-point:nth-child(1) {
  animation-delay: 0.8s;
}

.hero-point:nth-child(2) {
  animation-delay: 1s;
}

.hero-point:nth-child(3) {
  animation-delay: 1.2s;
}

.hero-cta {
  animation: fadeInUp 1s ease-out 1.4s forwards;
  opacity: 0;
}

/* ============================================
   Staggered Grid Animations
   ============================================ */

/* 网格项目交错动画 */
.stagger-grid > * {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.stagger-grid > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-grid > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-grid > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-grid > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-grid > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-grid > *:nth-child(6) { animation-delay: 0.6s; }
.stagger-grid > *:nth-child(7) { animation-delay: 0.7s; }
.stagger-grid > *:nth-child(8) { animation-delay: 0.8s; }

/* ============================================
   Special Effects
   ============================================ */

/* 渐变背景动画 */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.gradient-animated {
  background-size: 200% 200%;
  animation: gradientShift 5s ease infinite;
}

/* 闪烁效果 */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
}

/* 弹跳效果 */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-10px);
  }
  50% {
    transform: translateY(0);
  }
  75% {
    transform: translateY(-5px);
  }
}

.animate-bounce {
  animation: bounce 1s ease infinite;
}

/* ============================================
   Accessibility - Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .animate,
  [data-scroll] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ============================================
   Section Title Underline Animation
   ============================================ */

@keyframes underlineExpand {
  from {
    width: 0;
  }
  to {
    width: 60px;
  }
}

.section-title.is-visible::after {
  animation: underlineExpand 0.6s ease-out forwards;
}
