/* ============================================================
   REWARDS PAGE — style.css
   Overrides shared.css for a scrollable, standalone awards page.
   ============================================================ */

/* ── Scrollable override (shared.css sets overflow:hidden) ── */
html, body {
  overflow: auto;
  height: auto;
  min-height: 100%;
}

/* ── Background — same iOS-safe fixed technique as homepage ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url('../assets/background/background-desktop.png');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

@media (max-width: 600px) {
  body::before {
    background-image: url('../assets/background/background-mobile.png');
  }
}

/* ── Header ─────────────────────────────────────────────── */
.rewards-header {
  padding: 16px 16px 8px;
  direction: rtl;
}

.rewards-back {
  display: inline-block;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: background 0.2s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.rewards-back:hover {
  background: rgba(255, 255, 255, 0.35);
}

.rewards-back:active {
  transform: scale(0.96);
}

.rewards-title {
  text-align: center;
  color: #fff;
  font-size: 2rem;
  font-family: 'Arial Rounded MT Bold', Arial, sans-serif;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  margin: 8px 0 4px;
  direction: rtl;
}

/* ── Progress Summary Bar ────────────────────────────────── */
.progress-summary {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  direction: rtl;
  font-family: 'Arial Rounded MT Bold', Arial, sans-serif;
}

.progress-summary span {
  white-space: nowrap;
}

@media (min-width: 601px) {
  .progress-summary {
    font-size: 1rem;
    gap: 32px;
  }
}

/* ── Main content area ───────────────────────────────────── */
.rewards-main {
  padding: 8px 0 40px;
}

/* ── Section titles ──────────────────────────────────────── */
.badges-section__title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  padding: 16px 16px 8px;
  direction: rtl;
  font-family: 'Arial Rounded MT Bold', Arial, sans-serif;
}

/* ── Badge grid: 2 cols mobile → 3 tablet → 4 desktop ───── */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0 12px 12px;
}

@media (min-width: 600px) {
  .badge-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding: 0 16px 16px;
  }
}

@media (min-width: 1024px) {
  .badge-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 0 24px 16px;
  }
}

/* ── Badge card base ─────────────────────────────────────── */
.badge-card {
  border-radius: 16px;
  padding: 16px 10px 14px;
  text-align: center;
  direction: rtl;
  font-family: 'Arial Rounded MT Bold', Arial, sans-serif;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  animation: card-pop 0.3s ease-out backwards;
}

.badge-card:active {
  transform: scale(0.95);
}

/* ── Earned card ─────────────────────────────────────────── */
.badge-card--earned {
  background: #fffbe6;
  border: 2px solid #f5c518;
  box-shadow: 0 3px 12px rgba(245, 197, 24, 0.25);
}

/* ── Locked card ─────────────────────────────────────────── */
.badge-card--locked {
  background: rgba(240, 240, 240, 0.85);
  border: 2px dashed #bbb;
}

/* ── Card icon ───────────────────────────────────────────── */
.badge-card__icon {
  font-size: 2.4rem;
  display: block;
  margin-bottom: 8px;
  line-height: 1;
}

.badge-card--locked .badge-card__icon {
  filter: grayscale(1);
  opacity: 0.45;
}

/* ── Card name ───────────────────────────────────────────── */
.badge-card__name {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #7a5c00;
  margin-bottom: 4px;
  line-height: 1.3;
}

.badge-card--locked .badge-card__name {
  color: #888;
}

/* ── Earned date ─────────────────────────────────────────── */
.badge-card__date {
  display: block;
  font-size: 0.7rem;
  color: #9a7200;
}

/* ── Locked hint ─────────────────────────────────────────── */
.badge-card__hint {
  display: block;
  font-size: 0.7rem;
  color: #666;
  margin-top: 4px;
  line-height: 1.3;
}

/* ── Stagger entry animation ─────────────────────────────── */
@keyframes card-pop {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .badge-card {
    animation: none;
  }
  .rewards-back:active,
  .badge-card:active {
    transform: none;
  }
}
