/*
 * nv-club.css — the digital stamp card.
 *
 * Plain CSS rather than Tailwind utilities: the same card is drawn on the
 * dashboard (the owner's preview, the member modal, «باشگاه من») and on the
 * public card page, which ships its own small stylesheet stack. One file both
 * can link keeps the card identical everywhere.
 */

.nv-club-card {
  --c1: #7c3aed;
  --c2: #4338ca;
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  padding: 1.1rem 1.15rem 1rem;
  color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--c2) 70%, transparent);
  isolation: isolate;
}

.nv-club-card::before,
.nv-club-card::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  z-index: -1;
}
.nv-club-card::before { width: 11rem; height: 11rem; inset-inline-start: -3.5rem; top: -4.5rem; }
.nv-club-card::after { width: 7rem; height: 7rem; inset-inline-end: -2rem; bottom: -3rem; }

.nv-club-card--violet  { --c1: #8b5cf6; --c2: #4338ca; }
.nv-club-card--amber   { --c1: #f59e0b; --c2: #c2410c; }
.nv-club-card--emerald { --c1: #10b981; --c2: #0f766e; }
.nv-club-card--rose    { --c1: #f43f5e; --c2: #be185d; }
.nv-club-card--sky     { --c1: #0ea5e9; --c2: #1d4ed8; }
.nv-club-card--slate   { --c1: #64748b; --c2: #1e293b; }

.nv-club-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.nv-club-card__brand { font-weight: 800; font-size: 1.05rem; line-height: 1.4; }
.nv-club-card__kicker { font-size: 0.72rem; opacity: 0.8; margin-top: 0.1rem; }

.nv-club-card__count {
  flex-shrink: 0;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
  white-space: nowrap;
}

.nv-club-card__slots {
  display: grid;
  /* Capped, so a card drawn wide on a desktop keeps stamp-sized stamps
     instead of five dinner plates. */
  grid-template-columns: repeat(5, minmax(0, 3.4rem));
  justify-content: space-between;
  gap: 0.5rem;
  margin: 1rem 0 0.9rem;
}
.nv-club-card__slots--wide {
  grid-template-columns: repeat(auto-fill, minmax(2.1rem, 2.6rem));
  justify-content: start;
}

.nv-club-slot {
  aspect-ratio: 1;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  border: 2px dashed rgba(255, 255, 255, 0.45);
  color: rgba(255, 255, 255, 0.55);
  transition: transform 0.25s ease, background-color 0.25s ease;
}
.nv-club-slot.is-filled {
  border: 2px solid #fff;
  background: #fff;
  color: var(--c2);
  box-shadow: 0 3px 10px -3px rgba(0, 0, 0, 0.35);
}
.nv-club-slot.is-gift { border-style: solid; border-color: rgba(255, 255, 255, 0.85); color: #fff; }
.nv-club-slot.is-gift.is-filled { color: var(--c2); }
.nv-club-slot.is-pop { animation: nv-club-pop 0.45s ease; }

@keyframes nv-club-pop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.nv-club-card__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.78rem;
}
.nv-club-card__reward { opacity: 0.95; line-height: 1.6; }
.nv-club-card__reward b { font-weight: 800; }
.nv-club-card__code {
  direction: ltr;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.18em;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.15rem 0.5rem;
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.18);
  white-space: nowrap;
}

.nv-club-card.is-off { filter: grayscale(0.85); opacity: 0.7; }

/* ── the reward ticket under a card ─────────────────────────────────── */
.nv-club-ticket {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  border: 2px dashed color-mix(in srgb, currentColor 30%, transparent);
  background: color-mix(in srgb, #f59e0b 12%, transparent);
}
.nv-club-mono {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.15em;
  font-weight: 800;
}

.nv-club-ticket__code {
  direction: ltr;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 800;
  letter-spacing: 0.2em;
  font-size: 1.05rem;
}

/* ── colour swatches in the settings tab ────────────────────────────── */
.nv-club-swatch {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  outline: 3px solid transparent;
  outline-offset: 2px;
  transition: outline-color 0.15s ease, transform 0.15s ease;
}
.nv-club-swatch:hover { transform: scale(1.06); }
.nv-club-swatch.is-on { outline-color: var(--c1); }

/* ── the 14-day activity bars ───────────────────────────────────────── */
.nv-club-bars {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  align-items: end;
  gap: 0.35rem;
  height: 8.5rem;
}
.nv-club-bar {
  position: relative;
  min-height: 4px;
  border-radius: 0.45rem 0.45rem 0.2rem 0.2rem;
  background: color-mix(in srgb, var(--color-primary, #6d28d9) 78%, transparent);
  transition: height 0.4s ease;
}
.nv-club-bar.is-zero { background: color-mix(in srgb, currentColor 12%, transparent); }
.nv-club-bar:hover { background: var(--color-primary, #6d28d9); }

/* ── a push-notification mock, for the campaign preview ─────────────── */
.nv-push-mock {
  border-radius: 1.1rem;
  padding: 0.8rem 0.95rem;
  background: #1f2937;
  color: #f9fafb;
  box-shadow: 0 12px 26px -12px rgba(0, 0, 0, 0.55);
}
.nv-push-mock__app { font-size: 0.7rem; opacity: 0.6; margin-bottom: 0.3rem; }
.nv-push-mock__title { font-weight: 800; font-size: 0.9rem; margin-bottom: 0.15rem; }
.nv-push-mock__body { font-size: 0.8rem; line-height: 1.7; opacity: 0.9; white-space: pre-line; }

/* Member file avatar: the card's own colours, so the modal reads as that card. */
.nv-member-avatar { background: linear-gradient(135deg, var(--c1, #8b5cf6), var(--c2, #4338ca)); }
.nv-member-avatar--violet  { --c1: #8b5cf6; --c2: #4338ca; }
.nv-member-avatar--amber   { --c1: #f59e0b; --c2: #c2410c; }
.nv-member-avatar--emerald { --c1: #10b981; --c2: #0f766e; }
.nv-member-avatar--rose    { --c1: #f43f5e; --c2: #be185d; }
.nv-member-avatar--sky     { --c1: #0ea5e9; --c2: #1d4ed8; }
.nv-member-avatar--slate   { --c1: #64748b; --c2: #1e293b; }


/* ──────────────────────────────────────────────────────────────────────────
   The stamp button
   ──────────────────────────────────────────────────────────────────────────

   Pressing this is the most repeated action in the shop — once per customer,
   all day, usually by someone holding a coffee — so it gets the press
   feedback a physical rubber stamp would give: squash, overshoot, and a ring
   of ink spreading from the middle. A completed card adds sparks and a longer
   settle, because filling a card is the thing worth noticing.

   The two states are driven by `member.pop` in 72-club.js ('one' | 'full'),
   set only once the server has confirmed the stamp, and cleared on a timer so
   a second tap can replay the keyframes.

   Plain CSS, like the card above, so the same button can be dropped anywhere
   without depending on a Tailwind rebuild. */

.nv-stamp {
  position: relative;
  /* visible, not hidden: the sparks of a completed card are supposed to leave
     the button. The ripple below stays inside on its own because it is an
     inset element inheriting the radius. */
  overflow: visible;
  transition: transform .12s ease, box-shadow .12s ease;
}

.nv-stamp:active:not(:disabled) { transform: scale(.93); }

/* Both layers live on one element: `::before` is the ink ring, `::after` is
   the spark ring. One extra node per button instead of eight. */
.nv-stamp__burst {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
}
.nv-stamp__burst::before,
.nv-stamp__burst::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  opacity: 0;
}

/* ink ring — fills the button from the centre out */
.nv-stamp__burst::before {
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%,
              rgba(255, 255, 255, .55) 0%,
              rgba(255, 255, 255, .22) 45%,
              rgba(255, 255, 255, 0) 70%);
  transform: scale(.2);
}

/* sparks — one element, six box-shadows, thrown outward together */
.nv-stamp__burst::after {
  top: 50%;
  inset-inline-start: 50%;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  background: #fff;
  box-shadow:
      0    -16px 0 0 #fde68a,
     14px  -9px  0 0 #fff,
     14px   9px  0 0 #fde68a,
      0     16px 0 0 #fff,
    -14px   9px  0 0 #fde68a,
    -14px  -9px  0 0 #fff;
  transform: scale(0);
}

/* ── one stamp ─────────────────────────────────────────────────────────── */
.nv-stamp.is-pop { animation: nv-stamp-press .42s cubic-bezier(.34, 1.56, .64, 1); }
.nv-stamp.is-pop .nv-stamp__burst::before { animation: nv-stamp-ink .45s ease-out; }

/* ── card completed ────────────────────────────────────────────────────── */
.nv-stamp.is-full { animation: nv-stamp-full .95s cubic-bezier(.34, 1.56, .64, 1); }
.nv-stamp.is-full .nv-stamp__burst::before { animation: nv-stamp-ink .5s ease-out; }
.nv-stamp.is-full .nv-stamp__burst::after  { animation: nv-stamp-spark .8s ease-out .08s; }

@keyframes nv-stamp-press {
    0%   { transform: scale(1); }
   22%   { transform: scale(.86); }
   55%   { transform: scale(1.07); }
  100%   { transform: scale(1); }
}

@keyframes nv-stamp-full {
    0%   { transform: scale(1)    rotate(0deg); }
   18%   { transform: scale(.84)  rotate(-3deg); }
   45%   { transform: scale(1.12) rotate(2deg); }
   70%   { transform: scale(.98)  rotate(-1deg); }
  100%   { transform: scale(1)    rotate(0deg); }
}

@keyframes nv-stamp-ink {
    0%   { opacity: 1; transform: scale(.2); }
  100%   { opacity: 0; transform: scale(1.5); }
}

@keyframes nv-stamp-spark {
    0%   { opacity: 0;   transform: scale(0); }
   18%   { opacity: 1;   transform: scale(.75); }
  100%   { opacity: 0;   transform: scale(2.1); }
}

/* A shop assistant who asked the OS for less motion still needs to know the
   tap registered, so the colour flash stays and the movement goes. */
@media (prefers-reduced-motion: reduce) {
  .nv-stamp,
  .nv-stamp.is-pop,
  .nv-stamp.is-full { animation: none; transition: none; }
  .nv-stamp:active:not(:disabled) { transform: none; }
  .nv-stamp.is-pop  .nv-stamp__burst::before,
  .nv-stamp.is-full .nv-stamp__burst::before { animation: nv-stamp-flash .4s ease-out; }
  .nv-stamp .nv-stamp__burst::after { display: none; }
}
@keyframes nv-stamp-flash {
    0%   { opacity: 1; transform: scale(1); }
  100%   { opacity: 0; transform: scale(1); }
}
