/* New User Popup Styles - Premium Edition */

/* Overlay with heavy blur */
.new-user-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.75); /* Darker slate overlay */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.new-user-popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Main Content Card */
.new-user-popup-content {
  background: #ffffff;
  width: 90%;
  max-width: 850px;
  max-height: 90vh;
  border-radius: 24px;
  overflow: hidden; /* Important for header graphic */
  position: relative;
  transform: scale(0.95) translateY(20px);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); /* Springy effect */
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
}

.new-user-popup-overlay.active .new-user-popup-content {
  transform: scale(1) translateY(0);
}

/* Close Button */
.popup-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  font-size: 1.25rem;
  color: white;
  cursor: pointer;
  z-index: 20;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: all 0.2s ease;
}

.popup-close-btn:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: rotate(90deg) scale(1.1);
}

/* Header Section */
.popup-header {
  background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  padding: 3rem 2rem 2.5rem;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

/* Abstract Pattern Overlay */
.popup-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 150%, rgba(255,255,255,0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% -50%, rgba(255,255,255,0.3) 0%, transparent 50%);
  pointer-events: none;
}

/* Floating icons animation */
.popup-header::after {
  content: '🎁';
  position: absolute;
  top: 20px;
  left: 20px;
  font-size: 3rem;
  opacity: 0.2;
  transform: rotate(-15deg);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-15deg); }
  50% { transform: translateY(-10px) rotate(-5deg); }
}

.popup-header h2 {
  font-size: 2.25rem; /* Bigger title */
  font-weight: 800;
  margin-bottom: 0.5rem;
  line-height: 1.1;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: relative;
}

.popup-header p {
  font-size: 1.1rem;
  font-weight: 500;
  opacity: 0.95;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

/* Body & Grid */
.popup-body {
  padding: 2rem;
  background: #f8fafc; /* Slight off-white */
  flex: 1;
  overflow-y: auto;
}

.popup-deals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

/* Deal Card */
.popup-deal-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  flex-direction: column;
}

.popup-deal-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: #fed7aa; /* Orange tint on border */
}

/* Image Area */
.deal-img-wrapper {
  height: 180px;
  position: relative;
  background: #f1f5f9;
  overflow: hidden;
}

.deal-img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Contain usually better for products */
  padding: 10px;
  mix-blend-mode: multiply; /* Better isolation if white bg */
  transition: transform 0.5s ease;
}

.popup-deal-card:hover .deal-img {
  transform: scale(1.05);
}

/* Discount Badge */
.deal-discount-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #dc2626; /* Pure Red */
  color: white;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 20px;
  box-shadow: 0 4px 6px rgba(220, 38, 38, 0.3);
  z-index: 2;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* Card Info */
.deal-info {
  padding: 1.25rem;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.deal-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5rem; /* Align heights */
}

.deal-price-block {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  margin-top: auto; /* Push to bottom of flex container */
}

.deal-old-price {
  font-size: 0.9rem;
  color: #94a3b8;
  text-decoration: line-through;
}

.deal-new-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: #dc2626;
  letter-spacing: -0.5px;
}

/* Add Button */
.popup-add-btn {
  width: 100%;
  background: #0f172a; /* Slate 900 */
  color: white;
  border: none;
  padding: 0.85rem;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.95rem;
}

.popup-add-btn:hover {
  background: #000;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.popup-add-btn:active {
  transform: translateY(0);
}

/* Confetti Animation (CSS Only) */
@keyframes confetti-fall {
  0% { transform: translateY(-100%) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Mobile Adjustments */
@media (max-width: 640px) {
  .new-user-popup-content {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }

  .popup-header {
    padding: 2.5rem 1.5rem 1.5rem;
  }

  .popup-header h2 {
    font-size: 1.75rem;
  }

  .popup-body {
    padding: 1rem;
  }

  .popup-deals-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
  }

  .deal-img-wrapper {
    height: 200px;
  }

  .popup-close-btn {
     /* Move close button slightly down for safe areas if needed */
     top: 10px;
     right: 10px;
     background: rgba(0,0,0,0.2); /* Ensure visibility on header */
  }
}
