/* My Account Rewards styles. Wrapper .spar-rewards-dashboard added for higher specificity. */

.spar-rewards-dashboard .spar-tabs { margin-bottom: 25px; }
.spar-rewards-dashboard .spar-tabs-nav { display:grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap:8px; border-bottom:1px solid #e9ecef; margin-bottom:0; }
.spar-rewards-dashboard .spar-tab-nav { background:#f8f9fa; border:1px solid #e9ecef; border-bottom:none; padding:10px 12px; border-radius:8px 8px 0 0; cursor:pointer; color:#495057; font-weight:600; text-align:center; width:100%; display:block; }
.spar-rewards-dashboard .spar-tab-nav.is-active { background:#fff; color:#2c3e50; border-color:#e9ecef; box-shadow:0 -2px 6px rgba(0,0,0,.04); }
.spar-rewards-dashboard .spar-tabs-content { border:1px solid #e9ecef; border-radius:0 0 10px 10px; background:#fff; }
.spar-rewards-dashboard .spar-tab-panel { display:none; padding:20px; }
.spar-rewards-dashboard .spar-tab-panel.is-active { display:block; }

/* Mobile dropdown replacement (hidden by default, shown via media query) */
.spar-rewards-dashboard .spar-tabs-mobile { display:none; }
.spar-rewards-dashboard .spar-tabs-select {
  width: 100%;
  padding: 10px 36px 10px 12px;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  background-color: #fff;
  font-weight: 600;
  font-size: 20px;
  min-height: 55px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20fill%3D%22%236c757d%22%20d%3D%22M3%206h18v2H3V6zm0%205h18v2H3v-2zm0%205h18v2H3v-2z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  cursor: pointer;
  text-align: center;
  text-align-last: center;
}

body .page .spar-rewards-dashboard .spar-rewards-overview h2,
body .page .spar-rewards-dashboard .spar-overview-subtitle {
  color: #fff;
  margin: 0;
}

body .page .spar-rewards-dashboard h1,
body .page .spar-rewards-dashboard h2,
body .page .spar-rewards-dashboard h3,
body .page .spar-rewards-dashboard h4,
body .page .spar-rewards-dashboard h5,
body .page .spar-rewards-dashboard h6,
body .page .spar-rewards-dashboard p {
  margin: 0 revert revert revert;
}

body .page .spar-rewards-dashboard .spar-redeem-grid h4,
body .page .spar-rewards-dashboard .spar-redeem-grid p {
  margin: 0 0 10px 0;
}

.site-main .entry-content  .spar-rewards-dashboard ol li {
  padding-left: 10px;
}

.site-main .entry-content ul, .site-main .entry-content ol {
  margin-bottom: 0px;
}

body .page .spar-rewards-dashboard a.button {
  margin: 10px 0;
}

body .page .spar-rewards-dashboard .spar-redeem-grid p.spar-redemption-button {
  margin-bottom: 0px;
}

body .page .spar-rewards-dashboard .spar-level-title,
body .page .spar-rewards-dashboard .spar-current-level-title,
body .page .spar-rewards-dashboard p.spar-level-requirement,
body .page .spar-rewards-dashboard p.spar-current-level-sub,
body .page .spar-rewards-dashboard .spar-level-benefits-title {
  margin: 0 0 1px 0;
}

.spar-rewards-dashboard .spar-rewards-overview {
  background: linear-gradient(135deg, var(--spar-theme-color-1) 0%, var(--spar-theme-color-2) 100%);
  color: #fff;
  padding: 30px;
  border-radius: 12px;
  margin-bottom: 30px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
}
.spar-rewards-dashboard .spar-rewards-overview h2 {
  margin: 0 0 10px 0;
  font-size: 32px;
  font-weight: 700;
  color: #fff;
}
.spar-rewards-dashboard .spar-overview-subtitle { opacity:.9; margin:0;color:#fff; }
.spar-rewards-dashboard .spar-font-24 { font-size:24px; }
.spar-rewards-dashboard .spar-mr-8 { margin-right:8px; }
.spar-rewards-dashboard .spar-mb-15 { margin-bottom:15px; }
.spar-rewards-dashboard .spar-flex-center-gap12 { display:flex; align-items:center; gap:12px; }
.spar-rewards-dashboard .spar-text-right { text-align:right; }
.spar-rewards-dashboard .spar-rewards-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.spar-rewards-dashboard .spar-rewards-stat {
  background: rgba(255,255,255,.15);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.2);
}
.spar-rewards-dashboard .spar-rewards-stat-number {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
  display: block;
}
.spar-rewards-dashboard .spar-rewards-stat-label {
  font-size: 14px;
  opacity: .9;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.spar-rewards-dashboard .spar-rewards-stat-sublabel {
  font-size: 12px;
  opacity: .7;
  margin-top: 4px;
}

.spar-rewards-dashboard .spar-section {
  background: #fff;
  border-radius: 10px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  border: 1px solid #e9ecef;
}
.spar-rewards-dashboard .spar-section h3 {
  margin: 0 0 20px 0;
  color: #2c3e50;
  font-size: 20px;
  font-weight: 600;
  border-bottom: 2px solid #f8f9fa;
  padding-bottom: 10px;
}

/* Current level card */
.spar-current-level-card { border:1px solid #e9ecef; border-radius:10px; box-shadow:0 2px 10px rgba(0,0,0,.05); padding:15px 18px; }
.spar-current-level-top { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.spar-current-level-icon { width:36px; height:36px; font-size:28px; display:flex; align-items:center; justify-content:center; }
.spar-current-level-title { margin:0; font-size:18px; line-height:1.2; color:#2c3e50; }
.spar-current-level-sub { margin:2px 0 0 0; color:#6c757d; font-size:12px; }
.spar-level-chip { background:#f1f3f4; border:1px solid #e1e5e9; border-radius:999px; padding:6px 10px; font-size:12px; font-weight:600; color:#495057; display:inline-block; }
.spar-current-level-desc { margin:10px 0 0 0; color:#495057; }

/* Progress */
.spar-progress-wrap { margin-top:12px; }
.spar-progress-header { display:flex; justify-content:space-between; align-items:center; font-size:12px; color:#6c757d; }
.spar-progress-title { font-weight:600; }
.spar-progress-percent { font-weight:600; }
.spar-level-progress-bar { background:#e9ecef; border-radius:10px; height:20px; margin:8px 0; overflow:hidden; }
.spar-level-progress-fill { background: linear-gradient(90deg, var(--spar-theme-color-1), var(--spar-theme-color-2)); height:100%; transition: width .35s ease; }
.spar-progress-footer { display:flex; justify-content:space-between; color:#6c757d; font-size:12px; }
.spar-level-max { text-align:center; color:#007cba; font-weight:600; margin:8px 0; font-size:12px; }

/* All levels grid */
.spar-all-levels-title { display:flex; align-items:center; gap:8px; margin:10px 0 12px 0; font-size:16px; }
.spar-levels-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap:16px; }
.spar-level-card { border:1px solid #e9ecef; border-radius:10px; padding:14px; position:relative; background:#fff; transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease; }
.spar-level-card.is-current { border-color:#007cba; box-shadow: 0 4px 16px rgba(0,124,186,.15); }
.spar-level-card.is-locked { opacity:.7; }
.spar-level-card .spar-badge-current { position:absolute; top:10px; right:10px; background:#007cba; color:#fff; font-size:11px; padding:4px 8px; border-radius:999px; }
.spar-level-card .spar-badge-check { position:absolute; top:8px; right:10px; color:#28a745; font-size:16px; }
.spar-level-title { margin:0; font-size:16px; }
.spar-level-title.is-current { color:#007cba; }
.spar-level-requirement { margin:2px 0 0 0; font-size:12px; color:#6c757d; }
.spar-level-benefits { margin-top:8px; }
.spar-level-benefits-title { margin:0 0 6px 0; font-size:12px; color:#6c757d; text-transform:uppercase; letter-spacing:.3px; }
.spar-level-benefits-title.is-current { color:#007cba; }
.spar-level-benefits-list { margin:0; padding-left:18px; font-size:12px; color:#495057; }

/* Empty levels */
.spar-empty-levels { text-align:center; padding:24px; border:1px dashed #e1e5e9; border-radius:10px; background:#f9fbfd; }
.spar-empty-icon { font-size:32px; margin-bottom:6px; }
.spar-empty-chip { display:inline-block; background:#eef3ff; border:1px solid #d7e1ff; color:#2952cc; padding:6px 10px; border-radius:999px; margin-top:10px; font-weight:600; font-size:12px; }

/* Table helpers */
.spar-table-scroll { overflow-x:auto; }
.spar-th-center { text-align:center; }
.spar-td-center { text-align:center; }

/* Pagination */
.spar-pagination { margin: 10px 0; text-align:center; }
.spar-pagination-controls { display:flex; justify-content:center; align-items:center; gap:5px; flex-wrap:wrap; }
.spar-pagination-btn { background:#fff; border:1px solid #ddd; color:#333; padding:8px 12px; border-radius:4px; cursor:pointer; font-size:14px; text-decoration:none; transition:all .2s ease; min-width:40px; display:inline-flex; align-items:center; justify-content:center; }
.spar-pagination-btn:hover:not([disabled]) { background:#f0f0f0; border-color:#999; transform:translateY(-1px); }
.spar-pagination-btn:active:not([disabled]) { transform:translateY(0); }
.spar-pagination-btn[disabled] { background:#f5f5f5; color:#999; cursor:not-allowed; opacity:.6; }
.spar-pagination-current { background:#007cba !important; color:#fff !important; border-color:#007cba !important; font-weight:600; }
.spar-pagination-current:hover { background:#005a87 !important; border-color:#005a87 !important; }
.spar-pagination-info { color:#666; font-size:14px; margin-bottom:10px; }
.spar-pagination-loading { display:none; margin-top:10px; color:#007cba; font-weight:500; }

/* Voucher success notice */
.spar-voucher-success-notice { background:#f6ffed; border:1px solid #b7eb8f; border-radius:8px; padding:16px; }
.spar-voucher-content h3 { margin:0 0 6px 0; color:#2c3e50; font-size:18px; }
.spar-voucher-code-container { display:flex; align-items:center; gap:8px; margin:8px 0; }
.spar-voucher-code { background:#fff; border:1px dashed #52c41a; color:#237804; padding:4px 8px; border-radius:4px; font-family:monospace; font-weight:700; }
.spar-copy-btn, .spar-apply-to-cart-btn, .spar-go-to-cart-btn { background:#007cba; color:#fff; border:none; border-radius:4px; padding:6px 10px; cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; gap:6px; }
.spar-copy-btn:hover, .spar-apply-to-cart-btn:hover, .spar-go-to-cart-btn:hover { background:#005a87; }
.spar-voucher-already-applied { color:#237804; font-weight:600; margin-right:auto; display:flex; align-items:center; gap:6px; }
.spar-voucher-actions { display:flex; align-items:center; gap:10px; margin-top:6px; }
.spar-success-icon, .spar-applied-icon { font-size:16px; }

.spar-inactivity-notice {
  background: #fffbe6;
  border: 1px solid #ffe58f;
  color: #8c6d1f;
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.spar-inactivity-icon {
  font-size: 20px;
  line-height: 1;
}

body .page .spar-inactivity-notice p {
  margin: 0;
  line-height: 1.5;
}

/* Ways to earn multiplier */
.spar-points-multiplier { color:#007cba; }

.spar-generate-coupon-button,
.spar-generate-coupon-btn {
  background: linear-gradient(135deg, var(--spar-theme-color-1) 0%, var(--spar-theme-color-2) 100%) !important;
  color: #fff !important;
  border: none !important;
}
.spar-generate-coupon-button:hover:not(:disabled),
.spar-generate-coupon-btn:hover:not(:disabled) {
  filter: brightness(1.03);
}
.spar-copy-button {
  background: linear-gradient(135deg, var(--spar-theme-color-1) 0%, var(--spar-theme-color-2) 100%) !important;
  color: #fff !important;
  border: none !important;
}
.spar-copy-button:hover {
  filter: brightness(1.03);
}
.spar-copy-button.spar-copy-success {
  background: linear-gradient(135deg, #28a745, #20c997) !important;
}

/* Empty state layout (Account dashboard): align icon and text inline */
.spar-tab-panel .spar-cart-empty-state-dash {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}
.spar-tab-panel .spar-cart-empty-icon {
  margin: 0; /* override vertical layout margins */
  line-height: 1;
}
.spar-tab-panel .spar-cart-empty-title {
  margin: 0;
}

body .page .spar-rewards-dashboard .spar-pd-heading.has-vouchers {
  margin-top: 50px;
}

@keyframes progressStripes {
  0% { background-position: 0 0; }
  100% { background-position: 20px 0; }
}

.spar-level-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,.15);
}
.spar-level-card:hover:not([style*="opacity: 0.7"]) {
  border-color: #007cba !important;
}

@media (max-width: 768px) {
  /* Hide button tabs; show dropdown */
  .spar-rewards-dashboard .spar-tabs-nav { display:none; }
  .spar-rewards-dashboard .spar-tabs-mobile { display:block; margin-bottom:12px; }
  .spar-rewards-dashboard .spar-tabs-select { background-color:#f8f9fa; }
  .spar-rewards-dashboard .spar-rewards-overview { padding: 20px; }
  .spar-rewards-dashboard .spar-rewards-stats { grid-template-columns: 1fr; gap: 15px; }
  .spar-rewards-dashboard .spar-rewards-stat-number { font-size: 24px; }
  .spar-rewards-dashboard .spar-section { padding: 20px; margin-bottom: 20px; }
  .spar-rewards-dashboard .spar-all-levels-title { font-size:15px; }
  .spar-rewards-dashboard .spar-levels-grid { grid-template-columns: 1fr !important; }
  .spar-rewards-dashboard .spar-points-log { margin: 0; }
  .spar-rewards-dashboard .spar-points-log thead { display: none; }
  .spar-rewards-dashboard .spar-points-log tbody tr {
    display: block;
    background: #f8f9fa;
    margin-bottom: 10px;
    border-radius: 6px;
    padding: 15px;
    border: 1px solid #dee2e6 !important;
  }
  .spar-rewards-dashboard .spar-points-log tbody td {
    display: block !important;
    text-align: center !important;
    padding: 5px 0 !important;
    border: none !important;
  }
  .spar-rewards-dashboard .spar-points-log tbody button {
    display: block;
    width: 100%;
    margin-top: 10px;
    float: none;
    text-align: center;
  }
  /* Timeline responsive overrides */
  .spar-history-timeline::before {
    left: 14px;
  }
  .spar-tl-dot {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    font-size: 13px;
  }
  .spar-tl-card {
    padding: 8px 10px;
  }
  .spar-tl-title {
    font-size: 12px;
  }
  .spar-tl-date-sep {
    padding-left: 38px;
  }
  .spar-rewards-dashboard .spar-levels-grid { grid-template-columns: 1fr !important; }
  
}

/* Birthday date input width */
#spar-birthday-date {
  margin: 5px 0px 1px 0px;
  width: 190px;
}

/* ============================================================
   Terms and Conditions link bar
   ============================================================ */
.spar-terms-bar {
  text-align: center;
  padding: 14px 20px 6px;
}

.spar-terms-link {
  font-size: 13px;
  color: var(--spar-theme-accent-color, #2ca58d);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.2s;
}

.spar-terms-link:hover,
.spar-terms-link:focus {
  color: var(--spar-theme-accent-color, #2ca58d);
  opacity: 0.8;
  text-decoration: underline;
  outline: none;
}

/* ============================================================
   Terms and Conditions Modal
   ============================================================ */
.spar-terms-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  align-items: center;
  justify-content: center;
}

.spar-terms-modal.is-open {
  display: flex;
}

.spar-terms-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.spar-terms-modal-dialog {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
  width: 90%;
  max-width: 640px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.spar-terms-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid #e9ecef;
  flex-shrink: 0;
}

.spar-terms-modal-title {
  margin: 0 !important;
  font-size: 17px !important;
  font-weight: 700 !important;
  color: #2c3e50 !important;
}

.spar-terms-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #6c757d;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.2s;
  flex-shrink: 0;
}

.spar-terms-modal-close:hover,
.spar-terms-modal-close:focus {
  color: #2c3e50;
  outline: none;
}

.spar-terms-modal-body {
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1 1 auto;
  font-size: 14px;
  line-height: 1.7;
  color: #495057;
}

.spar-terms-modal-body h3,
.spar-terms-modal-body h4 {
  color: #2c3e50 !important;
  margin-top: 18px !important;
  margin-bottom: 6px !important;
}

.spar-terms-modal-body h3:first-child {
  margin-top: 0 !important;
}

.spar-terms-modal-body p {
  margin-bottom: 10px !important;
}

.spar-terms-modal-body em {
  font-size: 12px;
  color: #868e96;
}

/* Dark mode support */
.spar-dashboard--dark .spar-terms-link {
  color: rgba(255, 255, 255, 0.55);
}

.spar-dashboard--dark .spar-terms-link:hover,
.spar-dashboard--dark .spar-terms-link:focus {
  color: #fff;
}

@media (max-width: 600px) {
  .spar-terms-modal-dialog {
    width: 95%;
    max-height: 92vh;
    border-radius: 10px;
  }
}