/* ─── Shared styles for all gift list pages ─── */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Inter:wght@400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; color: #1e2d3d; background: #f4f8fb; -webkit-font-smoothing: antialiased; line-height: 1.6; }
h1,h2,h3,h4 { font-family: 'Nunito', sans-serif; line-height: 1.2; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; }

:root {
  /* override per-page */
  --theme:        #5bbfeb;
  --theme-dark:   #3a9fd0;
  --theme-pale:   #e8f6fd;

  --blue:         #5bbfeb;
  --orange:       #ff7c1f;
  --orange-dark:  #e06510;
  --green:        #4ecf8a;
  --dark:         #1e2d3d;
  --gray-600:     #4a5a6a;
  --gray-400:     #8a9aaa;
  --gray-200:     #e2eaf0;
  --gray-100:     #f4f8fb;
  --white:        #ffffff;
  --radius-sm:    10px;
  --radius-md:    18px;
  --radius-lg:    28px;
  --radius-xl:    40px;
  --shadow-sm:    0 2px 12px rgba(30,45,61,.07);
  --shadow-md:    0 8px 32px rgba(30,45,61,.11);
  --shadow-lg:    0 20px 60px rgba(30,45,61,.15);
  --transition:   .25s cubic-bezier(.4,0,.2,1);
}

/* ══ NAVBAR ══ */
.lista-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.95); backdrop-filter: blur(16px);
  border-bottom: 1.5px solid var(--gray-200);
  height: 64px; display: flex; align-items: center; padding: 0 24px;
}
.lista-nav-inner {
  max-width: 1040px; width: 100%; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.back-btn {
  display: flex; align-items: center; gap: 6px;
  font-family: 'Nunito', sans-serif; font-size: .88rem; font-weight: 700;
  color: var(--gray-600); padding: 7px 14px; border-radius: var(--radius-xl);
  transition: background var(--transition); border: none; background: none;
}
.back-btn:hover { background: var(--gray-100); color: var(--blue); }
.nav-logo img { height: 28px; display: block; }
.share-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--gray-100); color: var(--dark);
  font-family: 'Nunito', sans-serif; font-size: .85rem; font-weight: 700;
  padding: 8px 16px; border-radius: var(--radius-xl); border: none;
  transition: background var(--transition);
}
.share-btn:hover { background: var(--gray-200); }

/* ══ HERO ══ */
.list-hero {
  background: linear-gradient(160deg, var(--theme) 0%, var(--theme-dark) 100%);
  padding: 52px 28px 44px; text-align: center;
  position: relative; overflow: hidden;
}
.list-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 600px 400px at 50% -10%, rgba(255,255,255,.14) 0%, transparent 60%);
}
.hero-inner { max-width: 680px; margin: 0 auto; position: relative; z-index: 1; }
.hero-cat {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.35);
  backdrop-filter: blur(8px); border-radius: var(--radius-xl);
  padding: 5px 16px; font-family: 'Nunito', sans-serif;
  font-size: .75rem; font-weight: 800; color: white;
  text-transform: uppercase; letter-spacing: .07em; margin-bottom: 18px;
}
.hero-avatar {
  width: 84px; height: 84px; border-radius: 50%;
  background: rgba(255,255,255,.2); border: 3px solid rgba(255,255,255,.45);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.6rem; margin: 0 auto 18px;
}
.hero-title {
  font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 900;
  color: white; margin-bottom: 10px;
}
.hero-meta {
  display: flex; align-items: center; justify-content: center;
  gap: 18px; flex-wrap: wrap; margin-bottom: 28px;
}
.hero-meta-item {
  display: flex; align-items: center; gap: 5px;
  font-size: .86rem; color: rgba(255,255,255,.85); font-weight: 500;
}
.hero-box {
  background: rgba(255,255,255,.15); backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255,255,255,.28); border-radius: var(--radius-lg);
  padding: 18px 28px; display: inline-block;
}
.hero-box-label { font-size: .74rem; color: rgba(255,255,255,.72); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.hero-box-amount { font-family: 'Nunito', sans-serif; font-size: 2rem; font-weight: 900; color: white; margin: 3px 0 12px; }
.hero-bar-track { height: 8px; background: rgba(255,255,255,.2); border-radius: 4px; }
.hero-bar-fill { height: 100%; border-radius: 4px; background: rgba(255,255,255,.78); transition: width 1.3s cubic-bezier(.4,0,.2,1); }
.hero-bar-labels { display: flex; justify-content: space-between; margin-top: 6px; font-size: .72rem; color: rgba(255,255,255,.7); }

/* ══ STATS BAND ══ */
.stats-band {
  background: white; border-bottom: 1.5px solid var(--gray-200); padding: 18px 28px;
}
.stats-inner {
  max-width: 1040px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center; gap: 36px; flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-val { font-family: 'Nunito', sans-serif; font-size: 1.35rem; font-weight: 900; color: var(--theme); }
.stat-label { font-size: .72rem; color: var(--gray-400); margin-top: 2px; font-weight: 500; }
.stat-div { width: 1px; height: 32px; background: var(--gray-200); }

/* ══ MAIN ══ */
.list-main { max-width: 1040px; margin: 0 auto; padding: 44px 28px 72px; }
.sec-head { margin-bottom: 26px; }
.sec-head h2 { font-size: 1.45rem; font-weight: 900; color: var(--dark); }
.sec-head p { font-size: .88rem; color: var(--gray-600); margin-top: 5px; }

/* ══ GIFT GRID ══ */
.gifts-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }

/* ══ GIFT CARD ══ */
.gift-card {
  background: white; border-radius: var(--radius-md);
  border: 1.5px solid var(--gray-200); padding: 0;
  display: flex; flex-direction: column; gap: 0;
  transition: var(--transition); overflow: hidden;
}
.gift-card:hover { box-shadow: 0 20px 56px rgba(30,45,61,.14); border-color: rgba(91,191,235,.22); transform: translateY(-8px); }
.gift-card.done { border-color: rgba(78,207,138,.22); }
.gift-card.done:hover { border-color: rgba(78,207,138,.4); box-shadow: 0 20px 56px rgba(78,207,138,.1); }

/* ── Gift photo (injected by JS) ── */
.gift-photo {
  width: 100%; aspect-ratio: 3/2;
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--theme-pale) 0%, #f8fafc 100%);
  flex-shrink: 0;
}
.gift-photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .55s ease;
}
.gift-card:hover .gift-photo img { transform: scale(1.07); }
.gift-photo-fallback {
  display: none;
  position: absolute; inset: 0;
  align-items: center; justify-content: center;
  font-size: 3.2rem;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.12));
  animation: float 3.6s ease-in-out infinite;
}
.gift-done-overlay {
  position: absolute; inset: 0;
  background: rgba(16,185,129,.18); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem;
}

/* ── Gift card inner content ── */
.gift-top { display: flex; align-items: center; gap: 11px; padding: 14px 16px 0; }
.gift-icon {
  width: 46px; height: 46px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.45rem; flex-shrink: 0;
  transition: transform .38s cubic-bezier(.34,1.56,.64,1);
}
.gift-card:hover .gift-icon { transform: scale(1.18) rotate(-5deg); }
/* When photo is injected, remove top padding from gift-top */
.gift-card:has(.gift-photo) .gift-top { padding-top: 14px; }
.gift-name { font-family: 'Nunito', sans-serif; font-size: .92rem; font-weight: 800; color: var(--dark); line-height: 1.3; }
.gift-target { font-size: .76rem; color: var(--gray-400); margin-top: 2px; font-weight: 600; }
.gift-prog { padding: 0 16px; }
.gift-prog-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.gift-pct { font-family: 'Nunito', sans-serif; font-size: .8rem; font-weight: 900; }
.gift-raised { font-size: .73rem; color: var(--gray-400); }
.gift-bar-track { height: 6px; background: var(--gray-200); border-radius: 3px; }
.gift-bar-fill { height: 100%; border-radius: 3px; transition: width 1s cubic-bezier(.4,0,.2,1); }
.gift-contrib { font-size: .73rem; color: var(--gray-400); display: flex; align-items: center; gap: 4px; padding: 0 16px; }
.btn-gift {
  width: calc(100% - 32px); margin: 0 16px 16px; padding: 11px; border-radius: var(--radius-xl);
  background: var(--orange); color: white; border: none;
  font-family: 'Nunito', sans-serif; font-size: .86rem; font-weight: 800;
  box-shadow: 0 4px 14px rgba(255,124,31,.28); transition: var(--transition);
}
.btn-gift:hover { background: var(--orange-dark); transform: translateY(-3px); box-shadow: 0 8px 26px rgba(255,124,31,.42); }
.gift-done-badge {
  width: calc(100% - 32px); margin: 0 16px 16px;
  padding: 10px; border-radius: var(--radius-xl);
  background: #f0fdf4; color: #16a34a;
  border: 1.5px solid rgba(78,207,138,.28);
  font-family: 'Nunito', sans-serif; font-size: .86rem; font-weight: 800;
  text-align: center; display: flex; align-items: center; justify-content: center; gap: 5px;
  animation: done-glow 2.8s ease-in-out infinite;
}
@keyframes done-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(78,207,138,0); }
  50% { box-shadow: 0 0 14px 2px rgba(78,207,138,.2); }
}
/* Spacing for card elements when photo is present */
.gift-card:has(.gift-photo) .gift-prog { padding-top: 4px; padding-bottom: 2px; }
.gift-card:has(.gift-photo) .gift-contrib { padding-bottom: 8px; }

/* ══ MESSAGE ══ */
.msg-section {
  margin-top: 52px; background: white;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-lg); padding: 32px;
}
.msg-author { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.msg-avatar {
  width: 50px; height: 50px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.msg-name { font-family: 'Nunito', sans-serif; font-weight: 800; color: var(--dark); font-size: .93rem; }
.msg-role { font-size: .76rem; color: var(--gray-400); margin-top: 2px; }
.msg-text { font-size: .93rem; color: var(--gray-600); line-height: 1.78; font-style: italic; }

/* ══ FOOTER ══ */
.lista-footer {
  background: #1e2d3d; padding: 28px; text-align: center; margin-top: 0;
}
.lista-footer img { height: 22px; filter: brightness(0) invert(1); opacity: .7; margin: 0 auto 8px; }
.lista-footer p { font-size: .75rem; color: rgba(255,255,255,.28); }

/* ══ MODAL ══ */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.52); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.modal-bg.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: white; border-radius: var(--radius-lg); padding: 32px;
  max-width: 400px; width: 100%; box-shadow: 0 24px 64px rgba(0,0,0,.22);
  transform: translateY(28px) scale(.96);
  transition: transform .42s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;
  position: relative;
}
.modal-bg.open .modal-box { transform: translateY(0) scale(1); }
.modal-close-btn {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px;
  border-radius: 50%; border: none; background: var(--gray-100);
  font-size: .9rem; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background var(--transition);
}
.modal-close-btn:hover { background: var(--gray-200); }
.modal-head { text-align: center; margin-bottom: 22px; }
.modal-emoji { font-size: 2.4rem; margin-bottom: 8px; }
.modal-gift-name { font-family: 'Nunito', sans-serif; font-size: 1.15rem; font-weight: 900; color: var(--dark); }
.modal-gift-target { font-size: .82rem; color: var(--gray-400); margin-top: 3px; }
.amounts-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 14px; }
.amt-btn {
  padding: 10px 6px; border-radius: var(--radius-sm);
  border: 2px solid var(--gray-200); background: white;
  font-family: 'Nunito', sans-serif; font-size: .84rem; font-weight: 800;
  color: var(--dark); transition: var(--transition); text-align: center;
}
.amt-btn:hover, .amt-btn.sel { border-color: var(--blue); background: var(--blue); color: white; }
.modal-field {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200); font-family: 'Inter', sans-serif;
  font-size: .88rem; margin-bottom: 10px; transition: border-color var(--transition);
  color: var(--dark);
}
.modal-field:focus { outline: none; border-color: var(--blue); }
.modal-label { font-family: 'Nunito', sans-serif; font-size: .8rem; font-weight: 800; color: var(--gray-600); margin-bottom: 8px; display: block; }
.btn-confirm {
  width: 100%; padding: 14px; border-radius: var(--radius-xl);
  background: var(--orange); color: white; border: none;
  font-family: 'Nunito', sans-serif; font-size: .97rem; font-weight: 900;
  box-shadow: 0 6px 24px rgba(255,124,31,.35); transition: var(--transition);
}
.btn-confirm:hover { background: var(--orange-dark); transform: translateY(-3px); box-shadow: 0 10px 30px rgba(255,124,31,.45); }

/* ══ PRIVATE AMOUNT INDICATOR ══ */
.priv {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  border: 1.5px dashed #cbd5e1;
  border-radius: 8px;
  padding: 2px 10px;
  font-size: .75rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: .03em;
  vertical-align: middle;
  white-space: nowrap;
}
.stat-val .priv { font-size: .65rem; padding: 2px 8px; }
.gift-raised.priv { background: none; border: none; padding: 0; font-size: .78rem; color: #c8d5e0; letter-spacing: 0; }

/* ══ INTERACTIVE EFFECTS ══ */

/* Hero avatar float */
.hero-avatar { animation: float 3.6s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

/* Scroll reveal */
.reveal-ready {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .55s ease, transform .55s ease;
}
.reveal-ready.revealed { opacity: 1; transform: translateY(0); }

/* Ripple */
.btn-gift, .btn-confirm, .amt-btn { position: relative; overflow: hidden; }
.ripple {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.38);
  transform: scale(0);
  animation: ripple-anim .55s linear forwards;
  pointer-events: none;
}
@keyframes ripple-anim { to { transform: scale(4); opacity: 0; } }

/* Toast */
.rt-toast {
  position: fixed; bottom: 32px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e2d3d; color: white;
  padding: 13px 26px; border-radius: 50px;
  font-family: 'Nunito', sans-serif; font-weight: 700; font-size: .9rem;
  opacity: 0; transition: all .35s cubic-bezier(.4,0,.2,1);
  z-index: 9999; box-shadow: 0 8px 32px rgba(0,0,0,.28); white-space: nowrap;
}
.rt-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ══ COMMENTS ══ */
.comments-section {
  margin-top: 52px;
}
.comments-hdr {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px;
}
.comments-title {
  font-size: 1.2rem; font-weight: 900; color: var(--dark);
}
.comments-count {
  font-family: 'Nunito', sans-serif; font-size: .75rem; font-weight: 800;
  background: var(--theme-pale); color: var(--theme);
  padding: 4px 12px; border-radius: var(--radius-xl);
}

.comments-list {
  display: flex; flex-direction: column; gap: 14px; margin-bottom: 28px;
}
.comment {
  display: flex; gap: 12px; align-items: flex-start;
  animation: cmt-in .45s ease both;
}
@keyframes cmt-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.comment-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Nunito', sans-serif; font-weight: 900; font-size: .85rem; color: white;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.comment-body {
  flex: 1; background: white; border: 1.5px solid var(--gray-200);
  border-radius: 4px var(--radius-md) var(--radius-md) var(--radius-md);
  padding: 12px 16px; box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.comment-body:hover { box-shadow: var(--shadow-md); }
.comment-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px;
}
.comment-name  { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: .88rem; color: var(--dark); }
.comment-time  { font-size: .7rem; color: var(--gray-400); }
.comment-text  { font-size: .88rem; color: var(--gray-600); line-height: 1.68; }

/* Comment form */
.comment-form {
  background: white; border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm);
}
.comment-form-label {
  font-family: 'Nunito', sans-serif; font-size: .88rem; font-weight: 800;
  color: var(--dark); margin-bottom: 14px; display: block;
}
.comment-form-row { margin-bottom: 10px; }
.comment-input {
  display: block; width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif; font-size: .88rem; color: var(--dark);
  background: var(--gray-100); transition: border-color var(--transition), background var(--transition);
  margin-bottom: 10px;
}
.comment-input:focus { outline: none; border-color: var(--theme); background: white; }
textarea.comment-input { resize: none; min-height: 88px; }
.btn-comment {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 12px 26px; border-radius: var(--radius-xl); border: none;
  background: var(--theme); color: white;
  font-family: 'Nunito', sans-serif; font-size: .9rem; font-weight: 800;
  box-shadow: 0 4px 18px rgba(91,191,235,.32);
  transition: var(--transition); position: relative; overflow: hidden;
}
.btn-comment:hover { background: var(--theme-dark); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(91,191,235,.42); }

/* ══ RESPONSIVE ══ */
@media (max-width: 720px) {
  .gifts-grid { grid-template-columns: 1fr 1fr; }
  .stats-inner { gap: 20px; }
  .stat-div { display: none; }
}
@media (max-width: 440px) {
  .gifts-grid { grid-template-columns: 1fr; }
  .list-main { padding: 28px 16px 56px; }
}
