/* 인라인 CSS 최적화 버전 - inline-optimized.css */

/* 모바일 기본 설정 */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

input, textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

html, body {
  overflow-x: hidden;
  width: 100%;
  height: 100%;
  -webkit-overflow-scrolling: touch;
}

/* 모바일 뷰포트 고정 */
body {
  position: relative;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  background-attachment: fixed;
}

/* 메인 컨테이너 */
.main {
  padding: 20px 16px;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(100vh - 80px);
}

/* 검색바 파도 애니메이션 - GORAE 정체성 */
.search-bar {
  margin: clamp(20px, 4vw, 40px) 0;
  width: 100%;
  max-width: min(650px, calc(100vw - 32px));
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-radius: 50px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15));
  backdrop-filter: blur(15px);
  border: 2px solid rgba(59, 130, 246, 0.4);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
  height: clamp(48px, 8vw, 56px);
}

.search-bar:hover {
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4), 0 4px 12px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}

.search-bar:hover {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3), 0 4px 12px rgba(59, 130, 246, 0.3);
  transform: translateY(-3px);
}

/* SVG 파도 배경 - 고래가 타는 파란 물결 */
.search-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 300%;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3ClinearGradient id='wave1' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' style='stop-color:%2310b981;stop-opacity:0.6'/%3E%3Cstop offset='25%25' style='stop-color:%233b82f6;stop-opacity:0.8'/%3E%3Cstop offset='50%25' style='stop-color:%238b5cf6;stop-opacity:0.6'/%3E%3Cstop offset='75%25' style='stop-color:%2306b6d4;stop-opacity:0.8'/%3E%3Cstop offset='100%25' style='stop-color:%2310b981;stop-opacity:0.6'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0,70 Q100,50 200,70 T400,70 Q500,85 600,70 T800,70 Q900,55 1000,70 T1200,70 L1200,100 L0,100 Z' fill='url(%23wave1)'/%3E%3C/svg%3E") repeat-x;
  animation: wave-slide 8s ease-in-out infinite;
  opacity: 0.8;
  z-index: 1;
  pointer-events: none;
}

.search-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 300%;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3ClinearGradient id='wave2' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' style='stop-color:%233b82f6;stop-opacity:0.5'/%3E%3Cstop offset='50%25' style='stop-color:%238b5cf6;stop-opacity:0.6'/%3E%3Cstop offset='100%25' style='stop-color:%2306b6d4;stop-opacity:0.5'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0,75 Q100,60 200,75 T400,75 Q500,90 600,75 T800,75 Q900,60 1000,75 T1200,75 L1200,100 L0,100 Z' fill='url(%23wave2)'/%3E%3C/svg%3E") repeat-x;
  animation: wave-slide 10s ease-in-out infinite reverse;
  animation-delay: -2s;
  opacity: 0.7;
  z-index: 1;
  pointer-events: none;
}

@keyframes wave-slide {
  0% { transform: translateX(0%) scaleY(0.8); }
  25% { transform: translateX(25%) scaleY(1.2); }
  50% { transform: translateX(50%) scaleY(0.9); }
  75% { transform: translateX(25%) scaleY(1.1); }
  100% { transform: translateX(0%) scaleY(0.8); }
}

/* 검색 입력 필드 */
.search-bar input[type="text"] {
  background: transparent;
  border: none;
  position: relative;
  z-index: 10;
  color: white;
  font-weight: 500;
  width: 100%;
  padding: 14px 50px 14px 20px;
  font-size: 16px;
}

.search-bar input[type="text"]:focus {
  background: rgba(255, 255, 255, 0.05);
  color: white;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  outline: none;
}

.search-bar input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
}

/* 검색 버튼 */
.search-bar .search-button {
  z-index: 20;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(16, 185, 129, 0.3));
  border-radius: 50%;
  padding: 0;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  max-width: 36px;
  max-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(15px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
  aspect-ratio: 1/1;
}

.search-bar .search-button:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.6), rgba(16, 185, 129, 0.5));
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5), 0 0 20px rgba(16, 185, 129, 0.3);
  border-color: rgba(255, 255, 255, 0.4);
}

.search-bar .search-button:active {
  transform: translateY(-50%) scale(0.95);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* 탭 버튼들 */
.tabs {
  display: flex;
  justify-content: center;
  gap: clamp(8px, 3vw, 16px);
  margin: clamp(20px, 4vw, 30px) 0;
  flex-wrap: wrap;
  width: 100%;
  max-width: 600px;
}

.tab-button {
  flex: 1;
  min-width: 80px;
  max-width: 120px;
  padding: 12px 16px;
  font-size: 14px;
  border-radius: 20px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 2px solid rgba(59, 130, 246, 0.3);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
  color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.tab-button:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.tab-button.auction {
  border-color: rgba(59, 130, 246, 0.5);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.1));
}

.tab-button.public-auction {
  border-color: rgba(251, 146, 60, 0.5);
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.2), rgba(245, 101, 101, 0.1));
}

.tab-button.personal-items {
  border-color: rgba(16, 185, 129, 0.5);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.1));
}

/* 추천 카드 */
.recommendation-card-container {
  width: 100%;
  max-width: min(400px, calc(100vw - 32px));
  margin: clamp(20px, 4vw, 30px) 0;
  display: flex;
  justify-content: center;
}

.recommendation-card {
  width: 100%;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
  backdrop-filter: blur(15px);
  border: 2px solid rgba(59, 130, 246, 0.3);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 모바일 최적화 */
@media (max-width: 768px) {
  header {
    padding: 12px 16px;
    min-height: 60px;
  }
  
  .logo { font-size: 18px; }
  .logo-whale { font-size: 20px; }
  .header-right { gap: 8px; }
  
  .login-btn, .download-btn {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 8px;
  }

  .main-title-container {
    margin-bottom: 30px;
    text-align: center;
  }
  
  .main-typing-display {
    font-size: clamp(24px, 6vw, 36px);
    line-height: 1.2;
    padding: 0 10px;
  }

  .search-bar {
    height: 52px;
    border-radius: 26px;
    margin: 20px 0;
  }
  
  .search-bar input[type="text"] {
    font-size: 16px; /* iOS 줌 방지 */
    padding: 14px 50px 14px 20px;
  }
  
  .search-bar .search-button {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    right: 6px;
    font-size: 18px;
  }

  .tabs {
    gap: 8px;
    margin: 20px 0;
    padding: 0 10px;
  }

  .recommendation-card {
    padding: 16px;
    border-radius: 16px;
  }
  
  .card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 12px;
  }
  
  .card-title {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
    line-height: 1.4;
  }
  
  .card-location {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
  }
  
  .card-price {
    font-size: 18px;
    font-weight: 700;
    color: #10b981;
    margin-bottom: 12px;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
  }
  
  .card-stats {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
  }
  
  .card-stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .modal-content {
    width: calc(100vw - 32px);
    max-width: 400px;
    margin: 10% auto;
    padding: 24px;
    border-radius: 16px;
  }
  
  .social-login-btn {
    padding: 14px 20px;
    font-size: 15px;
    border-radius: 12px;
    margin-bottom: 12px;
  }
}

@media (max-width: 480px) {
  .search-bar {
    height: 48px;
    border-radius: 24px;
  }
  
  .search-bar input[type="text"] {
    padding: 12px 46px 12px 18px;
  }
  
  .search-bar .search-button {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    max-width: 36px;
    max-height: 36px;
    right: 6px;
    font-size: 16px;
  }

  .tabs {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  
  .tab-button {
    width: 100%;
    max-width: 280px;
    padding: 14px 20px;
    font-size: 15px;
  }
}

/* 모바일에서는 호버 효과 비활성화 */
@media (hover: none) and (pointer: coarse) {
  .search-bar:hover { transform: none; }
  .search-button:hover,
  .tab-button:hover,
  .recommendation-card:hover { transform: none; }
  
  .search-button:active,
  .tab-button:active { transform: scale(0.95); }
}

/* iOS Safari 특별 처리 */
@supports (-webkit-appearance: none) {
  .search-bar input[type="text"] {
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
  }
}

/* 호버 시 파도 강화 - 고래가 더 빨리 헤엄치는 효과 */
.search-bar:hover::before {
  animation-duration: 6s;
  opacity: 1;
}

.search-bar:hover::after {
  animation-duration: 8s;
  opacity: 0.9;
}
