/* css/rewards.css */
:root {
  --rewards-bg: #080b12;
  --rewards-surface: rgba(255,255,255,0.03);
  --rewards-border: rgba(255,255,255,0.07);
  --rewards-text: #eef2ff;
  --rewards-muted: rgba(238,242,255,0.4);
  --rewards-accent-blue: #4f8fff;
  --rewards-accent-purple: #9b7bff;
  --rewards-accent-gold: #f5b944;
  --rewards-glow-blue: rgba(79,143,255,0.18);
  --rewards-glow-purple: rgba(155,123,255,0.18);
  --rewards-radius-card: 20px;
  --rewards-radius-btn: 12px;
  --rewards-font-display: 'Syne', sans-serif;
  --rewards-font-body: 'DM Sans', sans-serif;
}

.rewards-page {
  min-height: 100vh;
  background: var(--rewards-bg);
  color: var(--rewards-text);
  font-family: var(--rewards-font-body);
  position: relative;
  overflow-x: hidden;
}

.rewards-page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 80%, var(--rewards-glow-blue) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, var(--rewards-glow-purple) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

.rewards-page::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.02"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.02"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.01"/><circle cx="10" cy="50" r="0.5" fill="white" opacity="0.01"/><circle cx="90" cy="50" r="0.5" fill="white" opacity="0.01"/><circle cx="50" cy="90" r="0.5" fill="white" opacity="0.01"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  pointer-events: none;
  z-index: -1;
}

/* Header */
.rewards-points-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 16px;
}

.rewards-points-icon {
  font-size: 18px;
}

.rewards-points-num {
  color: var(--rewards-accent-gold);
}

/* Body */
.rewards-body {
  padding: 20px;
  max-width: 600px;
  margin: 0 auto;
}

/* Balance card */
.rewards-balance-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.05));
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 34px;
  padding: 28px 28px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
  backdrop-filter: blur(18px);
  box-shadow: 0 26px 70px rgba(0,0,0,0.22);
}

.rewards-balance-icon {
  font-size: 56px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(245,185,68,0.13);
}

.rewards-balance-text {
  flex: 1;
}

.rewards-balance-label {
  font-size: 14px;
  color: var(--rewards-muted);
  margin-bottom: 4px;
}

.rewards-balance-num {
  font-size: 32px;
  font-weight: 700;
  color: var(--rewards-accent-gold);
  font-family: var(--rewards-font-display);
}

/* Tier card */
.rewards-tier-card {
  background: rgba(16, 22, 42, 0.88);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 28px;
  padding: 22px;
  margin-bottom: 28px;
  backdrop-filter: blur(20px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.24);
}

.rewards-tier-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.rewards-tier-label {
  color: var(--rewards-muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 6px;
}

.rewards-tier-current {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.rewards-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  background: rgba(255,255,255,0.05);
}

.rewards-tier-track {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.rewards-tier-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  border-radius: 22px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
  transition: transform 0.2s ease, background 0.2s ease;
}

.rewards-tier-step.current {
  background: rgba(79,143,255,0.14);
  border-color: rgba(79,143,255,0.35);
  transform: translateY(-2px);
}

.rewards-tier-step.completed {
  background: rgba(245,185,68,0.16);
}

.rewards-tier-step.locked {
  opacity: 0.55;
}

.rewards-tier-step-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 18px;
}

.rewards-tier-step-title {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: #e5e7eb;
}

.rewards-tier-progress-wrap {
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
  margin-bottom: 12px;
}

.rewards-tier-progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.rewards-tier-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--rewards-muted);
  font-size: 13px;
}

/* Sections */
.rewards-section {
  margin-bottom: 32px;
}

.rewards-section-header {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Earn grid */
.rewards-earn-grid {
  display: grid;
  gap: 12px;
}

.rewards-earn-item {
  background: var(--rewards-surface);
  border: 1px solid var(--rewards-border);
  border-radius: var(--rewards-radius-card);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.rewards-earn-icon {
  font-size: 24px;
  width: 40px;
  text-align: center;
}

.rewards-earn-text {
  flex: 1;
}

.rewards-earn-action {
  font-weight: 500;
  margin-bottom: 2px;
}

.rewards-earn-points {
  font-size: 14px;
  color: var(--rewards-accent-gold);
  font-weight: 600;
}

/* Redeem grid */
.rewards-redeem-grid {
  display: grid;
  gap: 16px;
}

.rewards-redeem-card {
  background: var(--rewards-surface);
  border: 1px solid var(--rewards-border);
  border-radius: var(--rewards-radius-card);
  padding: 20px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.rewards-redeem-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.rewards-redeem-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.rewards-redeem-desc {
  color: var(--rewards-muted);
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.4;
}

.rewards-redeem-cost {
  font-size: 16px;
  font-weight: 600;
  color: var(--rewards-accent-gold);
  margin-bottom: 16px;
}

.rewards-redeem-btn {
  background: linear-gradient(135deg, var(--rewards-accent-blue), var(--rewards-accent-purple));
  color: white;
  border: none;
  border-radius: var(--rewards-radius-btn);
  padding: 12px 24px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.rewards-redeem-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79,143,255,0.3);
}

/* History */
.rewards-history-item {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.12);
}

.rewards-history-icon {
  font-size: 20px;
  width: 32px;
  text-align: center;
}

.rewards-history-text {
  flex: 1;
}

.rewards-history-desc {
  font-weight: 500;
  margin-bottom: 2px;
}

.rewards-history-date {
  font-size: 12px;
  color: var(--rewards-muted);
}

.rewards-history-points {
  font-weight: 600;
  color: var(--rewards-accent-gold);
}

/* Loading/Empty states */
.rewards-loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--rewards-muted);
}

.rewards-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--rewards-border);
  border-top: 2px solid var(--rewards-accent-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.rewards-empty,
.rewards-error {
  text-align: center;
  padding: 40px 20px;
  color: var(--rewards-muted);
}

.rewards-empty span,
.rewards-error span {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
}

/* Responsive */
@media (max-width: 480px) {
  .rewards-body {
    padding: 16px;
  }

  .rewards-balance-card {
    padding: 20px;
  }

  .rewards-balance-num {
    font-size: 28px;
  }

  .rewards-earn-item,
  .rewards-redeem-card {
    padding: 16px;
  }
}