/* ─────────────────────────────────────────────────────────────
   live-list.css — dark/light theme enabled
   Requires theme-core.css to be loaded BEFORE this file.
   Colors below reference CSS variables with the original
   literal kept as a fallback, e.g. var(--accent, #4f35e8).
   ───────────────────────────────────────────────────────────── */

:root {
  --lp-accent: var(--accent, #4f35e8);
  --lp-accent-2: var(--accent-2, #7058f5);
  --lp-pale: var(--accent-pale-bg, #eceaff);
  --lp-ink: var(--text-primary, #16162a);
  --lp-muted: var(--text-secondary, #7b7b96);
  --lp-faint: var(--text-faint, #c4c4d8);
  --lp-border: var(--border-color, #e6e6f0);
  --lp-surface: var(--bg-surface, #ffffff);
  --lp-bg: var(--bg-page, #f2f3f7);
  --lp-success: var(--success-2, #10b981);
  --lp-success-bg: var(--success-pale-bg, #d1fae5);
  --lp-danger: var(--danger, #ef4444);
  --lp-danger-bg: var(--danger-pale-bg, #fee2e2);
  --lp-gold: var(--gold, #f59e0b);
  --lp-gold-bg: var(--gold-pale-bg, #fef3c7);
  --lp-r: var(--radius-md, 14px);
  --lp-r-sm: 8px;
  --lp-sh: 0 2px 10px var(--shadow-color-sm, rgba(0, 0, 0, 0.06));
  --lp-sh-hover: 0 10px 32px rgba(79, 53, 232, 0.13);
  --t: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --lp-radius: 14px;
  --lp-radius-sm: 8px;
  --lp-shadow-sm: 0 2px 8px var(--shadow-color-sm, rgba(0, 0, 0, 0.06));
  --lp-shadow-md: 0 6px 24px rgba(0, 0, 0, 0.09);
  --lp-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--lp-bg);
  color: var(--lp-ink);
  -webkit-font-smoothing: antialiased;
}

.lp-header {
  background: var(--lp-surface);
  border-bottom: 1px solid var(--lp-border);
  padding: 18px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
  border-radius: 0 0 var(--lp-radius) var(--lp-radius);
  box-shadow: var(--lp-shadow-sm);
}

.lp-title h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--lp-ink);
  line-height: 1.2;
  margin: 0;
}

.lp-title span {
  font-size: 12px;
  color: var(--lp-muted);
  display: block;
  margin-top: 3px;
}

.lp-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--lp-success-bg);
  border: 1px solid var(--success-alt, #6ee7b7);
  color: var(--lp-success);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11.5px;
  font-weight: 700;
  margin-top: 6px;
}

.lp-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lp-success);
  animation: lp-pulse 1.8s ease infinite;
}

@keyframes lp-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.3);
  }
}

.lp-filters {
  display: flex;
  align-items: center;
  /* flex-wrap: wrap; */
  gap: 8px;
}

.lp-filters .form-control,
.lp-filters .form-select {
  border: 1.5px solid var(--lp-border);
  border-radius: var(--lp-r-sm);
  padding: 8px 12px;
  height: 38px;
  font-size: 13px;
  font-family: inherit;
  color: var(--lp-ink);
  background: var(--lp-surface);
  outline: none;
  transition: border-color var(--t);
}

.lp-filters .form-control:focus,
.lp-filters .form-select:focus {
  border-color: var(--lp-accent);
  box-shadow: 0 0 0 3px rgba(79, 53, 232, 0.1);
}

.lp-btn-apply {
  background: linear-gradient(135deg, var(--lp-accent), var(--lp-accent-2));
  color: var(--bg-surface, #fff);
  border: none;
  border-radius: var(--lp-r-sm);
  padding: 0 18px;
  height: 38px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 2px 12px rgba(79, 53, 232, 0.28);
  transition: opacity var(--t);
  white-space: nowrap;
}

.lp-btn-apply:hover {
  opacity: 0.88;
}

.lp-btn-remove-all {
  background: transparent;
  color: var(--lp-danger);
  border: 1.5px solid var(--lp-danger);
  border-radius: var(--lp-r-sm);
  padding: 0 14px;
  height: 38px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all var(--t);
  white-space: nowrap;
}

.lp-btn-remove-all:hover {
  background: var(--lp-danger-bg);
}

.lp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  padding: 0 0 32px;
}

.lp-card {
  background: var(--lp-surface);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-r);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--lp-sh);
  transition:
    transform var(--t),
    box-shadow var(--t);
  position: relative;
}

.lp-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--lp-sh-hover);
}

.lp-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--lp-success),
    var(--success-2, #34d399),
    var(--lp-accent),
    var(--lp-accent-2)
  );
  background-size: 200% 100%;
  animation: lp-shimmer 3s linear infinite;
}

@keyframes lp-shimmer {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

.lp-img {
  aspect-ratio: 1;
  background: var(--bg-subtle-2, #f5f5fa);
  overflow: hidden;
  position: relative;
}

.lp-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.lp-card:hover .lp-img img {
  transform: scale(1.06);
}

.lp-live-badge {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 4;
  background: rgba(16, 185, 129, 0.9);
  color: var(--bg-surface, #fff);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(4px);
}

.lp-live-badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--bg-surface, #fff);
  animation: lp-pulse 1.8s ease infinite;
}

.lp-store-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(22, 22, 42, 0.8), transparent);
  padding: 18px 9px 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.lp-shopify-icon {
  width: 14px;
  height: 14px;
  background: #95bf47;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 900;
  color: var(--bg-surface, #fff);
  flex-shrink: 0;
}

.lp-store-name {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--bg-surface, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.lp-body {
  padding: 11px 12px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.lp-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--lp-ink);
  line-height: 1.4;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}

.lp-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 11px;
}

.lp-stat-box {
  background: var(--lp-bg);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-r-sm);
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.lp-stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--lp-muted);
}

.lp-stat-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--lp-ink);
  line-height: 1.2;
}

.lp-stat-val.profit {
  color: var(--lp-success);
}

.lp-actions {
  display: flex;
  gap: 7px;
  margin-top: auto;
}

.lp-btn {
  flex: 1;
  border-radius: var(--lp-r-sm);
  padding: 8px 0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all var(--t);
  border: 1.5px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.3;
}

.lp-btn-view {
  background: linear-gradient(135deg, var(--lp-accent), var(--lp-accent-2));
  color: var(--bg-surface, #fff);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(79, 53, 232, 0.25);
}

.lp-btn-view:hover {
  opacity: 0.88;
  color: var(--bg-surface, #fff);
}

.lp-btn-remove {
  background: transparent;
  color: var(--lp-danger);
  border-color: var(--danger-2, #fca5a5);
}

.lp-btn-remove:hover {
  background: var(--lp-danger-bg);
}

.lp-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 24px;
  background: var(--lp-surface);
  border: 2px dashed var(--lp-border);
  border-radius: 20px;
  margin: 0 0 32px;
}

.lp-empty-icon {
  width: 80px;
  height: 80px;
  background: var(--lp-pale);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 32px;
  color: var(--lp-accent);
}

.lp-empty h4 {
  font-family: "Sora", sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--lp-ink);
  margin-bottom: 8px;
}

.lp-empty p {
  color: var(--lp-muted);
  font-size: 13.5px;
  margin-bottom: 24px;
}

.lp-empty-btn {
  background: linear-gradient(135deg, var(--lp-accent), var(--lp-accent-2));
  color: var(--bg-surface, #fff);
  border: none;
  border-radius: var(--lp-r-sm);
  padding: 11px 26px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 12px rgba(79, 53, 232, 0.3);
  transition: opacity var(--t);
}

.lp-empty-btn:hover {
  opacity: 0.88;
  color: var(--bg-surface, #fff);
}

.lp-card {
  animation: lp-cardin 0.35s ease both;
}

@keyframes lp-cardin {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 768px) {
  .lp-header {
    padding: 14px 16px;
  }

  .lp-grid {
    padding: 0 0 24px;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .lp-filters {
    width: 100%;
    flex-direction: column;
  }

  .lp-filters .form-control,
  .lp-filters .form-select {
    flex: 1;
    min-width: 0;
  }

  .lp-btn-apply {
    width: 100%;
    justify-content: center;
  }

  .lp-btn-remove-all {
    width: 100%;
    justify-content: center;
  }

  .lp-empty {
    margin: 0 12px 24px;
  }
}

@media (max-width: 400px) {
  .lp-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .lp-name {
    font-size: 12px;
  }

  .lp-btn {
    font-size: 11px;
    padding: 7px 0;
  }
}

/*  */
/* Hidden on desktop */
.lp-filter-trigger {
  display: none;
}
.lp-sheet-overlay {
  display: none;
}

@media (max-width: 768px) {
  .lp-filter-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--accent-alt, #7c3aed);
    color: var(--bg-surface, #fff);
    border: none;
    border-radius: 10px;
    font-weight: 600;
  }

  /* Turn the filter bar into a bottom sheet */
  .lp-filters {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-surface, #fff);
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 30px var(--shadow-color-lg, rgba(0, 0, 0, 0.18));
    transform: translateY(100%);
    transition: transform 0.28s ease;
  }
  .lp-filters.open {
    transform: translateY(0);
  }

  .lp-filters .form-control,
  .lp-filters .form-select,
  .lp-filters .lp-btn-apply,
  .lp-filters .lp-btn-remove-all {
    width: 100%;
  }

  /* drag handle */
  .lp-filters::before {
    content: "";
    width: 40px;
    height: 4px;
    background: var(--border-strong, #d1d5db);
    border-radius: 4px;
    margin: -8px auto 4px;
  }

  .lp-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1040;
  }
  .lp-sheet-overlay.open {
    display: block;
  }
}
