/**
 * HappyPreggie Gamification & Exploration Points Stylesheet (hp-points.css)
 * High-performance, celebratory micro-animations, floating coin badges,
 * sticky guest exploration wallet pill, and responsive modal sheet.
 */

/* =========================================================================
   0. Feminine Pink Diamond / Amethyst Points Gemstone Icon
   ========================================================================= */
.hp-gem-icon {
  display: inline-block;
  line-height: 1;
  filter: hue-rotate(130deg) saturate(1.45) brightness(1.05);
  vertical-align: -0.06em;
  font-style: normal;
}

/* =========================================================================
   1. Floating Coin Micro-Animation
   ========================================================================= */
.hp-floating-coin {
  position: fixed;
  z-index: 100000;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 50%, #f5d0fe 100%);
  border: 1.5px solid #f472b6;
  border-radius: 9999px;
  box-shadow: 0 10px 25px rgba(236, 72, 153, 0.35), 0 4px 10px rgba(0, 0, 0, 0.08);
  font-family: var(--hp-font-ui, 'Nunito', -apple-system, sans-serif);
  font-size: 0.92rem;
  font-weight: 800;
  color: #9d174d;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  will-change: transform, opacity;
  animation: hpCoinPopIn 0.32s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.hp-floating-coin__icon {
  font-size: 1.15rem;
  line-height: 1;
  display: inline-block;
  animation: hpCoinSpin 0.7s ease-out;
}

.hp-floating-coin__points,
.hp-floating-coin__text {
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #831843;
}

.hp-floating-coin__sep {
  color: #be185d;
  opacity: 0.65;
  font-size: 0.85rem;
  line-height: 1;
  margin: 0 1px;
}

.hp-floating-coin__label {
  font-weight: 700;
  font-size: 0.85rem;
  color: #9d174d;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

@keyframes hpCoinPopIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.65);
  }
  70% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Retained for backward-compatibility & pure CSS fallback */
@keyframes hpCoinFloatUp {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.6);
  }
  18% {
    opacity: 1;
    transform: translateY(-4px) scale(1.18);
  }
  35% {
    transform: translateY(-16px) scale(1);
  }
  75% {
    opacity: 1;
    transform: translateY(-38px) scale(0.98);
  }
  100% {
    opacity: 0;
    transform: translateY(-58px) scale(0.85);
  }
}

@keyframes hpCoinSpin {
  0% {
    transform: rotateY(0deg) scale(0.8);
  }
  50% {
    transform: rotateY(180deg) scale(1.2);
  }
  100% {
    transform: rotateY(360deg) scale(1);
  }
}

/* =========================================================================
   2. Nav Header Points Counter Live Bump
   ========================================================================= */
.hp-points-counter-bump {
  display: inline-block;
  animation: hpPointsCounterBump 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  color: #ec4899 !important;
  font-weight: 800 !important;
  text-shadow: 0 0 12px rgba(236, 72, 153, 0.55);
}

@keyframes hpPointsCounterBump {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.28);
  }
  70% {
    transform: scale(0.94);
  }
  100% {
    transform: scale(1);
  }
}

/* =========================================================================
   3. Floating Guest Exploration Wallet Pill
   ========================================================================= */
.hp-guest-points-pill {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9990;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.96);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(253, 242, 248, 0.94) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid #fbcfe8;
  border-radius: 9999px;
  box-shadow: 0 10px 28px rgba(69, 33, 179, 0.12), 0 4px 14px rgba(236, 72, 153, 0.2);
  font-family: var(--hp-font-ui, 'Nunito', -apple-system, sans-serif);
  font-size: 0.9rem;
  color: var(--hp-text-primary, #1e293b);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.25s ease, border-color 0.2s ease, padding 0.25s ease, opacity 0.25s ease;
  user-select: none;
}

.hp-guest-points-pill:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 32px rgba(69, 33, 179, 0.16), 0 6px 18px rgba(236, 72, 153, 0.28);
  border-color: #ec4899;
}

.hp-guest-points-pill__badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background: #fdf2f8;
  border: 1px solid #fbcfe8;
  border-radius: 9999px;
  font-weight: 800;
  color: #be185d;
  font-size: 0.88rem;
  transition: background 0.2s ease, padding 0.2s ease;
}

.hp-guest-points-pill__badge-coin {
  font-size: 1rem;
}

.hp-guest-points-pill.is-minimized {
  padding: 6px 12px;
  gap: 0;
  background: rgba(255, 255, 255, 0.95);
  border-color: #f472b6;
  box-shadow: 0 4px 18px rgba(236, 72, 153, 0.22), 0 2px 8px rgba(0, 0, 0, 0.06);
  transform: translateX(0);
}

.hp-guest-points-pill.is-minimized .hp-guest-points-pill__info,
.hp-guest-points-pill.is-minimized .hp-guest-points-pill__action,
.hp-guest-points-pill.is-minimized .hp-guest-points-pill__mute-btn,
.hp-guest-points-pill.is-minimized .hp-guest-points-pill__close-btn {
  display: none !important;
}

.hp-guest-points-pill.is-minimized .hp-guest-points-pill__badge {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 0.92rem;
  color: #be185d;
}

.hp-guest-points-pill.is-expanded {
  animation: hpGuestPillPop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes hpGuestPillPop {
  0% {
    transform: scale(0.85);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.06);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.hp-guest-points-pill__info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
}

.hp-guest-points-pill__title {
  font-weight: 700;
  font-size: 0.82rem;
  color: #4521b3;
}

.hp-guest-points-pill__timer {
  font-size: 0.72rem;
  font-weight: 600;
  color: #b45309;
}

.hp-guest-points-pill__action {
  font-weight: 800;
  font-size: 0.8rem;
  color: #ffffff;
  background: linear-gradient(135deg, #7c3aed, #4521b3);
  padding: 4px 10px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hp-guest-points-pill__mute-btn,
.hp-guest-points-pill__close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 4px;
  margin-left: 2px;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.hp-guest-points-pill__mute-btn:hover,
.hp-guest-points-pill__close-btn:hover {
  color: #1e293b;
  background: rgba(0, 0, 0, 0.05);
}

/* Mobile viewport positioning above sticky mobile nav */
@media (max-width: 768px) {
  .hp-guest-points-pill {
    bottom: calc(var(--hp-mobile-nav-height, 68px) + 14px);
    right: 12px;
    padding: 6px 12px;
    gap: 8px;
  }
  .hp-guest-points-pill.is-minimized {
    padding: 5px 10px;
    right: 8px;
  }
  .hp-guest-points-pill__info {
    display: none; /* Keep pill compact on mobile */
  }
  .hp-guest-points-pill__action {
    padding: 3px 8px;
    font-size: 0.75rem;
  }
}

/* =========================================================================
   4. Guest Exploration Points Modal Dialog / Bottom Sheet
   ========================================================================= */
.hp-guest-points-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100010;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.hp-guest-points-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.hp-guest-points-modal {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  max-width: 440px;
  width: 100%;
  padding: 28px 24px;
  text-align: center;
  position: relative;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hp-guest-points-modal-backdrop.is-open .hp-guest-points-modal {
  transform: translateY(0) scale(1);
}

.hp-guest-points-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 1rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.hp-guest-points-modal__close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.hp-guest-points-modal__coin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 3px solid #f59e0b;
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.3);
  font-size: 2.25rem;
  margin: 0 auto 16px;
  animation: hpPulseGlow 2.5s infinite;
}

@keyframes hpPulseGlow {
  0%, 100% {
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.3);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 14px 35px rgba(245, 158, 11, 0.55);
    transform: scale(1.05);
  }
}

.hp-guest-points-modal__title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #330066;
  margin: 0 0 8px;
}

.hp-guest-points-modal__subtitle {
  font-size: 0.92rem;
  color: #64748b;
  line-height: 1.5;
  margin: 0 0 20px;
}

.hp-guest-points-modal__timer-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 20px;
}

.hp-guest-points-modal__benefits {
  text-align: left;
  background: #f8fafc;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 24px;
  font-size: 0.84rem;
  color: #334155;
  line-height: 1.5;
}

.hp-guest-points-modal__benefits li {
  margin-bottom: 6px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.hp-guest-points-modal__benefits li:last-child {
  margin-bottom: 0;
}

.hp-guest-points-modal__cta-btn {
  display: block;
  width: 100%;
  padding: 12px 18px;
  background: linear-gradient(135deg, #7c3aed 0%, #4521b3 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(69, 33, 179, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  margin-bottom: 12px;
}

.hp-guest-points-modal__cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(69, 33, 179, 0.45);
  color: #ffffff;
}

.hp-guest-points-modal__login-link {
  font-size: 0.86rem;
  color: #64748b;
  text-decoration: none;
}

.hp-guest-points-modal__login-link strong {
  color: #4521b3;
}

.hp-guest-points-modal__login-link:hover {
  text-decoration: underline;
}

/* =========================================================================
   5. Registration Form Exploration Reward Banner
   ========================================================================= */
.hp-guest-points-banner {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1.5px solid #f59e0b;
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.18);
  animation: hpBannerFadeIn 0.35s ease-out;
}

.hp-guest-points-banner__icon {
  font-size: 1.8rem;
  line-height: 1;
  flex-shrink: 0;
}

.hp-guest-points-banner__body {
  flex: 1;
  text-align: left;
}

.hp-guest-points-banner__title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #78350f;
  margin: 0 0 3px;
}

.hp-guest-points-banner__desc {
  font-size: 0.84rem;
  color: #92400e;
  line-height: 1.4;
  margin: 0;
}

@keyframes hpBannerFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
