/* 
 * Kerrystone Website - 移动端触摸反馈效果
 * 增强移动端交互体验
 */

/* 触摸反馈效果 */
.touch-ripple {
  position: absolute;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.6);
  transform: scale(0);
  animation: ripple-effect 0.5s ease-out;
  pointer-events: none;
  width: 100px;
  height: 100px;
  margin-left: -50px;
  margin-top: -50px;
  z-index: 10;
}

@keyframes ripple-effect {
  0% {
    transform: scale(0);
    opacity: 0.6;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* 输入框焦点效果 */
.input-focused {
  position: relative;
}

.input-focused::after {
  content: '';
  position: absolute;
  bottom: 14px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary-color);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: center;
}

.input-focused.input-focused::after {
  transform: scaleX(1);
}

/* 移动端轻触状态效果 */
@media (max-width: 768px) {
  .btn:active,
  .card:active,
  .feature-card:active,
  .team-member:active,
  .client-case:active,
  .mobile-bottom-nav-item:active {
    transform: scale(0.98);
    transition: transform 0.2s ease;
  }
  
  /* 卡片触摸反馈 */
  .card,
  .feature-card,
  .team-member,
  .client-case {
    position: relative;
    overflow: hidden; /* 确保涟漪效果不溢出 */
    -webkit-tap-highlight-color: transparent; /* 去除iOS默认触摸高亮 */
  }
  
  /* 减少动画效果 */
  .reduce-motion * {
    transition-duration: 0.1s !important;
    animation-duration: 0.1s !important;
  }
}

/* 高对比度模式支持 */
@media (prefers-contrast: more) {
  :root {
    --primary-color: #0066cc !important;
    --secondary-color: #004080 !important;
    --text-color: #000000 !important;
    --light-text: #ffffff !important;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3) !important;
  }
  
  .btn, 
  .card, 
  .feature-card {
    border: 1px solid #000 !important;
  }
  
  a {
    text-decoration: underline !important;
  }
}

/* 处理屏幕方向变化 */
@media screen and (orientation: landscape) and (max-height: 500px) {
  .header {
    position: relative !important;
  }
  
  .hero-section {
    padding-top: 30px !important;
  }
  
  .mobile-bottom-nav {
    display: none !important;
  }
}

/* 触摸区域优化 */
.touch-target {
  position: relative;
}

.touch-target::after {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  z-index: -1;
}

/* 滑动切换指示器 */
.slider-indicator {
  display: flex;
  justify-content: center;
  margin-top: 15px;
}

.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(0,0,0,0.2);
  margin: 0 4px;
  transition: all 0.3s ease;
}

.slider-dot.active {
  background-color: var(--primary-color);
  transform: scale(1.3);
}

/* 改进移动端表单焦点和填充状态 */
input:focus, 
textarea:focus, 
select:focus {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1) !important;
}

/* 移除iOS默认输入样式 */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea {
  -webkit-appearance: none;
  appearance: none;
  border-radius: 8px !important;
}

/* 使响应式图像在加载时不跳动 */
.img-container {
  position: relative;
  width: 100%;
  height: 0;
  overflow: hidden;
}

.img-container.ratio-4-3 {
  padding-bottom: 75%; /* 4:3 */
}

.img-container.ratio-16-9 {
  padding-bottom: 56.25%; /* 16:9 */
}

.img-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
