@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  body {
    @apply bg-gradient-animate min-h-screen antialiased selection:bg-primary/20 selection:text-primary;
    font-feature-settings: 'ss01', 'ss02', 'ss03', 'ss04';
  }
  
  :root {
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-4: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  }
}

@layer utilities {
  /* 高级磨砂玻璃效果 */
  .glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }
  
  .dark .glass-panel {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }

  /* 增强的磨砂玻璃 - 用于Hero区域 */
  .glass-card {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 1),
                0 1px 3px rgba(0, 0, 0, 0.08);
  }
  
  .dark .glass-card {
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.08),
                0 1px 3px rgba(0, 0, 0, 0.4);
  }

  /* 苹果风格渐变背景 */
  .bg-gradient-animate {
    background: linear-gradient(-45deg, 
      #fafafa 0%, 
      #f0f4ff 25%,
      #fff5f7 50%,
      #f0f9ff 75%,
      #fafafa 100%);
    background-size: 400% 400%;
    animation: gradientBG 20s ease infinite;
  }

  .dark .bg-gradient-animate {
    background: linear-gradient(-45deg, 
      #0f172a 0%, 
      #1e1b4b 25%,
      #1e293b 50%,
      #0c1222 75%,
      #0f172a 100%);
    background-size: 400% 400%;
    animation: gradientBG 20s ease infinite;
  }

  @keyframes gradientBG {
    0%, 100% {
      background-position: 0% 50%;
    }
    50% {
      background-position: 100% 50%;
    }
  }

  /* 苹果风格渐变 */
  .gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  }
  
  .gradient-blue {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  }
  
  .gradient-purple {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  }
  
  .gradient-orange {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6a88 100%);
  }

  /* 动画效果 */
  .animate-fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .animate-slide-up {
    animation: slideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .animate-scale-in {
    animation: scaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes slideUp {
    from {
      opacity: 0;
      transform: translateY(40px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes scaleIn {
    from {
      opacity: 0;
      transform: scale(0.95);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }

  /* 悬停效果 */
  .hover-lift {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  }

  /* 苹果风格的模糊光晕 */
  .glow-primary {
    box-shadow: 0 0 60px rgba(102, 126, 234, 0.4),
                0 0 120px rgba(102, 126, 234, 0.2);
  }

  .glow-blue {
    box-shadow: 0 0 60px rgba(79, 172, 254, 0.4),
                0 0 120px rgba(79, 172, 254, 0.2);
  }
}

