/* ==========================================================================
   DateMeet - Feed / Discovery CSS
   Masonry grid, city tabs, feed cards
   ========================================================================== */

/* --------------------------------------------------------------------------
   Feed Page Layout
   -------------------------------------------------------------------------- */
.feed-page {
  background: var(--bg);
  min-height: 100vh;
}

.feed-fixed-header {
  position: fixed;
  top: 48px; /* below top-bar */
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: #fff;
  z-index: 90;
  border-bottom: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   City / Filter Tabs
   -------------------------------------------------------------------------- */
.city-tabs {
  display: flex;
  align-items: center;
  height: 44px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  padding: 0 8px;
  background: #fff;
  /* Hide scrollbar */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.city-tabs::-webkit-scrollbar {
  display: none;
}

.city-tab {
  display: inline-block;
  padding: 0 16px;
  line-height: 44px;
  font-size: 14px;
  color: var(--text-medium);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  transition: color 0.2s ease;
  font-weight: 500;
}

.city-tab:hover {
  color: var(--text);
}

.city-tab.active {
  color: var(--primary);
  font-weight: 600;
  border-bottom: 2px solid var(--primary);
}

.city-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}

/* Filter Bar (below city tabs) */
.filter-bar {
  display: flex;
  align-items: center;
  height: 40px;
  overflow-x: auto;
  padding: 0 12px;
  gap: 8px;
  background: #fff;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-medium);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  background: #fff;
  transition: all 0.2s ease;
}

.filter-chip.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(255, 71, 87, 0.06);
}

.filter-chip-arrow {
  font-size: 10px;
  opacity: 0.6;
}

/* --------------------------------------------------------------------------
   Feed Container
   -------------------------------------------------------------------------- */
.feed-container {
  padding-top: 100px; /* top-bar(48px) + city-tabs(44px) + some gap */
  padding-bottom: 16px;
  min-height: 100vh;
  background: var(--bg);
}

/* Adjust based on whether filter bar is visible */
.feed-container.with-filter {
  padding-top: 140px; /* top-bar(48px) + city-tabs(44px) + filter-bar(40px) + gap */
}

/* --------------------------------------------------------------------------
   Masonry Grid
   -------------------------------------------------------------------------- */
.masonry-grid {
  columns: 2;
  column-gap: 8px;
  padding: 8px;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 8px;
  display: block;
}

/* --------------------------------------------------------------------------
   Feed Card
   -------------------------------------------------------------------------- */
.feed-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: block;
  text-decoration: none;
  color: inherit;
}

.feed-card:active {
  transform: scale(0.98);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.feed-card-image-wrap {
  position: relative;
  overflow: hidden;
  background: #f0f0f0;
}

.feed-card-image {
  width: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.3s ease;
  aspect-ratio: auto;
}

.feed-card:active .feed-card-image {
  transform: scale(1.03);
}

/* Gradient overlay on image */
.feed-card-image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(0,0,0,0.35) 0%, transparent 100%);
  pointer-events: none;
}

.feed-card-info {
  padding: 8px 10px 10px;
}

.feed-card-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-card-meta {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.feed-card-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #ccc;
  display: inline-block;
}

.feed-card-city {
  font-size: 12px;
  color: #999;
}

.feed-card-bio {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
}

.feed-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.feed-card-tag {
  font-size: 11px;
  color: var(--primary);
  background: rgba(255, 71, 87, 0.08);
  padding: 2px 7px;
  border-radius: 8px;
  line-height: 1.5;
}

/* Like Button on card */
.like-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease, background 0.2s ease;
  border: none;
  font-size: 16px;
  color: #ccc;
  z-index: 10;
}

.like-btn:active {
  transform: scale(0.9);
}

.like-btn.liked {
  color: var(--primary);
  background: rgba(255, 71, 87, 0.1);
}

.like-btn.liked .heart-icon {
  animation: heartbeat 0.3s ease;
}

.heart-icon {
  display: inline-block;
  line-height: 1;
}

/* Online badge on card */
.feed-card-online {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #2ed573;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  line-height: 1.5;
}

/* Verified badge */
.feed-card-verified {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   Recommend / Swipe Card View
   -------------------------------------------------------------------------- */
.swipe-container {
  position: relative;
  height: calc(100vh - var(--nav-height) - 48px - 44px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 16px;
}

.swipe-card-stack {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 420px;
}

.swipe-card {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  cursor: grab;
  will-change: transform;
  background: #fff;
}

.swipe-card:active {
  cursor: grabbing;
}

.swipe-card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.swipe-card-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 180px;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
}

.swipe-card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  color: #fff;
}

.swipe-card-name {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.swipe-card-meta {
  font-size: 14px;
  opacity: 0.9;
  margin-top: 4px;
}

.swipe-card-bio {
  font-size: 13px;
  opacity: 0.8;
  margin-top: 6px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Swipe stamp */
.swipe-stamp {
  position: absolute;
  top: 24px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  border: 3px solid;
  opacity: 0;
  transform: rotate(-15deg);
  transition: opacity 0.2s;
}

.swipe-stamp.stamp-like {
  left: 16px;
  color: #2ed573;
  border-color: #2ed573;
}

.swipe-stamp.stamp-pass {
  right: 16px;
  color: var(--primary);
  border-color: var(--primary);
  transform: rotate(15deg);
}

/* Swipe action buttons */
.swipe-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.swipe-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.swipe-btn:active {
  transform: scale(0.9);
}

.swipe-btn-pass {
  width: 56px;
  height: 56px;
  background: #fff;
  color: var(--primary);
  font-size: 22px;
}

.swipe-btn-like {
  width: 68px;
  height: 68px;
  background: var(--primary);
  color: #fff;
  font-size: 28px;
}

.swipe-btn-chat {
  width: 56px;
  height: 56px;
  background: #fff;
  color: #1e90ff;
  font-size: 22px;
}

/* --------------------------------------------------------------------------
   Match Popup
   -------------------------------------------------------------------------- */
.match-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,71,87,0.85) 0%, rgba(255,165,0,0.85) 100%);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
  color: #fff;
  text-align: center;
  padding: 24px;
}

.match-title {
  font-size: 32px;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
  margin-bottom: 8px;
}

.match-subtitle {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 32px;
}

.match-avatars {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}

.match-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 3px solid #fff;
  object-fit: cover;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.match-heart {
  font-size: 32px;
  animation: heartbeat 0.8s infinite;
}

.match-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 260px;
}

.match-btn-chat {
  background: #fff;
  color: var(--primary);
  border: none;
  border-radius: 24px;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.match-btn-continue {
  background: transparent;
  color: rgba(255,255,255,0.85);
  border: 1.5px solid rgba(255,255,255,0.6);
  border-radius: 24px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

/* Контейнер изображения: фиксированное соотношение 4:5, обрезка выходящего контента */
.dm-card-img-wrap {
  position: relative;
  width: 100%;
  padding-top: 125%; /* 4:5 aspect ratio */
  overflow: hidden;
}
.dm-card-img-wrap .dm-card-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Информационная область карточки */
.dm-card-info {
  padding: 7px 10px 9px;
}
.dm-card-bio {
  font-size: 12px;
  color: #555;
  margin-bottom: 5px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Нижняя строка: имя + сердечко */
.dm-card-bottom-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}
.dm-card-name {
  font-size: 13px;
  font-weight: 600;
  color: #222;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Кнопка-сердечко (справа в нижней строке) */
.dm-like-btn {
  display: flex;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  flex-shrink: 0;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.dm-like-count {
  font-size: 12px;
  color: #e91e8c;
  font-weight: 600;
  min-width: 20px;
  text-align: left;
}
/* Значок Video Auth */
.dm-card-video-auth {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 5px;
  background: #f0f6ff;
  color: #6b9fd4;
  border: 1px solid #c8dff5;
  border-radius: 20px;
  padding: 2px 8px 2px 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.dm-card-video-auth.dm-video-verified {
  background: linear-gradient(135deg, #e8f4ff, #d0eaff);
  color: #1a7fd4;
  border-color: #a0ccf0;
}
.dm-video-auth-icon {
  display: flex;
  align-items: center;
  opacity: 0.85;
}
.dm-video-check {
  display: flex;
  align-items: center;
  background: #1a7fd4;
  color: #fff;
  border-radius: 50%;
  width: 13px;
  height: 13px;
  justify-content: center;
  margin-left: 1px;
  flex-shrink: 0;
}

/* Значок размера груди (вместо возраста) */
.dm-card-cup {
  font-size: 11px;
  font-weight: 600;
  color: #ff6b9d;
  background: #fff0f5;
  border: 1px solid #ffd0e0;
  border-radius: 8px;
  padding: 1px 6px;
  line-height: 1.6;
  white-space: nowrap;
}
