/* ==========================================
   RESEARCHEM - MEGA POLISH & ENHANCEMENTS CSS
   Visual polish for all premium features
   ========================================== */

/* Enhanced Button Styles */
.btn-premium {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-premium::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-premium:hover::before {
  width: 300px;
  height: 300px;
}

.btn-premium:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(34, 211, 238, 0.4);
}

/* Stack Builder Button Glow */
button[onclick*="openStackBuilder"] {
  animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.6), 0 0 30px rgba(139, 92, 246, 0.4);
  }
}

/* Dosage & Comparison Button Improvements */
button[onclick*="openDosageCalculator"],
button[onclick*="toggleComparison"] {
  position: relative;
  transition: all 0.3s ease;
}

button[onclick*="openDosageCalculator"]:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(167, 139, 250, 0.3));
  border-color: rgb(167, 139, 250);
  transform: scale(1.05);
}

button[onclick*="toggleComparison"]:hover {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(56, 189, 248, 0.3));
  border-color: rgb(56, 189, 248);
  transform: scale(1.05);
}

button[onclick*="toggleComparison"].active {
  background: linear-gradient(135deg, rgb(34, 211, 238), rgb(56, 189, 248));
  color: rgb(2, 6, 23);
  font-weight: 600;
  border-color: rgb(34, 211, 238);
}

/* Heart/Favorite Button */
.favorite-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.8);
  border: 2px solid rgb(71, 85, 105);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}

.favorite-btn:hover {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgb(236, 72, 153);
  transform: scale(1.1);
}

.favorite-btn.active {
  background: linear-gradient(135deg, rgb(236, 72, 153), rgb(244, 114, 182));
  border-color: rgb(236, 72, 153);
  animation: heartBeat 0.6s ease;
}

.favorite-btn.active svg {
  fill: white;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(1.1); }
  75% { transform: scale(1.2); }
}

/* Product Card Enhanced Hover */
.product-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px -10px rgba(34, 211, 238, 0.3);
}

/* Urgency Badge */
.urgency-badge {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgb(239, 68, 68), rgb(220, 38, 38));
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  animation: urgencyPulse 2s ease-in-out infinite;
  z-index: 20;
}

@keyframes urgencyPulse {
  0%, 100% {
    transform: translateX(-50%) scale(1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  }
  50% {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.6);
  }
}

/* Stock Counter */
.stock-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
}

.stock-indicator.low {
  background: rgba(239, 68, 68, 0.15);
  color: rgb(248, 113, 113);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.stock-indicator.medium {
  background: rgba(245, 158, 11, 0.15);
  color: rgb(251, 191, 36);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.stock-indicator.high {
  background: rgba(34, 197, 94, 0.15);
  color: rgb(74, 222, 128);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.stock-indicator .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: stockBlink 2s ease-in-out infinite;
}

.stock-indicator.low .dot {
  background: rgb(239, 68, 68);
}

.stock-indicator.medium .dot {
  background: rgb(245, 158, 11);
}

.stock-indicator.high .dot {
  background: rgb(34, 197, 94);
}

@keyframes stockBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Review Stars */
.review-stars {
  display: inline-flex;
  gap: 2px;
  align-items: center;
}

.review-stars .star {
  color: rgb(251, 191, 36);
  font-size: 14px;
}

.review-stars .star.empty {
  color: rgb(71, 85, 105);
}

.review-count {
  margin-left: 6px;
  font-size: 11px;
  color: rgb(148, 163, 184);
}

/* Loading Skeleton */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(51, 65, 85, 0.4) 25%,
    rgba(71, 85, 105, 0.6) 50%,
    rgba(51, 65, 85, 0.4) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(34, 211, 238, 0.2);
  border-top-color: rgb(34, 211, 238);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Price Drop Badge */
.price-drop-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: linear-gradient(135deg, rgb(34, 197, 94), rgb(74, 222, 128));
  color: rgb(2, 6, 23);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  animation: priceDropBounce 1s ease-in-out infinite;
}

@keyframes priceDropBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

/* Best Deal Badge */
.best-deal-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: linear-gradient(135deg, rgb(250, 204, 21), rgb(252, 211, 77));
  color: rgb(2, 6, 23);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 12px rgba(250, 204, 21, 0.4);
  z-index: 10;
}

/* Featured Product Auto-Scroll Navigation */
.featured-nav-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.featured-nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgb(71, 85, 105);
  cursor: pointer;
  transition: all 0.3s ease;
}

.featured-nav-dot.active {
  width: 24px;
  border-radius: 4px;
  background: rgb(34, 211, 238);
}

.featured-nav-dot:hover {
  background: rgb(100, 116, 139);
  transform: scale(1.2);
}

/* Mobile Enhancements */
@media (max-width: 768px) {
  .btn-premium {
    padding: 12px 20px;
    font-size: 15px;
    min-height: 48px; /* Better tap target */
  }
  
  button[onclick*="openDosageCalculator"],
  button[onclick*="toggleComparison"] {
    padding: 10px 14px;
    font-size: 12px;
  }
  
  .product-card {
    margin-bottom: 24px;
  }
  
  .favorite-btn {
    width: 44px;
    height: 44px;
  }
}

/* Countdown Timer */
.countdown-timer {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 6px 12px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  color: rgb(248, 113, 113);
}

.countdown-timer .time-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 24px;
}

.countdown-timer .time-value {
  font-size: 14px;
  font-weight: 700;
  color: rgb(239, 68, 68);
}

.countdown-timer .time-label {
  font-size: 8px;
  text-transform: uppercase;
  opacity: 0.7;
}

/* Activity Feed Dot */
.activity-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgb(34, 197, 94);
  animation: activityPulse 2s ease-in-out infinite;
}

@keyframes activityPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.5;
  }
}

/* Quiz Progress Bar */
.quiz-progress {
  width: 100%;
  height: 8px;
  background: rgb(30, 41, 59);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 24px;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, rgb(34, 211, 238), rgb(139, 92, 246));
  transition: width 0.4s ease;
  border-radius: 4px;
}

/* Exit Intent Modal Overlay */
.exit-intent-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.95);
  backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.exit-intent-content {
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Notification Enhancements */
.notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 400px;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  z-index: 9999;
  animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.notification:hover {
  transform: translateX(-4px);
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, rgb(34, 211, 238), rgb(139, 92, 246));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* Hover Glow Effect */
.hover-glow {
  position: relative;
  transition: all 0.3s ease;
}

.hover-glow::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgb(34, 211, 238), rgb(139, 92, 246));
  opacity: 0;
  z-index: -1;
  filter: blur(15px);
  transition: opacity 0.3s ease;
}

.hover-glow:hover::after {
  opacity: 0.6;
}

/* Smooth Scroll Behavior */
html {
  scroll-behavior: smooth;
}

/* Better Focus States for Accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgb(34, 211, 238);
  outline-offset: 2px;
}
