/* gift-system.css — نظام الهدايا الحقيقي */

/* ---------- زر إرسال هدية في البروفايل ---------- */
.ureal-gift {
  cursor: pointer;
}
.ureal-gift i {
  color: #e91e8c;
  margin-left: 4px;
}

/* ---------- قسم الهدايا المستلمة داخل البروفايل ---------- */
.upro-gifts-received {
  padding: 8px 10px;
  margin: 6px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.03);
}
.upro-gifts-title {
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 6px;
  color: #444;
}
.upro-gifts-title i {
  color: #e91e8c;
  margin-left: 4px;
}
.upro-gifts-empty {
  font-size: 12px;
  color: #999;
  padding: 4px 0;
}
.upro-gifts-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.upro-gift-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 58px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s;
}
.upro-gift-item:hover {
  transform: translateY(-2px);
}
.upro-gift-item .upro-gift-frame {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #ffd54a, #e91e8c, #6a3ee8);
  box-shadow: 0 2px 8px rgba(233, 30, 140, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}
.upro-gift-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
  padding: 4px;
  box-sizing: border-box;
}
.upro-gift-from {
  font-size: 9px;
  color: #666;
  max-width: 54px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upro-gift-new {
  animation: giftPop 0.5s ease;
}
@keyframes giftPop {
  0% { transform: scale(0.2); opacity: 0; }
  70% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

/* ---------- رابط "عرض المزيد" أسفل الهدايا المستلمة في البروفايل ---------- */
.upro-gifts-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 0;
  font-size: 12px;
  color: #e91e8c;
  cursor: pointer;
  border-top: 1px dashed #e0e0e0;
}
.upro-gifts-more:hover {
  text-decoration: underline;
}

/* ---------- نافذة "عرض المزيد" لكل الهدايا المستلمة (بترقيم صفحات) ---------- */
.gift-history-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}
.gift-history-box {
  width: min(92vw, 420px);
  max-height: 80vh;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}
.gift-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: linear-gradient(135deg, #e91e8c, #6a3ee8);
  color: #fff;
  font-size: 13px;
  gap: 8px;
}
.gift-history-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gift-history-title i {
  margin-left: 4px;
}
.gift-history-close {
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 0 4px;
}
.gift-history-grid {
  padding: 14px 12px 6px;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
  min-height: 120px;
}
.gift-history-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 12px 14px;
}
.gift-history-page-btn {
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #555;
  background: #f2f2f2;
  cursor: pointer;
}
.gift-history-page-btn:hover {
  background: #e6e6e6;
}
.gift-history-page-btn.active {
  background: #e91e8c;
  color: #fff;
  font-weight: bold;
}
.gift-history-arrow-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #555;
  background: #f2f2f2;
  cursor: pointer;
}
.gift-history-arrow-btn:hover {
  background: #e6e6e6;
}
.gift-history-arrow-btn.disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

/* ---------- نافذة عرض الهدية بالتفصيل (لما تدوس على هدية في البروفايل) ---------- */
.gift-view-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
}
.gift-view-box {
  width: min(88vw, 300px);
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  position: relative;
}
.gift-view-close {
  position: absolute;
  top: 6px;
  left: 8px;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: #fff;
  z-index: 1;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.gift-view-head {
  background: linear-gradient(135deg, #e91e8c, #6a3ee8);
  padding: 26px 12px 40px;
}
.gift-view-frame {
  width: 110px;
  height: 110px;
  margin: 0 auto;
  border-radius: 50%;
  padding: 5px;
  background: linear-gradient(135deg, #ffd54a, #fff, #ffd54a);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}
.gift-view-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
  padding: 10px;
  box-sizing: border-box;
}
.gift-view-name {
  margin-top: -18px;
  background: #fff;
  border-radius: 12px;
  padding: 14px 14px 4px;
  font-size: 15px;
  font-weight: bold;
  color: #333;
}
.gift-view-price {
  color: #e91e8c;
  font-size: 13px;
  margin-top: 2px;
}
.gift-view-meta {
  padding: 8px 14px 18px;
  font-size: 12.5px;
  color: #666;
  line-height: 1.9;
}
.gift-view-meta b {
  color: #333;
}
.gift-view-arrow {
  color: #e91e8c;
  margin: 0 4px;
}

/* ---------- نافذة متجر الهدايا ---------- */
.gift-shop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}
.gift-shop-box {
  width: min(92vw, 420px);
  max-height: 80vh;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}
.gift-shop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: linear-gradient(135deg, #e91e8c, #6a3ee8);
  color: #fff;
  font-size: 13px;
  gap: 8px;
}
.gift-shop-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gift-shop-balance {
  font-size: 12px;
  white-space: nowrap;
}
.gift-shop-close {
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 0 4px;
}
.gift-shop-grid {
  padding: 12px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.gift-shop-card {
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 8px 4px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.gift-shop-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
.gift-shop-card img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}
.gift-shop-card-name {
  font-size: 11px;
  margin-top: 4px;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gift-shop-card-price {
  font-size: 11px;
  color: #e91e8c;
  margin-top: 2px;
}
.gift-shop-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #999;
  font-size: 12px;
  padding: 20px 0;
}

/* ---------- رسالة الهدية داخل الروم (ضمن رسائل الشات العادية) ---------- */
.gift-room-msg {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gift-room-msg-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
  padding: 2px;
  box-shadow: 0 0 0 2px #e91e8c33;
  flex: 0 0 auto;
}
.gift-room-msg-text {
  font-size: 13px;
}
.gift-room-msg-text b {
  color: #e91e8c;
}
.gift-room-msg-text .fa-diamond {
  color: #e91e8c;
  margin: 0 2px;
}

/* ---------- تأثير الهدية العائم للجميع ---------- */
#giftFloatLayer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100vh;
  pointer-events: none;
  z-index: 100000;
  overflow: hidden;
}
.gift-float-item {
  position: absolute;
  left: 50%;
  bottom: -120px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(20, 20, 30, 0.88);
  color: #fff;
  padding: 8px 18px 8px 8px;
  border-radius: 30px;
  box-shadow: 0 0 20px rgba(233, 30, 140, 0.6);
  animation: giftFloatUp 5s ease-in forwards;
  white-space: nowrap;
  max-width: 92vw;
}
.gift-float-item.gift-float-out {
  opacity: 0;
  transition: opacity 0.8s ease;
}
.gift-float-frame {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, #ffd54a, #e91e8c, #6a3ee8);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gift-float-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
  padding: 4px;
  box-sizing: border-box;
  animation: giftSpin 1.4s ease-in-out infinite;
}
.gift-float-text {
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gift-float-names {
  font-size: 12px;
}
.gift-float-names b {
  color: #ffd54a;
  font-size: 13px;
}
.gift-float-arrow {
  color: #ff6fb0;
  margin: 0 5px;
  font-weight: bold;
}
.gift-float-giftname {
  font-size: 11.5px;
  color: #dcdcdc;
}
.gift-float-giftname b {
  color: #fff;
}

@keyframes giftFloatUp {
  0% { bottom: -80px; opacity: 0; }
  10% { opacity: 1; }
  85% { opacity: 1; }
  100% { bottom: 100vh; opacity: 0; }
}
@keyframes giftSpin {
  0%, 100% { transform: rotate(-8deg) scale(1); }
  50% { transform: rotate(8deg) scale(1.15); }
}

@media (max-width: 480px) {
  .gift-shop-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
