/* ═══════════════════════════════════════
   XP Bar + Discount Popup
   ═══════════════════════════════════════ */

/* Push floating buttons above XP bar */
.floating-action-btn.is-visible {
  bottom: 60px;
}

/* ── XP Bar — Fixed at bottom ── */
.xp-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1050;
  background: #1A1A1A;
  border-top: 1px solid rgba(190, 181, 168, 0.2);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-body, 'Switzer', sans-serif);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.5s ease;
}

.xp-bar--complete {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

/* Star icon */
.xp-bar__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #8B0000, #a52828);
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  line-height: 1;
}

/* Text area */
.xp-bar__info {
  flex: 1;
  min-width: 0;
}

.xp-bar__top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  gap: 10px;
}

.xp-bar__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.xp-bar__pct {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Progress track */
.xp-bar__track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.xp-bar__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #8B0000, #c0392b, #e74c3c);
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.xp-bar__fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
  border-radius: 0 3px 3px 0;
}

.xp-bar__fill--pulse {
  animation: xp-pulse 0.6s ease;
}

@keyframes xp-pulse {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.5); }
  100% { filter: brightness(1); }
}

/* Timer in bar */
.xp-bar__timer-wrap {
  flex-shrink: 0;
  text-align: right;
}

.xp-bar__timer-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 2px;
}

.xp-bar__timer {
  font-size: 13px;
  font-weight: 700;
  color: #e74c3c;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-body, 'Switzer', monospace);
  letter-spacing: 0.02em;
}

/* Show discount button (appears after 100%) */
.xp-bar__show-discount {
  display: none;
}

/* ── Discount Popup Overlay ── */
.xp-discount-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.xp-discount-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* Modal */
.xp-discount {
  background: #1A1A1A;
  border: 1px solid rgba(190, 181, 168, 0.3);
  border-radius: 16px;
  max-width: 440px;
  width: 100%;
  padding: 40px 32px 32px;
  text-align: center;
  position: relative;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.xp-discount-overlay.is-active .xp-discount {
  transform: scale(1) translateY(0);
}

/* Close button */
.xp-discount__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.6);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.xp-discount__close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Celebration icon */
.xp-discount__celebration {
  font-size: 48px;
  margin-bottom: 16px;
  line-height: 1;
}

/* Title */
.xp-discount__title {
  font-family: var(--font-display, 'Instrument Serif', serif);
  font-size: 28px;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.2;
}

/* Subtitle */
.xp-discount__subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Code box */
.xp-discount__code-wrap {
  background: rgba(139, 0, 0, 0.15);
  border: 2px dashed #8B0000;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.xp-discount__code-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 6px;
}

.xp-discount__code {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: #e74c3c;
  font-family: var(--font-body, 'Switzer', monospace);
}

/* Copy button */
.xp-discount__copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  background: #8B0000;
  border: none;
  border-radius: 100px;
  color: #fff;
  font-family: var(--font-body, 'Switzer', sans-serif);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  margin-bottom: 20px;
}

.xp-discount__copy-btn:hover {
  background: #a52828;
  transform: scale(1.03);
}

/* Instructions */
.xp-discount__instructions {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.xp-discount__instructions-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 8px;
}

.xp-discount__instructions-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
}

.xp-discount__instructions-text strong {
  color: #fff;
}

/* Timer */
.xp-discount__timer-wrap {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 16px;
}

.xp-discount__timer-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 6px;
}

.xp-discount__timer {
  font-size: 22px;
  font-weight: 700;
  color: #e74c3c;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-body, 'Switzer', monospace);
  letter-spacing: 0.04em;
}

.xp-discount__timer--expired {
  color: rgba(255, 255, 255, 0.4);
}

/* ── Tier 2: Share Section ── */
.xp-discount__share-tier {
  margin-top: 4px;
}

.xp-discount__share-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.xp-discount__share-divider::before,
.xp-discount__share-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.xp-discount__share-divider span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
}

.xp-discount__share-prompt {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.5;
  margin-bottom: 14px;
}

.xp-discount__share-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.xp-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--font-body, 'Switzer', sans-serif);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s, color 0.2s;
}

.xp-share-btn:hover {
  transform: scale(1.04);
  color: #fff;
}

.xp-share-btn--facebook:hover {
  background: rgba(24, 119, 242, 0.2);
  border-color: rgba(24, 119, 242, 0.5);
  color: #4599ff;
}

.xp-share-btn--x:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
}

.xp-share-btn--copy:hover {
  background: rgba(190, 181, 168, 0.15);
  border-color: rgba(190, 181, 168, 0.4);
  color: #BEB5A8;
}

.xp-share-btn--shared {
  border-color: rgba(46, 204, 113, 0.5) !important;
  background: rgba(46, 204, 113, 0.12) !important;
  color: #2ecc71 !important;
  pointer-events: none;
}

/* Tier 2 reveal */
.xp-discount__tier2 {
  margin-top: 4px;
  animation: tier2-reveal 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tier2-reveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.xp-discount__code-wrap--tier2 {
  background: rgba(46, 139, 87, 0.12);
  border-color: #2e8b57;
}

.xp-discount__code--tier2 {
  color: #3cb371 !important;
}

.xp-discount__copy-btn--tier2 {
  background: #2e8b57;
  margin-bottom: 4px;
}

.xp-discount__copy-btn--tier2:hover {
  background: #3cb371;
}

/* ── Mobile adjustments ── */
@media (max-width: 768px) {
  .xp-bar {
    padding: 8px 14px;
    gap: 10px;
  }

  .xp-bar__icon {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .xp-bar__label {
    font-size: 10px;
  }

  .xp-bar__pct {
    font-size: 11px;
  }

  .xp-bar__timer-label {
    font-size: 8px;
  }

  .xp-bar__timer {
    font-size: 11px;
  }

  .xp-discount {
    padding: 32px 20px 24px;
  }

  .xp-discount__title {
    font-size: 24px;
  }

  .xp-discount__code {
    font-size: 26px;
  }

  .xp-discount__timer {
    font-size: 18px;
  }

  .xp-share-btn {
    padding: 8px 12px;
    font-size: 11px;
  }

  .xp-discount__share-divider span {
    font-size: 10px;
  }

  .xp-discount__share-prompt {
    font-size: 12px;
  }

  .xp-discount__code--tier2 {
    font-size: 22px !important;
  }
}
