/* =========================================
   DealHunter PL — Stylesheet v2
   ========================================= */

:root {
  --fire: #ff4500;
  --fire-dim: rgba(255,69,0,0.15);
  --gold: #ffb300;
  --green: #00c853;
  --blue: #2979ff;
  --bg: #0c0c0e;
  --bg-card: #141416;
  --bg-card-hover: #1b1b1e;
  --bg-raised: #1a1a1d;
  --border: #252528;
  --border-mid: #333337;
  --text: #ededf0;
  --text-2: #9898a8;
  --text-3: #5c5c6e;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --trans: 0.2s ease;
  --shadow-card: 0 2px 20px rgba(0,0,0,0.5);
  --shadow-hover: 0 8px 40px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,69,0,0.3);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ── Scrollbar ─────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 3px; }

/* ── HEADER ────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(12,12,14,0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 58px;
  display: flex; align-items: center;
  padding: 0 20px;
}
.header-inner {
  max-width: 1320px; width: 100%; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo-icon { font-size: 1.5rem; }
.logo-text { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.5px; }
.logo-accent { color: var(--fire); }

.header-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.meta-pill {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.72rem; font-weight: 500;
  padding: 4px 10px; border-radius: 20px;
  white-space: nowrap;
}
.sources-pill { display: none; }
@media(min-width: 640px) { .sources-pill { display: inline-flex; } }

/* ── HERO ──────────────────────────────── */
.hero {
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(255,69,0,0.14) 0%, transparent 70%),
    var(--bg);
  padding: 56px 20px 48px;
  text-align: center;
}
.hero-inner { max-width: 760px; margin: 0 auto; }

.hero-title {
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  font-weight: 900; letter-spacing: -1.5px; line-height: 1.1;
  margin-bottom: 14px;
}
.highlight {
  background: linear-gradient(90deg, var(--fire) 0%, var(--gold) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 0.97rem; color: var(--text-2); line-height: 1.7;
  margin-bottom: 28px;
}
.hero-sub strong { color: var(--green); font-weight: 700; }

/* Source badges */
.source-badges {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center; margin-bottom: 28px;
}
.src-badge {
  font-size: 0.75rem; font-weight: 700;
  padding: 5px 12px; border-radius: 20px;
  border: 1px solid var(--border-mid);
  background: var(--bg-raised);
  color: var(--text-2);
}
.src-badge.pepper  { border-color: #c0392b; color: #ff6b6b; background: rgba(192,57,43,0.1); }
.src-badge.dealabs { border-color: #e55a00; color: #ff8c42; background: rgba(229,90,0,0.1); }
.src-badge.hotuk   { border-color: #1a6eb5; color: #4ea8ff; background: rgba(26,110,181,0.1); }
.src-badge.pepperde{ border-color: #888; color: #ccc; background: rgba(100,100,100,0.1); }
.src-badge.extra   { border-color: var(--border); color: var(--text-3); }

/* Category filters */
.category-filters {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center; margin-bottom: 24px;
}
.cat-btn {
  background: var(--bg-raised);
  border: 1px solid var(--border-mid);
  color: var(--text-2);
  padding: 7px 15px; border-radius: 24px;
  font-size: 0.8rem; font-weight: 600;
  cursor: pointer; font-family: 'Inter', sans-serif;
  display: flex; align-items: center; gap: 6px;
  transition: var(--trans);
}
.cat-btn i { font-size: 0.72rem; }
.cat-btn:hover { border-color: var(--fire); color: var(--fire); background: var(--fire-dim); }
.cat-btn.active {
  background: var(--fire); border-color: var(--fire);
  color: #fff; box-shadow: 0 0 18px rgba(255,69,0,0.35);
}

/* Discount slider */
.discount-filter {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  margin-bottom: 32px;
}
.discount-filter label {
  font-size: 0.85rem; color: var(--text-2);
}
.discount-filter label strong { color: var(--gold); font-size: 1rem; }
#minDiscSlider {
  -webkit-appearance: none; appearance: none;
  width: 220px; height: 4px;
  background: linear-gradient(90deg, var(--fire) 0%, var(--gold) 100%);
  border-radius: 2px; outline: none; cursor: pointer;
}
#minDiscSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--gold); border: 3px solid var(--bg);
  box-shadow: 0 0 8px rgba(255,179,0,0.5);
  cursor: pointer;
}
#minDiscSlider::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--gold); border: 3px solid var(--bg);
  cursor: pointer;
}
.slider-hints {
  display: flex; justify-content: space-between; width: 220px;
  font-size: 0.68rem; color: var(--text-3);
}

/* ── HUNT BUTTON ───────────────────────── */
.hunt-btn {
  display: inline-flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ff4500 0%, #ff6b35 50%, #e6a800 100%);
  border: none; border-radius: 20px;
  padding: 18px 52px; cursor: pointer;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 0 32px rgba(255,69,0,0.45), 0 8px 24px rgba(0,0,0,0.5);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-width: 210px;
  position: relative; overflow: hidden;
}
.hunt-btn::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
  pointer-events: none;
}
.hunt-btn:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 0 56px rgba(255,69,0,0.65), 0 16px 40px rgba(0,0,0,0.6);
}
.hunt-btn:active { transform: scale(0.97); }
.hunt-btn.loading { pointer-events: none; }
.hunt-btn.loading .hunt-label { opacity: 0.7; }

.hunt-icon { font-size: 1.7rem; line-height: 1; }
.hunt-label {
  font-size: 1.55rem; font-weight: 900;
  color: #fff; letter-spacing: 3px; line-height: 1.2;
}
.hunt-sub { font-size: 0.7rem; color: rgba(255,255,255,0.7); font-weight: 500; }

/* ── PROGRESS BAR ──────────────────────── */
.progress-wrap {
  position: sticky; top: 58px; z-index: 150;
  background: var(--bg-raised); border-bottom: 1px solid var(--border);
  padding: 10px 20px;
  display: flex; flex-direction: column; gap: 6px;
}
.progress-bar-track {
  width: 100%; max-width: 1320px; margin: 0 auto;
  height: 4px; background: var(--border);
  border-radius: 2px; overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--fire), var(--gold));
  border-radius: 2px;
  width: 0%;
  transition: width 0.4s ease;
}
.progress-status {
  max-width: 1320px; margin: 0 auto; width: 100%;
  font-size: 0.78rem; color: var(--text-2);
  display: flex; align-items: center; gap: 8px;
}
.progress-status .feed-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.fpill {
  font-size: 0.68rem; font-weight: 600;
  padding: 2px 8px; border-radius: 10px;
  border: 1px solid var(--border-mid);
  transition: var(--trans);
}
.fpill.loading { border-color: var(--gold); color: var(--gold); }
.fpill.ok      { border-color: var(--green); color: var(--green); background: rgba(0,200,83,0.08); }
.fpill.fail    { border-color: #f44336; color: #f44336; background: rgba(244,67,54,0.08); }

/* ── RESULTS AREA ──────────────────────── */
.results-area {
  max-width: 1320px; margin: 0 auto;
  padding: 28px 20px 48px;
}

/* Stats + controls */
.results-header {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 20px;
}

.stats-row {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.stat-chip {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  display: flex; align-items: baseline; gap: 6px;
  flex: 1; min-width: 90px; max-width: 160px;
}
.stat-chip.fire .stat-val { color: var(--fire); }
.stat-chip.green .stat-val { color: var(--green); }
.stat-chip.blue .stat-val { color: var(--blue); }
.stat-val { font-size: 1.35rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-lbl { font-size: 0.68rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; }

.controls-row {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.search-wrap, .sort-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-raised); border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm); padding: 8px 14px;
  flex: 1; min-width: 160px;
}
.search-wrap i, .sort-wrap i { color: var(--text-3); font-size: 0.8rem; flex-shrink: 0; }
#searchInput {
  background: none; border: none; outline: none;
  color: var(--text); font-family: 'Inter', sans-serif;
  font-size: 0.85rem; width: 100%;
}
#searchInput::placeholder { color: var(--text-3); }
#sortSelect {
  background: none; border: none; outline: none;
  color: var(--text); font-family: 'Inter', sans-serif;
  font-size: 0.85rem; cursor: pointer; width: 100%;
}
#sortSelect option { background: var(--bg-raised); }

/* Feed status row */
.feed-status-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 20px; min-height: 0;
}
.feed-tag {
  font-size: 0.7rem; font-weight: 600;
  padding: 4px 10px; border-radius: 12px;
  border: 1px solid; display: flex; align-items: center; gap: 4px;
}
.feed-tag.ok    { border-color: var(--green); color: var(--green); background: rgba(0,200,83,0.08); }
.feed-tag.fail  { border-color: #f44336; color: #f44336; background: rgba(244,67,54,0.08); }
.feed-tag.empty { border-color: var(--gold); color: var(--gold); background: rgba(255,179,0,0.08); }

/* ── CARDS GRID ────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}

/* ── DEAL CARD ─────────────────────────── */
.deal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  overflow: hidden;
  position: relative;
  transition: transform var(--trans), border-color var(--trans), box-shadow var(--trans);
  box-shadow: var(--shadow-card);
  animation: cardIn 0.3s ease both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.deal-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(255,69,0,0.4);
}

/* Mega deal animated border */
.deal-card.mega {
  border-color: transparent;
  background-clip: padding-box;
}
.deal-card.mega::before {
  content: '';
  position: absolute; inset: -1px;
  border-radius: calc(var(--radius) + 1px);
  background: linear-gradient(135deg, var(--fire), var(--gold), var(--fire));
  background-size: 300% 300%;
  animation: borderSpin 3s linear infinite;
  z-index: -1;
}
@keyframes borderSpin {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Discount badge (top-left ribbon) */
.disc-ribbon {
  position: absolute; top: 12px; left: 0;
  background: var(--fire);
  color: #fff; font-size: 0.78rem; font-weight: 800;
  padding: 4px 12px 4px 10px;
  border-radius: 0 6px 6px 0;
  z-index: 5;
  letter-spacing: 0.3px;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.4);
}
.disc-ribbon.mega-rib { background: linear-gradient(90deg, var(--fire), var(--gold)); }
.disc-ribbon.hot-rib  { background: #7b1fa2; }

/* Source tag (top-right) */
.src-tag {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  color: var(--text-2); font-size: 0.65rem; font-weight: 600;
  padding: 3px 8px; border-radius: 8px;
  z-index: 5; white-space: nowrap;
}

/* Card image */
.card-img {
  width: 100%; height: 180px;
  background: var(--bg-raised);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; border-bottom: 1px solid var(--border);
  position: relative; flex-shrink: 0;
}
.card-img img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; padding: 10px;
  transition: transform 0.3s ease;
}
.deal-card:hover .card-img img { transform: scale(1.04); }
.card-img .no-img { font-size: 3rem; opacity: 0.3; }

/* Card body */
.card-body {
  padding: 14px 16px; flex: 1;
  display: flex; flex-direction: column; gap: 9px;
}

.card-meta {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.cat-tag {
  font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-3);
  display: flex; align-items: center; gap: 3px;
}
.store-tag {
  font-size: 0.7rem; color: var(--text-3);
  margin-left: auto; display: flex; align-items: center; gap: 3px;
}

.card-title {
  font-size: 0.93rem; font-weight: 600;
  color: var(--text); line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Price block */
.price-block {
  display: flex; align-items: center;
  gap: 8px; flex-wrap: wrap;
}
.price-now {
  font-size: 1.4rem; font-weight: 800;
  color: var(--green); line-height: 1;
}
.price-was {
  font-size: 0.85rem; color: var(--text-3);
  text-decoration: line-through;
}
.price-save {
  background: rgba(0,200,83,0.12);
  border: 1px solid rgba(0,200,83,0.3);
  color: var(--green);
  font-size: 0.72rem; font-weight: 700;
  padding: 2px 8px; border-radius: 6px;
}

/* Heat bar */
.heat-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.73rem; color: var(--text-3);
}
.heat-score { color: var(--gold); font-weight: 700; display: flex; align-items: center; gap: 3px; }
.heat-track {
  flex: 1; height: 3px; background: var(--border);
  border-radius: 2px; overflow: hidden;
}
.heat-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--fire));
  border-radius: 2px;
  transition: width 1.2s ease;
}
.age-badge { margin-left: auto; font-size: 0.66rem; color: var(--text-3); }

/* Card description */
.card-desc {
  font-size: 0.78rem; color: var(--text-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Store info strip */
.store-strip {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.72rem; color: var(--text-3);
  padding-top: 2px; border-top: 1px solid var(--border);
  margin-top: auto;
}
.store-strip i { font-size: 0.65rem; }
.store-name { font-weight: 600; color: var(--text-2); }

/* Card footer */
.card-footer {
  padding: 11px 14px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px;
}
.btn-go {
  flex: 1;
  background: linear-gradient(135deg, var(--fire), #ff6b35);
  color: #fff; border: none;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.83rem; font-weight: 700;
  cursor: pointer; text-decoration: none;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-family: 'Inter', sans-serif;
  transition: var(--trans);
}
.btn-go:hover { filter: brightness(1.2); }

.btn-copy {
  background: var(--bg-raised); border: 1px solid var(--border-mid);
  color: var(--text-2); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 0.78rem;
  cursor: pointer; display: flex; align-items: center; gap: 4px;
  transition: var(--trans); font-family: 'Inter', sans-serif;
  white-space: nowrap;
}
.btn-copy:hover { border-color: var(--blue); color: var(--blue); }
.btn-copy.copied { border-color: var(--green); color: var(--green); }

/* ── LOAD MORE ─────────────────────────── */
.load-more-wrap { text-align: center; margin-top: 32px; }
.load-more-btn {
  background: var(--bg-raised); border: 1px solid var(--border-mid);
  color: var(--text-2); padding: 12px 32px;
  border-radius: 24px; font-size: 0.88rem; font-weight: 600;
  cursor: pointer; font-family: 'Inter', sans-serif;
  transition: var(--trans);
  display: inline-flex; align-items: center; gap: 8px;
}
.load-more-btn:hover { border-color: var(--fire); color: var(--fire); }

/* ── SKELETON ───────────────────────────── */
.skel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.skel-img { height: 180px; background: var(--bg-raised); }
.skel-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.skel-line {
  height: 11px; background: var(--bg-raised);
  border-radius: 4px; animation: shimmer 1.6s ease-in-out infinite;
}
.skel-line.w90 { width: 90%; }
.skel-line.w70 { width: 70%; }
.skel-line.w50 { width: 50%; }
.skel-line.w30 { width: 30%; }
@keyframes shimmer {
  0%,100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

/* ── EMPTY / ERROR STATES ───────────────── */
.state-box {
  grid-column: 1 / -1;
  text-align: center; padding: 60px 20px;
  color: var(--text-2);
}
.state-box .icon { font-size: 3rem; margin-bottom: 14px; }
.state-box h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--text); }
.state-box p  { font-size: 0.85rem; color: var(--text-3); max-width: 440px; margin: 0 auto; line-height: 1.6; }
.state-box .retry-btn {
  margin-top: 18px;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--fire); color: #fff; border: none;
  padding: 10px 24px; border-radius: 24px;
  font-size: 0.85rem; font-weight: 700;
  cursor: pointer; font-family: 'Inter', sans-serif;
}

/* ── TOAST ──────────────────────────────── */
.toast {
  position: fixed; bottom: 20px; right: 20px;
  background: var(--bg-raised); border: 1px solid var(--border-mid);
  border-left: 4px solid var(--green);
  color: var(--text); padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem; z-index: 9999;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  animation: toastIn 0.25s ease;
  max-width: 360px; line-height: 1.5;
}
.toast.warn  { border-left-color: var(--gold); }
.toast.error { border-left-color: #f44336; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── FOOTER ─────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 20px; text-align: center;
  font-size: 0.77rem; color: var(--text-3); line-height: 1.8;
}
.site-footer strong { color: var(--text-2); }
.disclaimer { font-size: 0.68rem; opacity: 0.7; margin-top: 4px; }

/* ── RESPONSIVE ─────────────────────────── */
@media (max-width: 720px) {
  .hero { padding: 36px 16px 36px; }
  .cards-grid { grid-template-columns: 1fr; }
  .stats-row { gap: 8px; }
  .stat-chip { min-width: 70px; padding: 8px 12px; }
  .stat-val { font-size: 1.1rem; }
  .hunt-btn { padding: 16px 40px; }
}
@media (max-width: 480px) {
  .hero-title { font-size: 1.7rem; }
  .source-badges { gap: 6px; }
  .src-badge { font-size: 0.68rem; padding: 4px 8px; }
}
