/* HRM Protein Flyer Tracker - Mobile-First Dark Mode Styles */

:root {
  --bg-primary: #090d16;
  --bg-secondary: #111827;
  --bg-card: #161f33;
  --bg-card-hover: #1c2740;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(244, 63, 94, 0.55);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-red: #f43f5e;
  --accent-red-soft: rgba(244, 63, 94, 0.16);
  --accent-emerald: #10b981;
  --accent-emerald-soft: rgba(16, 185, 129, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Horizontal pill scrollbars on mobile */
.pill-scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
  -webkit-overflow-scrolling: touch;
}

.pill-scroll::-webkit-scrollbar {
  height: 4px;
}

.pill-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
}

/* Filter Pill Buttons */
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.16s ease;
}

.filter-pill:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
  background: #1a2438;
}

.filter-pill.active {
  background: var(--accent-red-soft);
  color: #fda4af;
  border-color: var(--border-active);
  box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.25);
}

.filter-pill .pill-count {
  font-size: 0.7rem;
  padding: 0.08rem 0.42rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
}

.filter-pill.active .pill-count {
  background: rgba(244, 63, 94, 0.28);
  color: #ffe4e6;
}

/* Deal Cards Grid */
.deals-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

@media (min-width: 640px) {
  .deals-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .deals-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Individual Deal Card */
.deal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 0.9rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.deal-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
}

.deal-card.best-value {
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 4px 20px -4px rgba(16, 185, 129, 0.15);
}

.deal-card.selected-card {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35);
}

/* Normalized Price Box */
.norm-price-box {
  background: rgba(9, 13, 22, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.65rem;
  padding: 0.65rem 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.deal-thumb {
  width: 60px;
  height: 60px;
  border-radius: 0.6rem;
  object-fit: cover;
  background: #0d1322;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.deal-thumb-placeholder {
  width: 60px;
  height: 60px;
  border-radius: 0.6rem;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
  flex-shrink: 0;
}

/* Tag Badges */
.tag-chip {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.5rem;
  border-radius: 0.35rem;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.best-deal-ribbon {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  background: var(--accent-emerald-soft);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.low-price-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  background: rgba(244, 63, 94, 0.18);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.4);
}
