/* Main Styles for WhatColorMake */
body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 性能优化：减少重绘和重排 */
.performance-optimized {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* 移动端性能优化：减少GPU消耗 */
@media (max-width: 768px) {
  /* 禁用复杂的渐变背景，使用纯色 */
  body {
    background: #667eea;
  }
  
  /* 优化动画性能 */
  .performance-optimized {
    will-change: auto;
    transform: none;
  }
}

.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 移动端性能优化：简化或禁用backdrop-filter */
@media (max-width: 768px) {
  .glass {
    backdrop-filter: none;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
  }
}

/* 对于低性能设备进一步优化 */
@media (max-width: 480px) {
  .glass {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
  }
}

.color-preview {
  width: 100%;
  height: 80px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.color-preview:hover {
  transform: scale(1.02);
}

/* 移动端性能优化：简化阴影和动画 */
@media (max-width: 768px) {
  .color-preview {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: none;
  }
  
  .color-preview:hover {
    transform: none;
  }
}

.result-preview {
  width: 200px;
  height: 200px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
  margin: 0 auto;
}

/* 移动端性能优化：简化阴影效果 */
@media (max-width: 768px) {
  .result-preview {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: none;
  }
}

/* 紧凑布局样式 */
.compact-color-selector {
  padding: 1.5rem !important;
}

.compact-color-selector h3 {
  font-size: 1.25rem !important;
  margin-bottom: 1rem !important;
}

.compact-color-selector .space-y-6 {
  gap: 1rem !important;
}

.compact-quick-colors {
  grid-template-columns: repeat(6, 1fr) !important;
  gap: 0.5rem !important;
}

.compact-quick-colors button {
  height: 2rem !important;
}

/* 响应式优化 */
@media (max-width: 768px) {
  .compact-color-selector {
    padding: 1rem !important;
  }

  .color-preview {
    height: 50px;
  }

  .compact-quick-colors {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.5rem !important;
  }

  .compact-quick-colors button {
    height: 2rem !important;
    transition: none !important;
  }

  #result {
    width: 120px !important;
    height: 120px !important;
  }

  /* 移动端进一步压缩间距 */
  .glass.rounded-xl {
    padding: 0.5rem !important;
  }

  .glass.rounded-2xl {
    padding: 0.75rem !important;
  }

  /* 禁用移动端所有hover效果和复杂动画 */
  * {
    transition-duration: 0s !important;
  }
  
  *:hover {
    transform: none !important;
  }
  
  /* 禁用移动端的backdrop-blur效果 */
  .backdrop-blur-sm {
    backdrop-filter: none !important;
  }
  
  /* 简化阴影效果 */
  .shadow-lg {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  }
  
  .hover\:shadow-xl:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  }
}

/* 三色模式布局优化 */
.three-color-layout {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
  gap: 1rem !important;
}

@media (min-width: 1024px) {
  .three-color-layout {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

.nav-link {
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: #60a5fa;
}

.feature-card {
  transition: transform 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
}

/* 下拉菜单样式 */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  min-width: 220px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  z-index: 1000;
  padding: 8px 0;
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.dropdown-content a {
  color: #1f2937;
  padding: 12px 20px;
  text-decoration: none;
  display: block;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.dropdown-content a:hover {
  background: rgba(59, 130, 246, 0.1);
  border-left-color: #3b82f6;
  color: #1e40af;
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.dropdown-trigger::after {
  content: '▼';
  margin-left: 6px;
  font-size: 10px;
  opacity: 0.7;
  transition: transform 0.3s ease;
}

.dropdown-content {
  transition: opacity 0.3s ease, visibility 0.3s ease;
  visibility: hidden;
  opacity: 0;
}

.dropdown-content.active {
  visibility: visible;
  opacity: 1;
  display: block;
}

.dropdown-trigger.active::after {
  transform: rotate(180deg);
}

/* 移动端下拉菜单 */
.mobile-dropdown-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin: 8px 12px;
}

.mobile-dropdown-content.active {
  max-height: 300px;
}

.mobile-dropdown-content a {
  padding: 8px 16px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  border-left: 3px solid transparent;
}

.mobile-dropdown-content a:hover {
  background: rgba(255, 255, 255, 0.1);
  border-left-color: #60a5fa;
  color: white;
}