/**
 * taste.css — Styles cho Taste Swipe
 */

/* ─── Mode card "Khám phá" trên welcome screen ─────────────── */
.mode-card--taste {
  background: linear-gradient(135deg, #f7c948 0%, #ee5a24 100%);
  border: 1px solid rgba(247, 201, 72, 0.4);
}
.mode-card--taste .mode-card__label { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.25); }
.mode-card--taste .mode-card__desc  { color: rgba(255,255,255,0.88); }
.mode-card--taste:hover,
.mode-card--taste:focus {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 12px 32px rgba(238, 90, 36, 0.5);
  border-color: rgba(247, 201, 72, 0.8);
}

/* Badge khi đã có profile */
.auto-pick-btn.has-taste-profile .auto-pick-btn__desc::after {
  content: ' · ✨ đúng gu bạn';
  color: #f7c948;
  font-weight: 600;
}

/* ─── Taste Hub Screen ──────────────────────────────────────── */
.taste-screen.is-active {
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}
.taste-state {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; max-width: 360px; width: 100%; text-align: center;
  animation: fadeInUp 0.35s ease both;
}
.taste-state__emoji  { font-size: 3.5rem; line-height: 1; margin-bottom: 4px; }
.taste-state__title  { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.taste-state__desc   { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; margin: 0; }

.btn--taste {
  background: linear-gradient(135deg, #f7c948, #ee5a24);
  border: none; color: #fff; font-weight: 600;
  border-radius: 14px; padding: 14px 28px;
  width: 100%; max-width: 320px; font-size: 1rem;
  cursor: pointer; transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(238, 90, 36, 0.4);
}
.btn--taste:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(238, 90, 36, 0.55); }

.taste-tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 4px 0; }
.taste-tag {
  background: rgba(247, 201, 72, 0.12); border: 1px solid rgba(247, 201, 72, 0.4);
  border-radius: 20px; padding: 5px 14px; font-size: 0.85rem; color: var(--text-primary);
}
.taste-tag--region { background: rgba(238, 90, 36, 0.1); border-color: rgba(238, 90, 36, 0.35); }
.taste-stats { color: var(--text-muted); font-size: 0.85rem; margin: 0; opacity: 0.8; }

/* ══════════════════════════════════════════════════════════════
   SWIPE SCREEN
   ══════════════════════════════════════════════════════════════ */

/* Swipe screen header */
.swipe-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 8px; gap: 12px; flex-shrink: 0;
}
.swipe-header__back {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: rgba(255,255,255,0.7); font-size: 1rem;
  flex-shrink: 0; transition: all 0.15s;
}
.swipe-header__back:hover { color: #fff; background: rgba(255,255,255,0.15); }
.swipe-header__title { font-weight: 700; font-size: 1rem; color: var(--text-primary); flex: 1; text-align: center; }
.swipe-header__counter { font-size: 0.8rem; color: var(--text-muted); min-width: 40px; text-align: right; }

/* Progress bar */
.swipe-progress-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px 6px; flex-shrink: 0;
}
.swipe-progress { flex: 1; height: 3px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; }
.swipe-progress__bar {
  height: 100%; background: linear-gradient(90deg, #f7c948, #ee5a24);
  border-radius: 2px; width: 0%; transition: width 0.3s ease;
}
.swipe-progress__label { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; min-width: 40px; text-align: right; }

/* Hint */
.swipe-hint {
  display: flex; justify-content: space-between;
  padding: 0 24px 8px; font-size: 0.8rem; opacity: 0.55; flex-shrink: 0;
}
.swipe-hint__pass { color: #e74c3c; font-weight: 600; }
.swipe-hint__like { color: #f7c948; font-weight: 600; }

/* ── Card Stack ─────────────────────────────────────────────── */
/*
 * APPROACH: swipe-stack fills remaining height via flex:1.
 * Cards use left:16px right:16px (explicit anchors, avoids width:0 bug)
 * + top:50% transform:translateY(-50%) for vertical center.
 */
.swipe-stack {
  flex: 1;
  position: relative;
  overflow: hidden;
  transition: background 0.2s ease;
  /* width:100% enforced by .swipe-screen .swipe-stack in style.css */
}

/* Background tint khi kéo — visual feedback rõ ràng hơn */
.swipe-stack:has(.swipe-card--top.is-liking) {
  background: radial-gradient(circle at center, rgba(46,204,113,0.12) 0%, transparent 70%);
}
.swipe-stack:has(.swipe-card--top.is-passing) {
  background: radial-gradient(circle at center, rgba(231,76,60,0.12) 0%, transparent 70%);
}


.swipe-card {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  /* Max width guard */
  max-width: 420px;
  margin: 0 auto;
  background: var(--glass-bg, rgba(28,28,30,0.92));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.1));
  border-radius: 20px;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  transition: box-shadow 0.15s ease;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  user-select: none;
  will-change: transform;
}
.swipe-card:active { cursor: grabbing; }

/* Stack depth */
.swipe-card--top    { z-index: 10; }
.swipe-card--second {
  z-index: 9;
  transform: translateY(-50%) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.swipe-card--third {
  z-index: 8;
  transform: translateY(-50%) scale(0.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Reveal next card when top card is being dragged — Tinder-style */
.swipe-card--top.is-liking  ~ .swipe-card--second,
.swipe-card--top.is-passing ~ .swipe-card--second {
  opacity: 1;
  transform: translateY(-50%) scale(0.98);
}
.swipe-card--top.is-liking  ~ .swipe-card--second ~ .swipe-card--third,
.swipe-card--top.is-passing ~ .swipe-card--second ~ .swipe-card--third {
  opacity: 0.6;
  transform: translateY(-50%) scale(0.94);
}
/* Also reveal during fly-off animation */
.swipe-card--fly-left  ~ .swipe-card--second,
.swipe-card--fly-right ~ .swipe-card--second {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

/* Drag labels */
.swipe-card__like-label,
.swipe-card__pass-label {
  position: absolute; top: 24px;
  padding: 5px 14px; border-radius: 8px;
  font-weight: 800; font-size: 1.2rem; letter-spacing: 2px;
  opacity: 0; transition: opacity 0.1s ease;
  pointer-events: none; border: 3px solid; z-index: 20;
}
.swipe-card__like-label { left: 18px; color: #2ecc71; border-color: #2ecc71; transform: rotate(-15deg); }
.swipe-card__pass-label { right: 18px; color: #e74c3c; border-color: #e74c3c; transform: rotate(15deg); }
.swipe-card.is-liking  .swipe-card__like-label { opacity: 1; }
.swipe-card.is-passing .swipe-card__pass-label { opacity: 1; }
.swipe-card.is-liking  { box-shadow: 0 8px 40px rgba(46,204,113,0.35); }
.swipe-card.is-passing { box-shadow: 0 8px 40px rgba(231,76,60,0.35); }

/* Card image — tỉ lệ động theo chiều cao stack */
.swipe-card__img-wrap {
  width: 100%;
  height: clamp(180px, 35vh, 260px);  /* responsive: 180-260px tuỳ màn hình */
  overflow: hidden; position: relative;
  background: rgba(255,255,255,0.04);
}
.swipe-card__img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; display: block; }
.swipe-card__img-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 55%);
}
.swipe-card__emoji {
  position: absolute; bottom: 10px; left: 14px;
  font-size: 2rem; line-height: 1;
}

/* Card body */
.swipe-card__body { padding: 14px 16px 16px; }
.swipe-card__name {
  font-size: 1.15rem; font-weight: 700;
  color: var(--text-primary, #fff); margin-bottom: 4px; line-height: 1.3;
}
.swipe-card__desc {
  font-size: 0.85rem; color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-style: italic;
}
.swipe-card__tags { display: flex; flex-wrap: wrap; gap: 5px; max-height: 56px; overflow: hidden; }
.swipe-card__tag {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 20px; padding: 3px 10px;
  font-size: 0.76rem; color: rgba(255,255,255,0.65);
  white-space: nowrap;
}

/* Swipe buttons */
.swipe-btns {
  display: flex; justify-content: center;
  gap: 48px; padding: 14px 20px 28px; flex-shrink: 0;
}
.swipe-btn {
  width: 60px; height: 60px; border-radius: 50%; border: 2px solid;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; cursor: pointer; transition: all 0.2s ease;
  background: rgba(20,20,22,0.7); backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.swipe-btn--pass { border-color: rgba(231,76,60,0.6); color: #e74c3c; }
.swipe-btn--pass:hover { background: rgba(231,76,60,0.18); transform: scale(1.1); }
.swipe-btn--like { border-color: rgba(247,201,72,0.6); color: #f7c948; }
.swipe-btn--like:hover { background: rgba(247,201,72,0.18); transform: scale(1.1); }
.swipe-btn:active { transform: scale(0.93); }

/* Empty state */
.swipe-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%;
  text-align: center; padding: 32px 24px;
  animation: fadeInUp 0.35s ease both;
}
.swipe-empty__emoji { font-size: 3rem; margin-bottom: 12px; }
.swipe-empty__title { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); margin: 0 0 8px; }
.swipe-empty__desc  { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 20px; }

/* Fly-off animations
 * Cards use top:50% translateY(-50%) as base.
 * Fly-off only changes X → simple translateX override works:
 *   browser keeps the top:50% as the positioning,
 *   and transform replaces translateY(-50%) with the fly direction.
 */
@keyframes swipeLeft  {
  from { transform: translateY(-50%); }
  to   { transform: translateY(-50%) translateX(-150%) rotate(-30deg); opacity: 0; }
}
@keyframes swipeRight {
  from { transform: translateY(-50%); }
  to   { transform: translateY(-50%) translateX(150%) rotate(30deg); opacity: 0; }
}
.swipe-card--fly-left  { animation: swipeLeft  0.32s ease forwards !important; pointer-events: none; }
.swipe-card--fly-right { animation: swipeRight 0.32s ease forwards !important; pointer-events: none; }
