/* ═══════════════════════════════════════════════════════════════════
   liked.css — 관심목록 & 최근 본 매물 통합 페이지 (v3 심플 리디자인)
   컨셉: 프로필 페이지와 동일한 흰색·심플 스타일
   ═══════════════════════════════════════════════════════════════════ */

/* ── CSS 변수 ─────────────────────────────────────────────────── */
:root {
  /* 바디 팔레트 */
  --body-bg:        #ffffff;
  --card-bg:        #ffffff;
  --border:         #f0f0f0;
  --tab-bg:         #ffffff;

  /* 액센트: 찜(로즈) */
  --rose:           #E0294A;
  --rose-light:     #FFF0F2;
  --rose-mid:       #FECDD5;
  --rose-glow:      rgba(224, 41, 74, 0.22);

  /* 액센트: 최근(블루) */
  --blue:           #3D9EDB;
  --blue-light:     #EEF5FF;
  --blue-mid:       #BFDBFE;

  /* 텍스트 */
  --text-dark:      #111111;
  --text-mid:       #555555;
  --text-muted:     #aaaaaa;

  /* 그림자 */
  --shadow-xs:      0 1px 3px rgba(0,0,0,0.06);
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.07);

  /* 트랜지션 */
  --t-fast:         0.14s ease;
  --t-mid:          0.24s ease;
  --t-spring:       0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── 기본 리셋 ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Pretendard Variable", 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  background: var(--body-bg);
  color: var(--text-dark);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

html { scroll-behavior: smooth; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   심플 페이지 헤더 (프로필 페이지와 동일한 스타일)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.page-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  padding: 14px 16px;
}
.page-header-title {
  font-size: 18px;
  font-weight: 800;
  color: #111;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   탭 바
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.tab-bar-wrap {
  position: sticky;
  top: 49px; /* page-header 높이(14px 상하 패딩 + 18px 폰트 = ~47px) */
  z-index: 99;
  background: var(--tab-bg);
  border-bottom: 1px solid var(--border);
}

.tab-bar {
  display: flex;
  position: relative;
  padding: 0 12px;
}

/* 슬라이딩 인디케이터 */
.tab-indicator {
  position: absolute;
  bottom: 0;
  height: 2px;
  background: #ff6469;
  border-radius: 2px 2px 0 0;
  transition:
    left  0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
    width 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 탭 버튼 */
.tab-btn {
  flex: 1;
  min-height: 44px;
  background: none;
  border: none;
  padding: 10px 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: color var(--t-fast);
  font-family: inherit;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.tab-btn.active { color: #ff6469; }

/* 탭 아이콘 */
.tab-btn-icon {
  width: 14px; height: 14px;
  fill: currentColor;
  flex-shrink: 0;
  opacity: 0.7;
}
.tab-btn.active .tab-btn-icon { opacity: 1; }

/* 탭 뱃지 */
.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  background: #EDECF0;
  color: var(--text-muted);
  transition: background var(--t-fast), color var(--t-fast);
}
.tab-btn.active .tab-badge {
  background: #ff6469;
  color: #fff;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   패널 공통
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.panel {
  display: none;
  padding: 8px 0px 100px;
  animation: panel-in 0.2s ease both;
}
.panel.active { display: block; }

@keyframes panel-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   빈 상태
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 52px 24px 40px;
  gap: 10px;
  text-align: center;
}

/* 아이콘 원형 래퍼 */
.empty-icon-wrap {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.empty-icon-wrap svg { width: 32px; height: 32px; }

.empty-icon-wrap--liked {
  background: var(--rose-light);
}
.empty-icon-wrap--liked svg { fill: var(--rose); }

.empty-icon-wrap--recent {
  background: var(--blue-light);
}
.empty-icon-wrap--recent svg { fill: var(--blue); }

.empty-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.02em;
}
.empty-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.8;
}

/* CTA 버튼 */
.empty-cta {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 24px;
  background: var(--text-dark);
  color: #fff;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: transform var(--t-fast), opacity var(--t-fast);
}
.empty-cta svg { width: 15px; height: 15px; fill: currentColor; }
.empty-cta:active {
  transform: scale(0.96);
  opacity: 0.85;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   목록 헤더 (개수 + 전체 삭제)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.list-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.btn-clear-all {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  font-family: inherit;
  transition: color var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.btn-clear-all:active { color: var(--rose); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   관심목록 카드 — 2열 그리드 (리스트뷰와 동일 스타일)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.liked-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 8px;
  row-gap: 0;
  padding: 0 6px;
  max-width: 644px;
  margin: 0 auto;
}

/* 카드 진입 애니메이션 */
@keyframes card-rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.liked-card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border-radius: 0;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: none;
  box-shadow: none;
  padding-top: 10px;
  animation: card-rise 0.32s ease both;
  transition: transform var(--t-fast);
  position: relative;
}
.liked-card:active {
  transform: scale(0.97);
}

/* 썸네일 영역 */
.liked-card-thumb {
  width: 100%;
  aspect-ratio: 770 / 513;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  border-radius: 4px;
  background: #ebebeb;
}

/* 사진 안쪽 그림자 */
.liked-card-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.15);
  pointer-events: none;
  border-radius: 4px;
}

/* 이미지 페이드인 */
.liked-card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  animation: img-in 0.25s ease;
}
@keyframes img-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 플레이스홀더 */
.liked-card-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}
.liked-card-thumb-placeholder svg {
  width: 28px; height: 28px;
  fill: #ddd;
}

/* 찜하기 버튼 — 리스트뷰와 동일 스타일 */
.liked-card-thumb .lv-heart-btn {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 10;
  padding: 6px 6px 8px 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* 하트 아이콘 색상 (liked.html 카드 클래스에 맞춤) */
.lv-card-thumb .heart-unliked {
  color: rgba(156, 163, 175, 0.6);
}
.lv-card-thumb .heart-liked {
  color: #ff6469;
}

/* 카드 정보 영역 */
.liked-card-info {
  padding: 8px 2px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

/* 매물번호 — 라운드 사각형 배지 스타일 */
.liked-card-num {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: clamp(11px, 2.5vw, 11px);
  font-weight: 500;
  color: #666;
  background: #f9f9f9;
  line-height: 1.5;
}

/* 가격 — #333 다크 색상 */
.liked-card-price {
  font-size: clamp(15px, 4vw, 17px);
  font-weight: 700;
  color: #333;
  line-height: 1.3;
  margin-top: 1px;
}

/* 주소 + 종류 */
.liked-card-addr {
  font-size: clamp(12px, 3vw, 13px);
  font-weight: 600;
  color: rgb(120, 120, 120);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: start;
  width: 100%;
}

/* 주소/종류 + 최근수정일 한 줄 정렬 */
.liked-card-addr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}
.liked-card-addr-main {
  font-size: clamp(12px, 3vw, 13px);
  font-weight: 600;
  color: rgb(120, 120, 120);
  line-height: 1.3;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.liked-card-date {
  font-size: 11px;
  font-weight: 500;
  color: #9a9a9a;
  white-space: nowrap;
  flex-shrink: 0;
}
.liked-card-date.needs-check {
  color: #e53935;
  font-weight: 500;
}

/* 매물종류명 (원룸/투베이 등) */
.liked-card-cat {
  font-size: 13px;
}

/* 설명 — 1줄 초과 시 '...' 처리 */
.liked-card-title {
  font-size: clamp(12px, 3vw, 12px);
  font-weight: 400;
  color: #555;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   최근 본 매물 카드 — 2열 그리드 (리스트뷰와 동일 스타일)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* recent-list를 그리드로 변환 */
#recent-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 8px;
  row-gap: 0;
  padding: 0 6px;
  max-width: 644px;
  margin: 0 auto;
}

@keyframes card-slide {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.recent-card {
  background: var(--card-bg);
  border-radius: 0;
  border: none;
  padding: 0;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 0;
  text-decoration: none;
  color: inherit;
  margin-bottom: 0;
  box-shadow: none;
  animation: card-slide 0.24s ease both;
  transition: transform var(--t-fast);
  position: relative;
  overflow: hidden;
}
.recent-card:last-child { margin-bottom: 0; }
.recent-card:active { transform: scale(0.97); }

/* 썸네일 — 리스트뷰와 동일 비율 */
.recent-card-thumb {
  width: 100%;
  aspect-ratio: 770 / 513;
  border-radius: 4px;
  background: #ebebeb;
  flex-shrink: 0;
  overflow: hidden;
  display: block;
  position: relative;
}

/* 사진 안쪽 그림자 */
.recent-card-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.15);
  pointer-events: none;
  border-radius: 4px;
}

.recent-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; animation: img-in 0.25s ease; }
.recent-card-thumb svg { width: 22px; height: 22px; fill: #ddd; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* 카드 정보 */
.recent-card-info {
  flex: 1;
  min-width: 0;
  padding: 8px 2px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

/* 매물번호 — 라운드 사각형 배지 스타일 */
.recent-card-num {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: clamp(11px, 2.5vw, 11px);
  font-weight: 500;
  color: #666;
  background: #f9f9f9;
  line-height: 1.5;
}

/* 가격 — #333 다크 색상 */
.recent-card-price {
  font-size: clamp(15px, 4vw, 17px);
  font-weight: 700;
  color: #333;
  line-height: 1.3;
  margin-top: 1px;
}

/* 주소 + 종류 */
.recent-card-addr {
  font-size: clamp(12px, 3vw, 13px);
  font-weight: 600;
  color: rgb(120, 120, 120);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* 주소/종류 + 최근수정일 한 줄 정렬 */
.recent-card-addr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}
.recent-card-addr-main {
  font-size: clamp(12px, 3vw, 13px);
  font-weight: 600;
  color: rgb(120, 120, 120);
  line-height: 1.3;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-card-date {
  font-size: 11px;
  font-weight: 500;
  color: #9a9a9a;
  white-space: nowrap;
  flex-shrink: 0;
}
.recent-card-date.needs-check {
  color: #e53935;
  font-weight: 500;
}

/* 매물종류명 (원룸/투베이 등) */
.recent-card-cat {
  font-size: 13px;
}

/* 설명 — 1줄 초과 시 '...' 처리 */
.recent-card-title {
  font-size: clamp(12px, 3vw, 12px);
  font-weight: 400;
  color: #555;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* 삭제 버튼 — 썸네일 위 상단 우측 */
.recent-delete-btn {
  position: absolute;
  top: 17px; right: 7px;
  width: 28px; height: 28px;
  padding: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 5px rgba(0,0,0,0.16);
  z-index: 2;
  transition: transform var(--t-fast), background var(--t-fast);
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.recent-delete-btn svg { width: 20px; height: 20px; fill: #999; transition: fill var(--t-fast); }
.recent-delete-btn:active { transform: scale(0.82); background: #FEE2E2; }
.recent-delete-btn:active svg { fill: var(--rose); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   계약완료 오버레이 — 썸네일 위 딤 처리
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* 썸네일 전체를 덮는 어두운 오버레이 */
.card-contracted-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
}

/* "계약완료" 텍스트 뱃지 */
.card-contracted-overlay span {
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  border: 1px solid #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 9999px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* unlike-btn / delete-btn이 오버레이보다 위에 표시 */
.unlike-btn { z-index: 2; }

/* 계약완료 카드 전체 약간 투명 처리 — 활성 매물과 시각적 구분 */
.liked-card--contracted,
.recent-card--contracted {
  opacity: 0.72;
}
.liked-card--contracted:active,
.recent-card--contracted:active {
  opacity: 0.72;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   카드 제거 애니메이션 (JS에서 card-removing 클래스 추가)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.card-removing {
  transition: opacity 0.22s ease, transform 0.22s ease !important;
  opacity: 0 !important;
  transform: scale(0.85) !important;
  pointer-events: none;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   접근성: 움직임 줄이기
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (prefers-reduced-motion: reduce) {
  .liked-card,
  .recent-card,
  .panel {
    animation: none !important;
    transition: none !important;
  }
}
