/* ══���══════════════════════════════��═════════════════════════
   V3 — Swipe Deck / Flipbook Styles
   Tinder-style card swiping with particle effects, ported from V2
   ════════════���══════════════════════════════════════════════ */

/* ─── Deck container ───────────────────────────────────── */
.swipe-deck {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90vw;
  max-width: 380px;
  height: 63vh;
  max-height: 530px;
}

.swipe-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--muted);
}

.swipe-done {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--text);
  width: 260px;
}

.swipe-restart {
  margin-top: 16px;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #0b0d10;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}

.swipe-restart:active {
  transform: scale(0.97);
}

/* ─── Card ─────────────────────────────────────────────── */
.swipe-card {
  position: absolute;
  inset: 0;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, .6),
    0 0 0 1px rgba(255,255,255,.04),
    0 0 60px rgba(139, 92, 246, .06),
    0 0 120px rgba(139, 92, 246, .03);
  transition: transform .35s cubic-bezier(.4, .0, .2, 1), opacity .3s ease-out;
  touch-action: pan-y;
  will-change: transform;
  -webkit-user-select: none;
  user-select: none;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Subtle starry shimmer on the card */
.swipe-card::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(1px 1px at 15% 20%, rgba(255,255,255,.15) 0%, transparent 100%),
    radial-gradient(1px 1px at 72% 12%, rgba(255,255,255,.12) 0%, transparent 100%),
    radial-gradient(1px 1px at 45% 85%, rgba(255,255,255,.1) 0%, transparent 100%),
    radial-gradient(1px 1px at 88% 65%, rgba(255,255,255,.08) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 30% 50%, rgba(167,139,250,.15) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 35%, rgba(255,107,157,.08) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
  opacity: .6;
}

.swipe-card.gone-left {
  transform: translateX(-120%) rotate(-15deg);
  opacity: 0;
  pointer-events: none;
  transition: transform .4s cubic-bezier(.4, .0, .2, 1), opacity .35s;
}

.swipe-card.gone-right {
  transform: translateX(120%) rotate(15deg);
  opacity: 0;
  pointer-events: none;
  transition: transform .4s cubic-bezier(.4, .0, .2, 1), opacity .35s;
}

/* ─── Next card reveal ─────────────────────────────────── */
.swipe-card.waiting {
  filter: blur(3px);
  opacity: 0.6;
  transition: transform .5s cubic-bezier(.22, 1, .36, 1), opacity .4s, filter .5s !important;
}

.swipe-card.revealing {
  filter: blur(0);
  opacity: 1;
  transition: transform .5s cubic-bezier(.22, 1, .36, 1), opacity .4s ease-out, filter .5s ease-out !important;
}

/* ─── Swipe glow feedback ──────────────────────────────── */
.swipe-glow {
  position: absolute;
  inset: -2px;
  border-radius: 18px;
  pointer-events: none;
  z-index: 20;
  opacity: 0;
  transition: opacity .2s;
}

.swipe-glow-go {
  box-shadow: inset 0 0 40px rgba(74, 222, 128, .2), 0 0 30px rgba(74, 222, 128, .15);
  border: 2px solid rgba(74, 222, 128, .25);
}

.swipe-glow-no {
  box-shadow: inset 0 0 40px rgba(248, 113, 113, .18), 0 0 30px rgba(248, 113, 113, .12);
  border: 2px solid rgba(248, 113, 113, .2);
}

.swipe-card.swiping-right .swipe-glow-go { opacity: 1; }
.swipe-card.swiping-left .swipe-glow-no { opacity: 1; }

/* ─── Sparkle particles ────────────────────────────────── */
.swipe-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  overflow: visible;
  border-radius: 16px;
}

.swipe-particles .sp {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  will-change: transform, opacity;
}

@keyframes sparkOut {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  60% { opacity: .8; }
  100% { transform: translate(var(--sx), var(--sy)) scale(0); opacity: 0; }
}

.swipe-particles .sp.go {
  animation: sparkOut .7s cubic-bezier(.15, .8, .3, 1) forwards;
}

/* ─── Full-screen vote burst overlay ───────────────────── */
.vote-burst-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.vote-burst-overlay .vb-flash {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: vbFlash .7s cubic-bezier(.2, .8, .3, 1) forwards;
}

@keyframes vbFlash {
  0% { opacity: .4; }
  40% { opacity: .15; }
  100% { opacity: 0; }
}

.vote-burst-overlay .vb-ring {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  will-change: transform, opacity;
  animation: vbRing var(--dur, .9s) cubic-bezier(.2, .8, .3, 1) forwards;
  animation-delay: var(--del, 0s);
}

@keyframes vbRing {
  0% { transform: translate(-50%, -50%) scale(0); opacity: .55; }
  50% { opacity: .25; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

.vote-burst-overlay .vb-p {
  position: absolute;
  border-radius: 50%;
  will-change: transform, opacity, filter;
  animation: vbSparkle var(--dur) cubic-bezier(.2, .8, .3, 1) forwards;
  animation-delay: var(--del);
}

@keyframes vbSparkle {
  0% { transform: translate(0, 0) scale(.6); opacity: 0; filter: blur(0px); }
  12% { transform: translate(calc(var(--sx) * .08), calc(var(--sy) * .08)) scale(1.1); opacity: 1; }
  50% { opacity: .85; filter: blur(0.5px); }
  100% { transform: translate(var(--sx), var(--sy)) scale(.15); opacity: 0; filter: blur(2px); }
}

.vote-burst-overlay .vb-star {
  position: absolute;
  will-change: transform, opacity, filter;
  animation: vbStar var(--dur) cubic-bezier(.22, 1, .36, 1) forwards;
  animation-delay: var(--del);
}

@keyframes vbStar {
  0% { transform: translate(0, 0) scale(0) rotate(0deg); opacity: 0; filter: blur(0px); }
  15% { transform: translate(calc(var(--sx) * .1), calc(var(--sy) * .1)) scale(1.3) rotate(30deg); opacity: 1; }
  50% { opacity: .8; filter: blur(0.3px); }
  100% { transform: translate(var(--sx), var(--sy)) scale(.2) rotate(180deg); opacity: 0; filter: blur(1.5px); }
}

.vote-burst-overlay .vb-bloom {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform, opacity;
  animation: vbBloom var(--dur, 1s) cubic-bezier(.2, .8, .3, 1) forwards;
  animation-delay: var(--del, 0s);
}

@keyframes vbBloom {
  0% { transform: translate(-50%, -50%) scale(.3); opacity: .5; }
  30% { opacity: .35; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* Gradient sweep wash */
.vote-burst-overlay .vb-sweep {
  position: fixed; inset: 0;
  pointer-events: none;
}

@keyframes vbSweepFade {
  0% { opacity: 0; transform: scale(0.95); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.1) rotate(8deg); }
}

/* ─── Card content ─────────────────────────────────────── */
.swipe-card-img {
  height: 210px;
  background: var(--surface2) center/cover no-repeat;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Gradient fade from image into card body — matches browse cards */
.swipe-card-img::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 70px;
  background: linear-gradient(to bottom, transparent 0%, var(--surface) 100%);
  pointer-events: none;
}

.swipe-card-img .swipe-type {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(0, 0, 0, .55);
  /* backdrop-filter removed for mobile GPU perf */
  border: 1px solid rgba(255,255,255,.08);
  z-index: 1;
}

.swipe-card-body {
  flex: 1;
  padding: 10px 18px 6px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 2;
}

.swipe-card-title {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 4px;
  line-height: 1.2;
  color: #fff;
}

.swipe-card-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.swipe-card-loc {
  font-size: 11px;
  color: rgba(255,255,255,.45);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.swipe-card-loc svg {
  flex-shrink: 0;
  opacity: .6;
}

/* ─── Who's going chips ────────────────────────────────── */
.swipe-going {
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.swipe-going-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.35);
  margin-bottom: 5px;
}

.swipe-going-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.swipe-going-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 100px;
  background: rgba(74, 222, 128, .1);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, .15);
}

.swipe-going-chip.vote-y {
  background: rgba(250, 204, 21, .1);
  color: #facc15;
  border-color: rgba(250, 204, 21, .15);
}

.swipe-going-chip.vote-r {
  background: rgba(248, 113, 113, .08);
  color: #f87171;
  border-color: rgba(248, 113, 113, .15);
}

/* ─── Action buttons ─────────────────────────────────── */
.swipe-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 10px 20px 14px;
  background: var(--surface);
  flex-shrink: 0;
  position: relative;
}

.swipe-actions button {
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: transform .15s cubic-bezier(.2,.8,.2,1), box-shadow .2s, filter .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.swipe-actions button svg {
  width: 22px;
  height: 22px;
}

.swipe-actions button:active {
  transform: scale(1.2);
  filter: brightness(1.2);
}

.swipe-actions .sa-nope {
  width: 54px; height: 54px;
  background: linear-gradient(135deg, rgba(248,113,113,.15) 0%, rgba(239,68,68,.25) 100%);
  border: 2px solid rgba(248,113,113,.3);
  color: #f87171;
  box-shadow: 0 4px 16px rgba(248,113,113,.1), inset 0 1px 0 rgba(255,255,255,.06);
}

.swipe-actions .sa-nope:active {
  background: linear-gradient(135deg, rgba(248,113,113,.3) 0%, rgba(239,68,68,.4) 100%);
  box-shadow: 0 0 24px rgba(248,113,113,.3), inset 0 1px 0 rgba(255,255,255,.08);
}

.swipe-actions .sa-going {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, rgba(74,222,128,.2) 0%, rgba(34,208,102,.3) 100%);
  border: 2px solid rgba(74,222,128,.4);
  color: #4ade80;
  box-shadow: 0 4px 20px rgba(74,222,128,.15), 0 0 40px rgba(74,222,128,.05), inset 0 1px 0 rgba(255,255,255,.08);
}

.swipe-actions .sa-going svg {
  width: 28px; height: 28px;
}

.swipe-actions .sa-going:active {
  background: linear-gradient(135deg, rgba(74,222,128,.35) 0%, rgba(34,208,102,.5) 100%);
  box-shadow: 0 0 32px rgba(74,222,128,.35), 0 0 64px rgba(74,222,128,.1), inset 0 1px 0 rgba(255,255,255,.1);
}

.swipe-actions .sa-in {
  width: 54px; height: 54px;
  background: linear-gradient(135deg, rgba(250,204,21,.12) 0%, rgba(245,158,11,.22) 100%);
  border: 2px solid rgba(250,204,21,.3);
  color: #facc15;
  box-shadow: 0 4px 16px rgba(250,204,21,.1), inset 0 1px 0 rgba(255,255,255,.06);
}

.swipe-actions .sa-in:active {
  background: linear-gradient(135deg, rgba(250,204,21,.25) 0%, rgba(245,158,11,.35) 100%);
  box-shadow: 0 0 24px rgba(250,204,21,.3), inset 0 1px 0 rgba(255,255,255,.08);
}

/* Undo — top-left of card overlay */
.swipe-card-undo {
  position: absolute;
  top: 12px; left: 12px; z-index: 15;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(0,0,0,.5);
  /* backdrop-filter removed for mobile GPU perf */
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.6);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s ease;
}
.swipe-card-undo svg { width: 15px; height: 15px; }
.swipe-card-undo:active {
  color: #fff; background: rgba(0,0,0,.7);
  transform: scale(1.1);
}
.swipe-card-undo[disabled] {
  opacity: 0.2; pointer-events: none;
}

/* Three-dot menu — top-right of card overlay */
.swipe-card-menu {
  position: absolute;
  top: 12px; right: 12px; z-index: 15;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(0,0,0,.5);
  /* backdrop-filter removed for mobile GPU perf */
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.6);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s ease;
}
.swipe-card-menu svg { width: 16px; height: 16px; }
.swipe-card-menu:active {
  color: #fff; background: rgba(0,0,0,.7);
  transform: scale(1.1);
}

/* ─── Counter ─────────────────────────────────────────── */
.swipe-counter {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,.3);
  letter-spacing: .04em;
  margin-top: 2px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   Browse/Swipe Mode Toggle (mobile only)
   ═══════════════════════════════════════════════════════════ */

.discover-mode-toggle {
  display: none; /* Hidden on desktop */
  position: fixed;
  bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  right: auto;
  top: auto;
  z-index: 40;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: 3px;
  /* backdrop-filter removed for mobile GPU perf */
  gap: 2px;
}

@media (max-width: 768px) {
  .discover-mode-toggle {
    display: flex;
  }
}

.dmt-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
}

.dmt-btn:hover {
  color: var(--text);
}

.dmt-btn.active {
  background: rgba(139,92,246,.2);
  color: #a78bfa;
  box-shadow: 0 0 12px rgba(139,92,246,.15);
}

.dmt-btn svg {
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   Enhanced Swipe Card Styles (matching browse cards)
   ═══════════════════════════════════════════════════════════ */

/* Emoji placeholder in card image (like browse cards) */
.swipe-card-emoji {
  font-size: 40px;
  opacity: .35;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,.4));
  position: relative;
  z-index: 0;
}

/* Styled date line (matching browse card .frc-date) */
.swipe-card-date {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent, #ff6b9d);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 3px;
}

/* Venue line (matching .frc-venue) */
.swipe-card-venue {
  font-size: 12px;
  color: rgba(255,255,255,.5);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tags (matching .frc-tags) */
.swipe-card-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.swipe-card-tag {
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,.08);
  border: none;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.55);
}

/* Description snippet */
.swipe-card-desc {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255,255,255,.4);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Lineup / artists */
.swipe-card-lineup {
  font-size: 11px;
  color: rgba(255,255,255,.5);
  margin-bottom: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.swipe-lineup-label {
  font-weight: 700;
  color: var(--accent, #ff6b9d);
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: .06em;
  margin-right: 4px;
}

/* Friend dots overlay on card image (matching .frc-friends) */
.swipe-friends-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px 4px 4px;
  border-radius: 100px;
  background: rgba(0,0,0,.7);
  border: 1px solid rgba(255,255,255,.08);
  z-index: 5;
}

.swipe-friend-avatars {
  display: flex;
}

.swipe-friend-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent, #ff6b9d) 0%, rgba(139,92,246,.8) 100%);
  border: 1.5px solid rgba(0,0,0,.4);
  margin-left: -4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: #fff;
}

.swipe-friend-dot:first-child {
  margin-left: 0;
}

.swipe-friend-text {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,.8);
  padding-left: 4px;
}

/* ═══════════════════════════════════════════════════════════
   Inline Swipe Wrapper (for Discover page embed)
   ═══════════════════════════════════════════════════════════ */

.swipe-inline-wrapper {
  position: relative;
  width: 100%;
  height: 68vh;
  min-height: 420px;
  max-height: 595px;
  margin-top: 8px;
  margin-bottom: 24px;
  padding-bottom: 16px;
}

@media (max-width: 600px) {
  .swipe-inline-wrapper {
    height: 61vh;
    min-height: 360px;
    max-height: 510px;
    margin-top: 4px;
    margin-bottom: 20px;
    padding-bottom: 12px;
  }
}

.swipe-inline-wrapper .swipe-deck {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.discover-swipe-content {
  padding-top: 8px;
}

/* Smooth transition between modes */
.discover-browse-content,
.discover-swipe-content {
  animation: discoverModeIn .3s ease;
}

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

/* ═══════════════════════════════════════════════════════════
   Swipe card dismiss animation
   Directional fly-off is now handled inline via JS
   (translateX to off-screen + rotation). This class is the
   fallback for button-triggered dismissals without a direction.
   ═══════════════════════════════════════════════════════════ */

.swipe-card.swipe-card-dismissing {
  transform: translateX(120%) rotate(20deg) !important;
  opacity: 0 !important;
  transition: transform 0.35s cubic-bezier(.4,.0,.2,1), opacity 0.3s ease-out !important;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   Info badges (distance, friends going, start time)
   ═══════════════════════════════════════════════════════════ */

.swipe-info-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.swipe-info-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.7);
}

.swipe-distance-badge {
  color: #60a5fa;
  border-color: rgba(96,165,250,.2);
  background: rgba(96,165,250,.08);
}

.swipe-friends-badge {
  color: #a78bfa;
  border-color: rgba(167,139,250,.2);
  background: rgba(167,139,250,.08);
}

.swipe-time-badge {
  color: #fbbf24;
  border-color: rgba(251,191,36,.2);
  background: rgba(251,191,36,.08);
}
