/* Register Gift Section CSS - Based on Next.js Original */
.register-gift-section {
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  background: transparent !important;
}

/* Override global body background for this section */
body:has(.register-gift-section) {
  background: transparent !important;
}

.register-gift-container {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.video-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  /* Fallback background chỉ hiện khi video không load được */
  background: url('/images/F2_FrameAnh_Banner1.webp') center center/cover no-repeat;
}

.video-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.title-section {
  position: relative;
  z-index: 5;
  text-align: center;
  padding-top: 22px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.title-section img {
  max-width: 420px;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
}

.main-content {
  position: relative;
  z-index: 5;
  display: flex;
  flex: 1;
  padding: 0;
  gap: 0;
  align-items: center;
  width: 100%;
}

.left-column {
  flex: 7;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
}

.right-column {
  flex: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
}

.banner-slider {
  max-width: 100%;
  margin: 0 auto;
  background: url(/images/F2_FrameAnh.webp) no-repeat center center/100% auto;
  position: relative;
  aspect-ratio: auto;
}

.banner-slider img {
  aspect-ratio: auto;
  width: 100%;
  position: relative;
  z-index: 3;
  opacity: 1;
}

.gift-details {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.gift-title {
  font-size: 24px;
  color: #D4AF37;
  text-align: center;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  font-weight: bold;
}

.gift-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 0;
  width: 100%;
  max-width: none;
  justify-content: center;
  align-items: center;
}

.gift-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.gift-item:hover {
  transform: translateY(-2px);
}

.gift-item:active {
  transform: translateY(0);
}

.gift-item.locked {
  opacity: 0.6;
  filter: grayscale(0.8);
}

.gift-item.unlocked {
  filter: brightness(1.1) drop-shadow(0 0 8px rgba(212, 175, 55, 0.3));
}

.gift-item.unlocked:hover {
  filter: brightness(1.2) drop-shadow(0 0 12px rgba(212, 175, 55, 0.5));
}

.gift-icon-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.gift-icon {
  height: auto;
  display: block;
  max-height: 90px;
  width: auto;
  margin: 0 auto;
}

.no-gifts-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.no-gifts-message p {
  margin: 0;
  font-size: 16px;
  color: #D4AF37;
}

.participants-section,
.progress-section {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.progress-bar-container {
  width: 100%;
  text-align: center;
}

.progress-text {
  color: #fff;
  font-size: 14px;
  margin-bottom: 8px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.progress-bar {
  width: 100%;
  height: 20px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff8800, #ffaa00);
  border-radius: 10px;
  transition: width 0.5s ease;
}

.progress-fill.animated {
  animation: progressGlow 2s ease-in-out infinite alternate;
}

@keyframes progressGlow {
  0% { box-shadow: 0 0 5px rgba(255, 136, 0, 0.5); }
  100% { box-shadow: 0 0 15px rgba(255, 136, 0, 0.8); }
}

.progress-remaining {
  color: #D4AF37;
  font-size: 12px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.register-section {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.register-button {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: transform 0.3s ease;
}

.register-button:hover {
  transform: scale(1.05);
}

.register-button:active {
  transform: scale(0.95);
}

.button-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.button-icon img {
  height: 60px;
  width: auto;
}

.button-content span {
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Desktop Specific */
@media (min-width: 1025px) {
  .gift-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Banner slider responsive */
@media (max-width: 1400px) {
  .banner-slider {
    max-width: 85%;
    margin-top: 3vw;
  }
}

@media (max-height: 600px) {
  .banner-slider {
    max-width: 60%;
  }
}

/* Tablet Responsive */
@media (min-width: 769px) and (max-width: 1024px) {
  .main-content {
    flex-direction: column;
    gap: 1.5rem;
    padding: 0 2%;
  }
  
  .left-column,
  .right-column {
    width: 100%;
    padding: 0 1rem;
  }
  
  .banner-slider {
    max-width: 75%;
  }
  
  .gift-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    max-width: 90%;
  }
  
  .gift-icon {
    max-height: 120px;
  }
  
  .gift-details {
    gap: 18px;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  /* Avoid forcing full viewport height on mobile so bottom content doesn't get pushed far away */
  .register-gift-section {
    min-height: auto;
  }
  
  .register-gift-container {
    min-height: auto;
  }
  
  .main-content {
    flex-direction: column;
    padding: 0 3%;
    gap: 0.75rem; /* slightly tighter vertical spacing on mobile */
  }
  
  .left-column,
  .right-column {
    width: 100%;
    padding: 0;
  }
  
  .banner-slider {
    max-width: 100%;
    margin-top: 1rem;
  }
  
  .gift-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-width: 100%;
  }
  
  .gift-icon {
    max-height: 60px;
  }
  
  .gift-title {
    font-size: 20px;
  }
  
  .gift-details {
    gap: 12px;
  }

  /* Give the register button some breathing room from the bottom edge (safe-area aware) */
  .register-section {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  }
}

/* Small Mobile Responsive */
@media (max-width: 480px) {
  .gift-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
  
  .gift-icon {
    max-height: 50px;
  }
  
  .gift-title {
    font-size: 17px;
  }
  
  .title-section img {
    max-width: 280px;
    display: block;
    margin: 0 auto;
  }
  
  .gift-details {
    gap: 10px;
  }
}