/* ✨ Motion Design System Tokens - E-commerce Optimized */
:root {
  /* Duration Tokens - Subtle for E-commerce */
  --duration-fast: 150ms;
  --duration-medium: 300ms;
  --duration-slow: 500ms;

  /* Easing Tokens */
  --easing-standard: ease-out;
  --easing-exit: ease-in;
  --easing-in-out: ease-in-out;

  /* Trust & Conversion Focused Colors */
  --color-primary: #2563eb;
  --color-gold: #f59e0b;
  --color-gold-light: #fbbf24;
  --color-shadow-subtle: rgba(0, 0, 0, 0.04);
  --color-shadow-hover: rgba(0, 0, 0, 0.08);
  --color-bg-card: #ffffff;
  --color-border-subtle: rgba(229, 231, 235, 0.6);
  --color-text-primary: #374151;
  --color-text-secondary: #333;
  --color-trust-bg: rgba(59, 130, 246, 0.02);
}

.all-product-reviews {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0px;
  /* 🛒 E-commerce: Ensure reviews don't dominate */
  opacity: 0.95;
}

.reviews-grid {
  display: grid;
  grid-gap: 16px;
  margin-bottom: 24px;
}

/* 🛍️ Trust-focused Card Design */
.review-item {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  padding: 18px;
  position: relative;

  /* Initial state for subtle entrance */
  opacity: 0;
  transform: translateY(8px);

  /* Very subtle transitions - no distraction */
  transition: opacity var(--duration-medium) var(--easing-standard),
    transform var(--duration-medium) var(--easing-standard),
    box-shadow var(--duration-fast) var(--easing-standard);

  /* Minimal shadow for trust */
  box-shadow: 0 1px 3px var(--color-shadow-subtle);
}

/* ✨ Subtle Trust-building Hover */
.review-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--color-shadow-hover);

  /* 🛒 Subtle trust indicator */
  background: var(--color-trust-bg);
}

/* 🎭 Gentle Entrance Animation */
.review-item.show {
  opacity: 1;
  transform: translateY(0);
}

/* 👤 Professional Author Styling */
.author {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text-primary);
  margin: 0 0 8px 0;
  line-height: 1.4;
}

/* ⭐ Trust-focused Star Rating */
.rating {
  margin: 0 0 24px 0;
  display: flex;
  gap: 1px;
  align-items: center;
}

.star {
  font-size: 1rem;
  color: var(--color-gold);
  transition: color var(--duration-fast) var(--easing-standard);
  display: inline-block;
}

/* ✨ Very subtle star interaction - trust building */
.rating:hover .star {
  color: var(--color-gold-light);
}

/* 🎵 Minimal star animation - only on load */
.star:nth-child(1) {
  animation-delay: 0ms;
}
.star:nth-child(2) {
  animation-delay: 30ms;
}
.star:nth-child(3) {
  animation-delay: 60ms;
}
.star:nth-child(4) {
  animation-delay: 90ms;
}
.star:nth-child(5) {
  animation-delay: 120ms;
}

@keyframes starEntry {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.star.animate {
  animation: starEntry 200ms var(--easing-standard) both;
}

/* 💬 Clean Review Text */
.review-text {
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
  font-size: 1rem;
  /* 🛒 Prevent text from being too prominent */
  max-height: 60px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* 🔄 Professional Load More Button */
.load-more {
  display: block;
  min-height: 65px;
  margin: 24px auto 0;
  padding: 12px 28px;
  background: transparent;
  color: #4f46e5;
  border: none;
  border: 2px solid #4f46e5;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
  position: relative;

  /* Subtle professional transitions */
  transition: transform var(--duration-fast) var(--easing-standard),
    background-color var(--duration-fast) var(--easing-standard),
    box-shadow var(--duration-fast) var(--easing-standard);

  /* Minimal shadow */
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

/* ✨ Subtle button feedback */
.load-more:hover {
  transform: translateY(-1px);
  background-color: #4f46e5;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
  color: white;
}

.load-more:active {
  transform: translateY(0);
  transition-duration: 50ms;
}

/* 🔄 Professional loading state */
.load-more.loading {
  padding-right: 44px;
  cursor: wait;
  background-color: #6b7280;
}

.load-more.loading::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 📱 E-commerce Responsive Grid */
@media screen and (min-width: 640px) {
  .reviews-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 16px;
  }

  .review-text {
    font-size: 0.9rem;
    max-height: 72px;
  }
}

@media screen and (min-width: 1024px) {
  .reviews-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 20px;
  }

  .review-item {
    padding: 20px;
  }
}

/* ♿ Accessibility - Motion Reduction */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .review-item:hover {
    transform: none;
  }

  .load-more:hover {
    transform: none;
  }

  .star:hover {
    transform: none;
  }
}

/* 🎯 Subtle Focus States for Conversion */
.review-item:focus-within {
  outline: 1px solid var(--color-primary);
  outline-offset: 1px;
}

.load-more:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* 🛒 E-commerce specific: Ensure reviews support main content */
.all-product-reviews {
  /* Subtle visual hierarchy - reviews as supporting content */
  /* filter: contrast(0.95); */ /* 🔧 Removed: Was causing all cards to change on hover */
}

/* 🔧 Removed global hover effect to fix individual card hover issue */
/* .all-product-reviews:hover {
  filter: contrast(1);
  transition: filter var(--duration-medium) var(--easing-standard);
} */
