/* gifts.css — styles for /gifts (requires theme.css) */

.page-wrap {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, #daeeff 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 100%, #f4d8f8 0%, transparent 55%),
    #f0f8ff;
  padding: 28px 18px 44px;
  font-family: 'Noto Sans SC', 'PingFang SC', sans-serif;
}

/* ── Header ── */
.page-header { text-align: center; margin-bottom: 26px; }
.page-header h1 {
  font-size: 20px; font-weight: 500; letter-spacing: 1px; margin-bottom: 5px;
  background: linear-gradient(135deg, var(--blue2) 20%, #9070d0);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.page-header p { font-size: 12px; color: var(--text3); letter-spacing: .5px; }

/* ── Tag filter ── */
.tag-bar {
  display: flex; flex-wrap: wrap; gap: 6px;
  max-width: 820px; margin: 0 auto 18px; justify-content: center;
}
.tag-btn {
  font-size: 11px; padding: 3px 12px; border-radius: 20px;
  border: 1.5px solid rgba(var(--bow-rgb), 0.5);
  background: rgba(255,255,255,0.7); color: var(--text2);
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.tag-btn:hover { border-color: rgba(var(--blue-rgb), 0.6); background: rgba(220,240,255,0.8); }
.tag-btn.active { background: linear-gradient(135deg, var(--blue), #8868d0); border-color: transparent; color: #fff; }

/* ── Sections ── */
.section { max-width: 820px; margin: 0 auto 28px; }
.section-heading {
  font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text3); margin-bottom: 12px; padding-left: 2px;
}

/* ── Gift grid ── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 13px;
}
.gift-card {
  background: rgba(255,255,255,0.82);
  border: 1.5px solid rgba(var(--bow-rgb), 0.4);
  border-radius: 16px; overflow: hidden; cursor: pointer;
  transition: transform .18s, box-shadow .18s, border-color .18s;
  position: relative; user-select: none;
}
.gift-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(var(--blue-rgb), 0.16);
  border-color: rgba(var(--blue-rgb), 0.5);
}
.gift-card:active { transform: scale(0.97); }

.card-img-wrap {
  width: 100%; aspect-ratio: 1/1;
  background: linear-gradient(135deg, #e4f0fb, #f0e8ff);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.card-img-wrap img {
  width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s;
}
.gift-card:hover .card-img-wrap img { transform: scale(1.05); }
.img-fallback {
  font-size: 42px; display: flex; align-items: center;
  justify-content: center; width: 100%; height: 100%;
}

.tag-badge {
  position: absolute; top: 8px; left: 8px;
  font-size: 9px; font-weight: 600; padding: 2px 7px; border-radius: 20px;
  background: rgba(255,255,255,0.88); color: var(--text2);
  border: 1px solid rgba(var(--bow-rgb), 0.6); z-index: 1; white-space: nowrap;
}
.type-badge {
  position: absolute; top: 8px; right: 8px;
  font-size: 9px; font-weight: 600; padding: 2px 7px; border-radius: 20px;
  background: rgba(255,255,255,0.88); color: #7060a8;
  border: 1px solid rgba(170,130,232,0.5); z-index: 1;
}

.card-body { padding: 9px 11px 11px; }
.card-name {
  font-size: 13px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px;
}
.card-desc {
  font-size: 11px; color: var(--text3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Modal backdrop ── */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(30,60,100,0.22); backdrop-filter: blur(7px);
  display: flex; align-items: center; justify-content: center;
  z-index: 999; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .22s;
}
.modal-bg.show { opacity: 1; pointer-events: all; }

/* ── Modal box ── */
.modal {
  background: rgba(255,255,255,0.97);
  border-radius: 22px; border: 1.5px solid rgba(var(--bow-rgb), 0.5);
  padding: 24px 22px 20px; width: 100%; max-width: 340px;
  box-shadow: 0 14px 50px rgba(var(--blue-rgb), 0.18);
  transform: scale(0.92) translateY(14px);
  transition: transform .28s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
  max-height: calc(100dvh - 40px); overflow-y: auto;
}
.modal-bg.show .modal { transform: scale(1) translateY(0); }
.modal.wide { max-width: 400px; }

.modal-close {
  position: absolute; top: 12px; right: 14px;
  width: 26px; height: 26px; border-radius: 50%; border: none;
  background: rgba(var(--bow-rgb), 0.2); color: var(--text3); font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.modal-close:hover { background: rgba(var(--bow-rgb), 0.4); }

.modal-preview {
  width: 90px; height: 90px; border-radius: 14px;
  background: linear-gradient(135deg, #e4f0fb, #f0e8ff);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px; border: 2px solid rgba(var(--bow-rgb), 0.3);
  overflow: hidden; font-size: 36px;
}
.modal-preview img { width: 100%; height: 100%; object-fit: cover; }
.modal-title { text-align: center; font-size: 15px; font-weight: 500; color: var(--text); margin-bottom: 2px; }
.modal-meta { text-align: center; font-size: 11px; color: var(--text3); margin-bottom: 16px; letter-spacing: .5px; }
.modal-btns { display: flex; gap: 8px; }

/* ── Buttons ── */
.btn {
  flex: 1; padding: 11px; border-radius: 50px;
  border: 1.5px solid rgba(var(--bow-rgb), 0.45);
  background: rgba(255,255,255,0.7);
  font-size: 13px; font-family: inherit; font-weight: 500; color: var(--text2);
  cursor: pointer; transition: all .18s; letter-spacing: .5px;
  text-decoration: none; display: flex; align-items: center; justify-content: center;
}
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: linear-gradient(135deg, var(--blue), #8868d0);
  border-color: transparent; color: #fff;
  box-shadow: 0 3px 12px rgba(var(--blue-rgb), 0.25);
}
.btn.primary:hover { filter: brightness(1.07); }
.btn.cancel:hover { background: rgba(240,248,255,0.9); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ── Collection list ── */
.collection-items { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.collection-item {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 14px;
  background: rgba(240,248,255,0.7); border: 1.5px solid rgba(var(--bow-rgb), 0.3);
  cursor: default; transition: all .16s;
}
.collection-item:hover { border-color: rgba(var(--blue-rgb), 0.5); background: rgba(220,240,255,0.8); }
.item-thumb {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0; overflow: hidden;
  background: linear-gradient(135deg, #e4f0fb, #f0e8ff);
  border: 1.5px solid rgba(var(--bow-rgb), 0.35);
}
.item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-thumb-fallback { display: flex; align-items: center; justify-content: center; font-size: 22px; }
.item-info { flex: 1; min-width: 0; }
.item-name {
  font-size: 13px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.item-desc {
  font-size: 11px; color: var(--text3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px;
}
.item-arrow { font-size: 14px; color: #b0c8e0; flex-shrink: 0; }

/* ── Forms ── */
.form-block { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.fg { display: flex; flex-direction: column; gap: 3px; }
.form-block label { font-size: 11px; color: var(--text3); letter-spacing: .5px; }
.form-block input,
.form-block textarea {
  width: 100%; padding: 9px 13px; border-radius: 12px;
  border: 1.5px solid rgba(var(--bow-rgb), 0.5);
  background: rgba(240,248,255,0.8);
  font-size: 13px; font-family: inherit; color: var(--text);
  outline: none; transition: border-color .15s; resize: none;
}
.form-block input[type=password] { font-size: 14px; }
.form-block input:focus,
.form-block textarea:focus { border-color: rgba(var(--blue-rgb), 0.7); }
.form-block textarea { min-height: 68px; }
.form-error { font-size: 12px; color: #d06060; text-align: center; min-height: 16px; margin-bottom: 10px; }
.form-success { font-size: 13px; color: #5a9a70; text-align: center; line-height: 1.7; margin-bottom: 16px; }
.dl-label { font-size: 11px; color: var(--text3); text-align: center; margin-bottom: 8px; }
.dl-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
