/* ═══════════════════════════════════════════════════════════
   Swipe Page — Premium Card UI
   ═══════════════════════════════════════════════════════════ */

body {
  height: 100dvh;
  overflow: hidden;
}

/* ─── Header ─── */
.swipe-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-2) var(--sp-3);
  background: rgba(15, 15, 18, 0.72);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-bottom: 1px solid var(--border-subtle);
  height: 48px;
  z-index: 50;
  position: relative;
}

/* ─── Mode Tabs (Segmented Control) ─── */
.mode-tabs {
  display: flex;
  gap: 2px;
  background: rgba(196, 168, 130, 0.08);
  border: 1px solid rgba(196, 168, 130, 0.12);
  border-radius: var(--radius-pill);
  padding: 3px;
}

.mode-tab {
  padding: 6px 18px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-moderate) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.mode-tab.active {
  background: var(--accent);
  color: var(--bg-body);
  box-shadow: 0 2px 8px rgba(196, 168, 130, 0.3);
}

.mode-tab:not(.active):hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
}

/* ─── Stat Pills ─── */
.stats {
  display: flex;
  gap: 6px;
  font-size: var(--text-xs);
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.stat-pill span { font-weight: 700; }
.stat-approved span { color: var(--success); }
.stat-rejected span { color: var(--error); }
.stat-pending span { color: var(--warning); }
.stat-posting span { color: var(--info); }
.stat-posting:empty { display: none; }

/* ─── Swipe Container ─── */
.swipe-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: calc(100dvh - 48px - 60px);
  padding: var(--sp-1);
  padding-bottom: 90px;
  position: relative;
  overflow: hidden;
}

/* ─── Card ─── */
.card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-surface-1);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.45),
    0 2px 8px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.03);
  position: relative;
  cursor: grab;
  transition: transform var(--duration-base) var(--ease-in-out),
              opacity var(--duration-base) var(--ease-in-out);
  touch-action: none;
  will-change: transform;
  animation: cardEnter 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Top-edge highlight */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(196, 168, 130, 0.2) 20%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(196, 168, 130, 0.2) 80%,
    transparent 100%
  );
  z-index: 10;
  pointer-events: none;
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(16px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.card.dragging {
  cursor: grabbing;
  transition: none;
}

.card.swiping-right {
  animation: swipeRight 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.card.swiping-left {
  animation: swipeLeft 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.card.swiping-up {
  animation: swipeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes swipeRight {
  to { transform: translateX(120%) rotate(15deg); opacity: 0; }
}
@keyframes swipeLeft {
  to { transform: translateX(-120%) rotate(-15deg); opacity: 0; }
}
@keyframes swipeUp {
  to { transform: translateY(-120%); opacity: 0; }
}

/* ─── Card Image ─── */
.card-image {
  width: 100%;
  height: calc(100dvh - 200px);
  object-fit: contain;
  background: #0d0d0d;
  display: block;
}

/* ─── Gradient Overlay ─── */
.card-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(15, 15, 18, 0.15) 20%,
    rgba(15, 15, 18, 0.45) 45%,
    rgba(15, 15, 18, 0.8) 70%,
    var(--bg-surface-1) 100%
  );
  pointer-events: none;
  z-index: 2;
}

/* ─── Badge Overlay (Approve/Reject/Defer) ─── */
.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--sp-6) var(--sp-5);
  pointer-events: none;
  z-index: 5;
}

.badge {
  padding: 10px 22px;
  border-radius: var(--radius);
  font-size: 22px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 3px;
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-in-out),
              transform var(--duration-base) var(--ease-in-out);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.badge-approve {
  border: 3px solid var(--success);
  color: var(--success);
  background: rgba(62, 207, 142, 0.1);
  box-shadow: 0 0 24px rgba(62, 207, 142, 0.2);
  transform: rotate(12deg);
}

.badge-reject {
  border: 3px solid var(--error);
  color: var(--error);
  background: rgba(229, 72, 77, 0.1);
  box-shadow: 0 0 24px rgba(229, 72, 77, 0.2);
  transform: rotate(-12deg);
}

.badge-defer {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 3px solid var(--info);
  color: var(--info);
  background: rgba(91, 155, 213, 0.1);
  box-shadow: 0 0 24px rgba(91, 155, 213, 0.2);
}

/* ─── Card Info ─── */
.card-info {
  position: relative;
  z-index: 3;
  padding: 10px var(--sp-4) var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  background: var(--bg-surface-1);
}

.card-info-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
}

.card-info-right {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
  margin-left: auto;
}

.card-info h2 {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-info .product-title { display: none; }

.card-info .price {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
  letter-spacing: -0.3px;
}

.card-info .description { display: none; }

/* Trend tag inline (in card-info row) */
.trend-tag-inline {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--sp-2);
  background: var(--accent-muted);
  color: var(--accent);
  border: 1px solid rgba(196, 168, 130, 0.25);
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

/* Product link icon button */
.card-info .product-link {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
  pointer-events: auto;
  font-size: var(--text-lg);
  color: var(--text-tertiary);
  transition: all var(--duration-moderate) var(--ease-out);
}

.card-info .product-link:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-strong);
  color: var(--text-primary);
  transform: scale(1.05);
}

/* ─── Action Buttons ─── */
.buttons {
  position: fixed;
  bottom: 68px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: var(--sp-5);
  z-index: 10;
  padding: 0 var(--sp-5);
}

.btn-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.btn-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.btn-label-reject { color: var(--error); }
.btn-label-undo { color: var(--text-disabled); }
.btn-label-approve { color: var(--success); }

.btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: transform var(--duration-moderate) cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow var(--duration-moderate) var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.btn:active {
  transform: scale(0.88);
}

.btn-reject {
  background: var(--error-muted);
  border: 2px solid var(--error);
  color: var(--error);
  box-shadow:
    0 0 16px rgba(229, 72, 77, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-reject:hover {
  box-shadow:
    0 0 24px rgba(229, 72, 77, 0.25),
    0 4px 16px rgba(0, 0, 0, 0.4);
}

.btn-undo {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid var(--text-disabled);
  color: var(--text-disabled);
  font-size: 18px;
  align-self: center;
  box-shadow:
    0 0 12px rgba(255, 255, 255, 0.03),
    0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-undo:hover {
  border-color: var(--text-tertiary);
  color: var(--text-tertiary);
  box-shadow:
    0 0 16px rgba(255, 255, 255, 0.06),
    0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn-approve {
  background: var(--success-muted);
  border: 2px solid var(--success);
  color: var(--success);
  box-shadow:
    0 0 16px rgba(62, 207, 142, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-approve:hover {
  box-shadow:
    0 0 24px rgba(62, 207, 142, 0.25),
    0 4px 16px rgba(0, 0, 0, 0.4);
}

/* ─── Image Navigation ─── */
.image-nav { position: absolute; top: 0; bottom: 40px; width: 50%; z-index: 5; }
.image-nav-left { left: 0; }
.image-nav-right { right: 0; }

/* ─── Image Dots ─── */
.image-dots {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  z-index: 8;
}

.image-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transition: all var(--duration-moderate) var(--ease-out);
}

.image-dot.active {
  background: var(--text-primary);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
  transform: scale(1.15);
}

/* ─── Image Label ─── */
.image-label {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  padding: var(--sp-1) 10px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--success);
  font-size: var(--text-xs);
  font-weight: 700;
  border-radius: var(--radius-pill);
  z-index: 7;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid var(--border-subtle);
}

.image-label.original {
  color: var(--warning);
}

/* ─── Trend Tag (top-right of image) ─── */
.trend-tag {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  padding: var(--sp-1) 10px;
  background: rgba(196, 168, 130, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-pill);
  z-index: 7;
  max-width: 45%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid rgba(196, 168, 130, 0.2);
}

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  color: var(--text-tertiary);
  padding: 60px var(--sp-5);
}

.empty-state h2 {
  font-size: var(--text-2xl);
  margin-bottom: var(--sp-2);
  color: var(--text-primary);
  font-weight: 700;
}

.empty-state p {
  font-size: var(--text-base);
  margin-bottom: var(--sp-4);
  color: var(--text-secondary);
}

.empty-state .post-btn {
  display: inline-block;
  padding: 14px 32px;
  background: var(--accent);
  color: var(--bg-body);
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 16px rgba(196, 168, 130, 0.25);
  transition: transform var(--duration-moderate) var(--ease-out),
              box-shadow var(--duration-moderate) var(--ease-out),
              background var(--duration-base) var(--ease-in-out);
}

.empty-state .post-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(196, 168, 130, 0.35);
}

/* ─── Desktop ─── */
/* ─── Tablet ─── */
@media (min-width: 768px) {
  .swipe-container {
    height: calc(100vh - 48px - 48px);
    padding: var(--sp-6);
    padding-bottom: 100px;
    align-items: center;
  }

  .card {
    max-width: 420px;
    border-radius: 24px;
    box-shadow:
      0 16px 64px rgba(0, 0, 0, 0.5),
      0 4px 16px rgba(0, 0, 0, 0.3),
      0 0 0 1px rgba(255, 255, 255, 0.04);
  }

  .card-image { height: 560px; }

  .card-info {
    padding: var(--sp-3) var(--sp-4) var(--sp-4);
  }

  .card-info .description {
    display: block;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.4;
  }

  .card-info .product-title {
    display: block;
    font-size: var(--text-sm);
    color: var(--text-tertiary);
  }

  .buttons {
    bottom: 90px;
    gap: 28px;
  }

  .btn {
    width: 64px;
    height: 64px;
    font-size: 28px;
  }

  .btn-undo {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  .btn-label { font-size: 11px; }

  .badge {
    font-size: 26px;
    padding: var(--sp-3) 28px;
  }

  .card-gradient { height: 140px; }

  .stat-pill {
    padding: 5px var(--sp-3);
    font-size: 11px;
  }
}

/* ─── Desktop Widescreen ─── */
@media (min-width: 1024px) {
  .swipe-header {
    height: 56px;
    padding: 8px 32px;
  }

  .swipe-container {
    height: calc(100vh - 56px);
    padding: 32px;
    padding-bottom: 120px;
    align-items: center;
    justify-content: center;
  }

  .card {
    max-width: 440px;
    border-radius: 24px;
  }

  .card-image {
    height: 620px;
    object-fit: cover;
    border-radius: 24px 24px 0 0;
  }

  .card-info {
    padding: var(--sp-4) var(--sp-5);
  }

  .card-info h2 {
    font-size: var(--text-lg);
  }

  .card-info .price {
    font-size: var(--text-xl);
  }

  .card-info .description {
    display: block;
    font-size: var(--text-base);
    color: var(--text-secondary);
    margin-top: var(--sp-2);
    line-height: 1.5;
    max-height: 60px;
    overflow: hidden;
  }

  .card-info .product-title {
    display: block;
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    margin-top: var(--sp-1);
  }

  .card-info .product-link {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .buttons {
    bottom: 40px;
    gap: 32px;
  }

  .btn {
    width: 68px;
    height: 68px;
    font-size: 30px;
  }

  .btn:hover {
    transform: scale(1.1);
  }

  .btn-undo {
    width: 52px;
    height: 52px;
    font-size: 22px;
  }

  .btn-label {
    font-size: 11px;
    opacity: 0.7;
  }

  .badge {
    font-size: 28px;
    padding: 14px 32px;
    letter-spacing: 4px;
  }

  /* Keyboard hint on desktop */
  .keyboard-hints {
    display: block;
    position: fixed;
    bottom: 16px;
    right: 24px;
    font-size: 11px;
    color: var(--text-disabled);
  }

  .keyboard-hints kbd {
    padding: 2px 8px;
    background: var(--bg-surface-2);
    border: 1px solid var(--border-default);
    border-radius: 4px;
    font-family: var(--font-family);
    font-size: 10px;
    color: var(--text-tertiary);
  }
}

/* ─── Ultra-wide ─── */
@media (min-width: 1440px) {
  .swipe-container {
    padding: 48px;
  }

  .card {
    max-width: 480px;
  }

  .card-image {
    height: 680px;
  }
}
