/* StoxCredit Stock Gift, premium pass (/gift, /gift/mine, /gift/claim).
   Presentation only: no contract, claim, refund, or split logic lives here.
   Colors are the existing tokens (white surfaces, brand blue, dark text, neutral borders). */

/* ---------- Remove the oversized decorative circle behind the preview ---------- */
#giftView .gift-preview::before { display: none; }

/* ---------- Layout: no extra bottom gap above the footer ---------- */
html[data-gift-route] body.app-mode #giftView.gift-shell { padding-bottom: 36px; }
@media (max-width: 720px) {
  html[data-gift-route] body.app-mode #giftView.gift-shell { padding-bottom: 28px; }
}

/* ---------- Gift box: flat layered blue and white, soft depth ---------- */
#giftView .gift-present {
  position: relative;
  width: 148px;
  height: 146px;
  margin: 10px auto 4px;
  filter: drop-shadow(0 12px 14px color-mix(in srgb, var(--sc-brand, #2456e0) 22%, transparent));
  animation: gift-float 5.5s ease-in-out infinite;
  transform-origin: 50% 90%;
}
#giftView .gift-present-body {
  position: absolute; left: 17%; top: 39%; width: 66%; height: 51%;
  border-radius: 6px 6px 12px 12px;
  background: var(--sc-brand, #2456e0);
  box-shadow: inset 0 -10px 0 color-mix(in srgb, #000 10%, transparent);
}
#giftView .gift-present-lid {
  position: absolute; z-index: 3; left: 12%; top: 28%; width: 76%; height: 21%;
  border-radius: 7px;
  background: color-mix(in srgb, var(--sc-brand, #2456e0) 78%, #fff);
  box-shadow: inset 0 -4px 0 color-mix(in srgb, #000 8%, transparent);
  transform-origin: 20% 100%;
  transition: transform .55s cubic-bezier(.22, 1, .36, 1);
}
#giftView .gift-present-ribbon {
  position: absolute; z-index: 4; left: 45%; top: 28%; width: 10%; height: 62%;
  background: #fff;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--sc-brand, #2456e0) 18%, transparent);
  pointer-events: none;
  transition: transform .5s ease;
}
#giftView .gift-present-bow { position: absolute; z-index: 5; top: 10%; left: 34%; width: 32%; height: 25%; transition: transform .55s cubic-bezier(.22, 1, .36, 1); }
#giftView .gift-present-bow::before, #giftView .gift-present-bow::after {
  content: ''; position: absolute; top: 2px; width: 52%; height: 75%;
  border: 3px solid var(--sc-brand, #2456e0); background: #fff;
  border-radius: 58% 58% 18% 58%; box-sizing: border-box;
}
#giftView .gift-present-bow::before { left: -2px; transform: rotate(-31deg); }
#giftView .gift-present-bow::after { right: -2px; transform: scaleX(-1) rotate(-31deg); }

/* Hover: the lid lifts a little (pointer devices only) */
@media (hover: hover) and (pointer: fine) {
  #giftView .gift-present:hover .gift-present-lid { transform: translateY(-3px) rotate(-3deg); }
  #giftView .gift-present:hover { animation-play-state: paused; transform: translateY(-2px); transition: transform .3s ease; }
}

/* Already-open pose (static, no replay) */
#giftView .gift-present.is-opened .gift-present-lid,
#giftView .gift-present.is-opened .gift-present-bow { transform: translate(-14px, -26px) rotate(-16deg); }
#giftView .gift-present.is-opened .gift-present-ribbon { transform: translateY(-6px); }
#giftView .gift-present.is-opened { animation: none; }

/* ---------- Opening sequence (after the user clicks Open gift) ---------- */
#giftView .gift-present.is-opening { animation: none; }
#giftView .gift-present.is-opening .gift-present-lid { animation: gift-lid 1.05s cubic-bezier(.22, 1, .36, 1) both; }
#giftView .gift-present.is-opening .gift-present-bow { animation: gift-bow 1.05s cubic-bezier(.22, 1, .36, 1) both; }
#giftView .gift-present.is-opening .gift-present-ribbon { animation: gift-ribbon .9s ease both; }
#giftView .gift-present.is-opening .gift-present-body { animation: gift-body .5s ease both; }
#giftView .gift-burst { position: absolute; left: 50%; top: 34%; width: 0; height: 0; pointer-events: none; z-index: 6; }
#giftView .gift-burst i {
  position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--sc-brand, #2456e0); opacity: 0;
  animation: gift-spark .9s cubic-bezier(.22, 1, .36, 1) .35s both;
}
#giftView .gift-burst i:nth-child(even) { background: #fff; box-shadow: 0 0 0 1px var(--sc-brand, #2456e0); }
#giftView .gift-burst i:nth-child(1) { --dx: 0px;   --dy: -58px; }
#giftView .gift-burst i:nth-child(2) { --dx: 41px;  --dy: -41px; }
#giftView .gift-burst i:nth-child(3) { --dx: 58px;  --dy: 0px; }
#giftView .gift-burst i:nth-child(4) { --dx: 41px;  --dy: 41px; }
#giftView .gift-burst i:nth-child(5) { --dx: 0px;   --dy: 58px; }
#giftView .gift-burst i:nth-child(6) { --dx: -41px; --dy: 41px; }
#giftView .gift-burst i:nth-child(7) { --dx: -58px; --dy: 0px; }
#giftView .gift-burst i:nth-child(8) { --dx: -41px; --dy: -41px; }
/* Skip: finish the motion at once */
#giftView .gift-present.is-skipped *, #giftView .gift-present.is-skipped { animation-duration: .01ms !important; animation-delay: 0s !important; transition: none !important; }

@keyframes gift-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes gift-lid {
  0% { transform: none; }
  40% { transform: translate(-16px, -30px) rotate(-20deg); }
  100% { transform: translate(-14px, -26px) rotate(-16deg); }
}
@keyframes gift-bow {
  0% { transform: none; }
  100% { transform: translate(-10px, -22px) rotate(-14deg); }
}
@keyframes gift-ribbon { 0% { transform: none; } 100% { transform: translateY(-6px); } }
@keyframes gift-body { 0% { transform: scale(1); } 40% { transform: scale(1.03); } 100% { transform: scale(1); } }
@keyframes gift-spark {
  0% { opacity: 0; transform: translate(0, 0) scale(.4); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1); }
}

/* ---------- Form: inputs with a calm focus effect and clear labels ---------- */
#giftView .gift-input {
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
#giftView .gift-input:focus {
  outline: none;
  border-color: var(--sc-brand, #2456e0);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sc-brand, #2456e0) 16%, transparent);
}
#giftView .gift-field > label,
#giftView .gift-field > .gift-label,
#giftView .gift-label-row > label { font-weight: 600; }
#giftView .gift-switch button { transition: background-color .2s ease, color .2s ease, box-shadow .2s ease; }
#giftView .gift-switch button:focus-visible { outline: 2px solid var(--sc-brand, #2456e0); outline-offset: 2px; }

/* ---------- My gifts: compact cards with clear hierarchy ---------- */
#giftView .gift-box {
  border: 1px solid var(--sc-border);
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--sc-raised, #fff);
  transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
  animation: gift-card-in .45s cubic-bezier(.22, 1, .36, 1) both;
}
#giftView .gift-box + .gift-box { margin-top: 10px; }
#giftView .gift-box:nth-child(2) { animation-delay: 50ms; }
#giftView .gift-box:nth-child(3) { animation-delay: 100ms; }
#giftView .gift-box:nth-child(4) { animation-delay: 150ms; }
@media (hover: hover) and (pointer: fine) {
  #giftView .gift-box:hover {
    border-color: color-mix(in srgb, var(--sc-brand, #2456e0) 40%, var(--sc-border));
    transform: translateY(-1px);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--sc-brand, #2456e0) 8%, transparent);
  }
}
#giftView .gift-box-mark { color: var(--sc-brand, #2456e0); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: color-mix(in srgb, var(--sc-brand, #2456e0) 10%, #fff); }
#giftView .gift-box-facts { transition: opacity .2s ease; }
#giftView .gift-box-status { white-space: nowrap; font-size: 12px; font-weight: 600; }

/* Stock Gift risk notices */
#giftView .gift-refund-warning {
  margin: 4px 0 12px; padding: 10px 12px; border-left: 3px solid var(--sc-warning, #8A5A12);
  background: color-mix(in srgb, var(--sc-warning, #8A5A12) 6%, transparent); border-radius: 0 8px 8px 0;
  font-size: 13px; line-height: 1.5; color: var(--sc-text);
}
#giftView .gift-refund-warning a { color: var(--sc-brand, #2456e0); font-weight: 600; }
#giftView .gift-ack { margin: 4px 0 12px; font-size: 13px; }
#giftView .gift-refund-note { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--sc-muted, #5f6b73); }
#giftView .gift-safety { margin: 14px 0 0; border-top: 1px solid var(--sc-border); padding-top: 8px; font-size: 14px; }
#giftView .gift-safety > summary { cursor: pointer; font-weight: 600; color: var(--sc-brand, #2456e0); min-height: 30px; }
#giftView .gift-safety ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; line-height: 1.5; }
#giftView .gift-safety li strong { font-weight: 600; }

/* My gifts page: the cards sit directly on the page, without a second outer card */
#giftView #giftMine.gift-card { background: transparent; border: 0; box-shadow: none; padding: 0; }
#giftView #giftMine .gift-box { padding: 16px 18px; }
#giftView #giftMine .gift-box-head { align-items: center; gap: 12px; }
#giftView #giftMine .gift-box-title strong { display: block; font-size: 15px; }
#giftView #giftMine .gift-box-title small { display: block; margin-top: 2px; color: var(--sc-muted, #5f6b73); font-size: 13px; overflow-wrap: anywhere; }
#giftView #giftMine .gift-box-facts dd { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#giftView #giftMine .gift-box-actions { gap: 8px; }
@media (max-width: 720px) {
  #giftView #giftMine .gift-box-actions { grid-template-columns: 1fr; }
}

/* Expandable gift details: a smooth open, no jump */
#giftView .gift-box-more { margin-top: 10px; border-top: 1px solid var(--sc-border); padding-top: 8px; }
#giftView .gift-box-more > summary, #giftView .gift-sender-details > summary {
  cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; color: var(--sc-brand, #2456e0);
  display: flex; align-items: center; gap: 6px; min-height: 30px;
}
#giftView .gift-box-more > summary::-webkit-details-marker, #giftView .gift-sender-details > summary::-webkit-details-marker { display: none; }
#giftView .gift-box-more > summary::before, #giftView .gift-sender-details > summary::before {
  content: "+"; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--sc-brand, #2456e0) 35%, transparent); font-size: 13px; line-height: 1;
  transition: transform .25s ease;
}
#giftView .gift-box-more[open] > summary::before, #giftView .gift-sender-details[open] > summary::before { transform: rotate(45deg); }
#giftView .gift-box-more[open] .gift-facts, #giftView .gift-sender-details[open] .gift-facts { animation: gift-expand .28s ease both; }
#giftView .gift-box-more .gift-facts { margin: 6px 0 0; }
@keyframes gift-expand { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Completed-gift presentation: sender details use the same expandable style */
#giftView .gift-sender-details { margin-top: 12px; border-top: 1px solid var(--sc-border); padding-top: 8px; }

/* ---------- Header: compact title with a small floating gift icon ---------- */
#giftView .gift-title-row { display: flex; align-items: center; gap: 12px; }
#giftView .gift-title-row h1 { margin: 0; }
#giftView .gift-head-icon {
  flex: none; display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 13px;
  color: var(--sc-brand, #2456e0);
  background: color-mix(in srgb, var(--sc-brand, #2456e0) 10%, #fff);
  animation: gift-head-float 4.5s ease-in-out infinite;
}

/* ---------- My gifts: status filters with counts ---------- */
#giftView .gift-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
#giftView .gift-filter {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 34px; padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--sc-border); background: transparent;
  color: var(--sc-text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}
#giftView .gift-filter-count { font-variant-numeric: tabular-nums; opacity: .6; font-weight: 500; }
#giftView .gift-filter[aria-pressed="true"] {
  border-color: var(--sc-brand, #2456e0); color: var(--sc-brand, #2456e0);
  background: color-mix(in srgb, var(--sc-brand, #2456e0) 8%, transparent);
}
#giftView .gift-filter[aria-pressed="true"] .gift-filter-count { opacity: .85; }
#giftView .gift-filter:focus-visible { outline: 2px solid var(--sc-brand, #2456e0); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  #giftView .gift-filter:hover { border-color: color-mix(in srgb, var(--sc-brand, #2456e0) 50%, var(--sc-border)); }
}
#giftView .gift-filter-empty { padding: 18px 0; text-align: center; }
@keyframes gift-head-float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-3px) rotate(-4deg); } }
@keyframes gift-card-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Reduced motion: keep the states, drop the movement ---------- */
@media (prefers-reduced-motion: reduce) {
  #giftView .gift-present,
  #giftView .gift-present-lid,
  #giftView .gift-present-bow,
  #giftView .gift-present-ribbon,
  #giftView .gift-present-body,
  #giftView .gift-burst i,
  #giftView .gift-box,
  #giftView .gift-head-icon,
  #giftView .gift-facts { animation: none !important; transition: none !important; }
  #giftView .gift-burst { display: none; }
  #giftView .gift-present:hover { transform: none; }
  #giftView .gift-box:hover { transform: none; }
}
