/* 기본 스타일 - 모던 디자인 */
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 50%, #0f0f0f 100%);
  background-attachment: fixed;
  color: white;
  overflow-x: hidden;
  position: relative;
}

/* HTML과 모든 요소의 기본 여백 제거 */
* {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(34, 197, 94, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(249, 115, 22, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* 반응형 컨테이너 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 메인 섹션 반응형 */
.main {
  text-align: center;
  padding: 20px 20px 40px 20px;
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding-top: 20px;
}

@media (max-width: 768px) {
  .main {
    padding: 20px 15px 30px 15px;
    min-height: calc(100vh - 60px);
    padding-top: 15px;
    margin: 0;
    justify-content: center;
  }
  
  header {
    padding: 5px 15px;
  }
  
  .main-title-container {
    margin-bottom: 15px;
    padding-top: 8px;
    min-height: 40px;
  }
}

/* 메인 제목 애니메이션 반응형 */
.main-title-container {
  min-height: clamp(45px, 8vw, 65px);
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  margin-bottom: clamp(25px, 5vw, 40px);
  width: 100%;
  padding-top: 10px;
}

.main-typing-display {
  font-size: clamp(28px, 6.5vw, 48px);
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  line-height: 1.3;
  padding: 0 10px;
  letter-spacing: -0.02em;
  text-shadow: 
    0 0 20px rgba(255, 255, 255, 0.3),
    0 2px 10px rgba(0, 0, 0, 0.5);
  opacity: 1;
  display: block;
  visibility: visible;
  min-height: 60px; /* 최소 높이 보장 */
}

/* 타이핑 애니메이션 글자 스타일 */
.typing-char {
  display: inline-block;
  opacity: 0;
  animation: fadeInChar 0.3s ease forwards;
  color: #ffffff;
  text-shadow: 
    0 0 15px rgba(255, 255, 255, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.6);
}

/* 글자별 사라지는 애니메이션 */
.char-fade-out {
  animation: fadeOutChar 0.3s ease-out forwards;
}

@keyframes fadeOutChar {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  50% {
    opacity: 0.5;
    transform: translateY(-15px) scale(0.9);
  }
  100% {
    opacity: 0;
    transform: translateY(-30px) scale(0.7);
  }
}

/* 타이핑 디스플레이 페이드아웃 애니메이션 */
.main-typing-display.fade-out {
  animation: fadeOutSmooth 1s ease-in-out forwards;
}

@keyframes fadeOutSmooth {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  50% {
    opacity: 0.3;
    transform: translateY(-10px) scale(0.98);
  }
  100% {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
}

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

/* 사라지는 애니메이션 */
.typing-char.disappearing {
  animation: fadeOutChar 0.3s ease forwards;
}

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

/* 검색바 모던 디자인 - 파도 애니메이션 추가 */
.search-bar {
  margin: clamp(30px, 5vw, 40px) 0;
  width: 100%;
  max-width: 650px;
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-radius: 50px;
  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.2);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* 파도 배경 애니메이션 */
.search-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 300%;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 300 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3ClinearGradient id='waveGrad1' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' style='stop-color:%2310b981;stop-opacity:0.3'/%3E%3Cstop offset='25%25' style='stop-color:%233b82f6;stop-opacity:0.4'/%3E%3Cstop offset='50%25' style='stop-color:%238b5cf6;stop-opacity:0.3'/%3E%3Cstop offset='75%25' style='stop-color:%2306b6d4;stop-opacity:0.4'/%3E%3Cstop offset='100%25' style='stop-color:%2310b981;stop-opacity:0.3'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0,45 Q75,30 150,45 T300,45 Q375,52 450,45 T600,45 Q675,38 750,45 T900,45 L900,60 L0,60 Z' fill='url(%23waveGrad1)'/%3E%3C/svg%3E") repeat-x;
  animation: wave-flow-search 6s ease-in-out infinite;
  opacity: 0.6;
  z-index: 1;
  pointer-events: none;
}

.search-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 300%;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 300 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3ClinearGradient id='waveGrad2' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' style='stop-color:%233b82f6;stop-opacity:0.2'/%3E%3Cstop offset='50%25' style='stop-color:%238b5cf6;stop-opacity:0.3'/%3E%3Cstop offset='100%25' style='stop-color:%2306b6d4;stop-opacity:0.2'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0,48 Q75,35 150,48 T300,48 Q375,55 450,48 T600,48 Q675,42 750,48 T900,48 L900,60 L0,60 Z' fill='url(%23waveGrad2)'/%3E%3C/svg%3E") repeat-x;
  animation: wave-flow-search 8s ease-in-out infinite reverse;
  animation-delay: -1s;
  opacity: 0.4;
  z-index: 1;
  pointer-events: none;
}

@keyframes wave-flow-search {
  0% { 
    transform: translateX(-66.66%) scaleY(0.8);
  }
  25% {
    transform: translateX(-55%) scaleY(1.1);
  }
  50% { 
    transform: translateX(-33.33%) scaleY(0.9);
  }
  75% {
    transform: translateX(-45%) scaleY(1.2);
  }
  100% { 
    transform: translateX(-66.66%) scaleY(0.8);
  }
}

.search-button {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3B82F6;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 8px;
  font-size: 24px;
  font-weight: 400;
  z-index: 10;
}

.search-button:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #2563EB;
  transform: translateY(-50%) scale(1.1);
}

.search-button:active {
  transform: translateY(-50%) scale(0.95);
}

input[type="text"] {
  padding: clamp(16px, 3vw, 20px) 55px clamp(16px, 3vw, 20px) clamp(20px, 4vw, 24px);
  width: 100%;
  max-width: 100%;
  border-radius: 50px;
  border: none;
  background: transparent;
  backdrop-filter: blur(10px);
  color: white;
  font-size: clamp(16px, 3.5vw, 18px);
  font-weight: 400;
  box-sizing: border-box;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 10;
}

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

input[type="text"]:hover {
  background: rgba(255, 255, 255, 0.03);
}

input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 300;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
}

@media (max-width: 480px) {
  .search-bar {
    border-width: 1px;
  }
  
  .search-bar::before,
  .search-bar::after {
    animation-duration: 8s, 10s;
  }
  
  input[type="text"] {
    padding: 12px 45px 12px 16px;
    font-size: 16px; /* iOS zoom 방지 */
  }
  
  .search-button {
    width: 32px;
    height: 32px;
    right: 10px;
  }
  
  .search-button svg {
    width: 18px;
    height: 18px;
  }
}

/* 탭 컨테이너 모던 디자인 */
.tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(12px, 3vw, 16px);
  margin: clamp(20px, 4vw, 35px) 0;
  width: 100%;
  max-width: 650px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 20px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-button {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: clamp(12px, 2.5vw, 16px) clamp(20px, 4vw, 28px);
  border-radius: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  font-size: clamp(14px, 3.2vw, 16px);
  white-space: nowrap;
  min-width: 100px;
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.tab-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.tab-button:hover::before {
  left: 100%;
}

.tab-button:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
  border-color: rgba(255, 255, 255, 0.2);
  color: white;
  transform: translateY(-2px);
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.2),
    0 2px 10px rgba(255, 255, 255, 0.1);
}

.tab-button:active {
  transform: translateY(0);
  transition: transform 0.1s ease;
}

/* 특별한 탭 버튼 색상 */
.tab-button.auction:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(59, 130, 246, 0.1));
  border-color: rgba(59, 130, 246, 0.5);
}

.tab-button.personal-items:hover {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.1));
  border-color: rgba(34, 197, 94, 0.5);
}

/* 모바일 반응형 - 태블릿 */
@media (max-width: 768px) {
  .search-bar {
    margin: 25px 0;
    max-width: 100%;
  }
  
  input[type="text"] {
    padding: 18px 22px;
    font-size: 16px; /* iOS zoom 방지 */
  }
  
  .tabs {
    gap: 10px;
    margin: 25px 0;
    padding: 6px;
  }
  
  .tab-button {
    padding: 14px 20px;
    font-size: 15px;
    min-width: 90px;
  }
}

/* 모바일 반응형 - 스마트폰 */
@media (max-width: 480px) {
  .search-bar {
    margin: 20px 0;
  }
  
  input[type="text"] {
    padding: 16px 20px;
    font-size: 16px; /* iOS zoom 방지 */
  }
  
  .tabs {
    gap: 8px;
    flex-direction: row;
    justify-content: center;
    margin: 20px 0;
    padding: 4px;
  }
  
  .tab-button {
    padding: 12px 16px;
    font-size: 14px;
    min-width: 80px;
    flex: 1;
    max-width: 120px;
  }
}

.tab-button:hover {
  background: #00c471;
  color: black;
  transform: translateY(-2px);
}

/* 개인물건 버튼 특별 스타일 */
.tab-button.personal-items {
  background: linear-gradient(135deg, #00c471, #00a85e);
  color: white;
  border: 2px solid #00c471;
  box-shadow: 0 4px 15px rgba(0, 196, 113, 0.3);
  font-size: clamp(14px, 3.5vw, 16px);
  padding: clamp(10px, 2.5vw, 12px) clamp(20px, 5vw, 24px);
}

@media (max-width: 768px) {
  .tab-button.personal-items {
    font-size: 14px;
    padding: 12px 20px;
  }
}

@media (max-width: 480px) {
  .tab-button.personal-items {
    font-size: 15px;
    padding: 14px 24px;
  }
}

.tab-button.personal-items:hover {
  background: linear-gradient(135deg, #00a85e, #008f4c);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 196, 113, 0.4);
}

.tab-button.personal-items::before {
  content: '👤 ';
  margin-right: 5px;
}

/* 경매 버튼 특별 스타일 */
.tab-button.auction {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  border: 2px solid #3b82f6;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
  font-size: clamp(14px, 3.5vw, 16px);
  padding: clamp(10px, 2.5vw, 12px) clamp(20px, 5vw, 24px);
}

@media (max-width: 768px) {
  .tab-button.auction {
    font-size: 14px;
    padding: 12px 20px;
  }
}

@media (max-width: 480px) {
  .tab-button.auction {
    font-size: 15px;
    padding: 14px 24px;
  }
}

.tab-button.auction:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.tab-button.auction::before {
  content: '🔨 ';
  margin-right: 5px;
}

/* 추천 카드 반응형 */
.recommendation-card-container {
  perspective: 1000px;
  width: clamp(280px, 80vw, 400px);
  height: clamp(240px, 60vw, 300px);
  position: relative;
  margin: clamp(20px, 5vw, 40px) auto;
}

@media (max-width: 768px) {
  .recommendation-card-container {
    width: 90%;
    max-width: 350px;
    height: 280px;
    margin: 20px auto;
  }
}

@media (max-width: 480px) {
  .recommendation-card-container {
    width: 95%;
    max-width: 320px;
    height: 260px;
    margin: 15px auto;
  }
}

.recommendation-card {
  width: 100%;
  height: 100%;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 15px;
  padding: clamp(15px, 4vw, 20px);
  box-shadow: 0 8px 25px rgba(0, 196, 113, 0.2);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: rotateY(-90deg);
  transition: all 0.5s ease;
  cursor: pointer;
  box-sizing: border-box;
}

@media (max-width: 480px) {
  .recommendation-card {
    padding: 12px;
    border-radius: 12px;
  }
}

.recommendation-card.show {
  opacity: 1;
  transform: rotateY(0deg);
}

.recommendation-card.hide {
  opacity: 0;
  transform: rotateY(90deg);
}

/* 카드 내부 요소 반응형 */
.card-image {
  width: 100%;
  height: clamp(80px, 20vw, 120px);
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: clamp(8px, 2vw, 12px);
}

@media (max-width: 480px) {
  .card-image {
    height: 90px;
    margin-bottom: 8px;
    border-radius: 6px;
  }
}

.card-title {
  font-size: clamp(14px, 3.5vw, 16px);
  font-weight: bold;
  color: white;
  margin-bottom: clamp(6px, 1.5vw, 8px);
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

@media (max-width: 480px) {
  .card-title {
    font-size: 14px;
    margin-bottom: 6px;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
}

.card-location {
  font-size: clamp(10px, 2.5vw, 12px);
  color: #9CA3AF;
  margin-bottom: clamp(6px, 1.5vw, 8px);
  display: flex;
  align-items: center;
}

.card-price {
  font-size: clamp(16px, 4vw, 18px);
  font-weight: bold;
  color: #10b981;
  margin-bottom: clamp(6px, 1.5vw, 8px);
}

.card-stats {
  display: flex;
  justify-content: space-between;
  font-size: clamp(10px, 2.5vw, 12px);
  color: #6B7280;
  margin-top: auto;
  flex-wrap: wrap;
  gap: 4px;
}

@media (max-width: 480px) {
  .card-stats {
    font-size: 10px;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
  }
}

.card-stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 숨김 클래스 */
.hidden {
  display: none !important;
}

/* 타이핑 애니메이션 스타일 */
.typing-char {
  opacity: 0;
  animation: typing-appear 0.1s ease forwards;
}

@keyframes typing-appear {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.typing-char.disappear {
  animation: typing-disappear 0.2s ease forwards;
}

@keyframes typing-disappear {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.question-mark {
  font-size: clamp(40px, 8vw, 60px);
  color: #00c471;
  animation: question-pulse 1s ease infinite;
}

@keyframes question-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.question-mark.transforming {
  animation: question-transform 0.5s ease forwards;
}

@keyframes question-transform {
  from {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
  to {
    transform: scale(0) rotate(360deg);
    opacity: 0;
  }
}

/* 보안/베타 레이어 클릭 차단 방지 - 핫픽스 */
.security-write-blocker,
.beta-auth-check,
.beta-banner {
  pointer-events: none !important;
  z-index: auto !important;
  display: none !important;
}
