/* How Stakid Works Section Styles */
.how-it-works {
  padding: 80px 0;
  background-color: #fdfbf5;
  overflow: hidden;
}

.how-it-works h2 {
  font-size: 3.5rem;
  color: #f2864f;
  text-align: center;
  margin-bottom: 15px;
}

.how-it-works .subtitle {
  text-align: center;
  font-size: 1.2rem;
  color: #444;
  margin-bottom: 60px;
}

.card-container {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
  margin: 0 auto;
}

.product-card {
  width: 320px;
  height: 275px;
  background-color: white;
  border-radius: 25px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  position: relative;
  transform: rotate(-2deg);
  transition: transform 0.4s ease-out;
  overflow: visible; /* Changed from hidden to visible */
  margin-top: 60px;
}

.product-card:nth-child(2) {
  transform: rotate(2deg);
}

.product-card:nth-child(3) {
  transform: rotate(-3deg);
}

.product-card:hover {
  transform: rotate(0deg) scale(1.05);
  z-index: 10;
}

.icon-circle {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 150px;
  background-color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  z-index: 12;
}

.icon-wrapper {
  width: 135px;
  height: 135px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease;
  overflow: hidden;
}

.product-card:nth-child(1) .icon-wrapper {
  background-color: #DFE7FF;
}

.product-card:nth-child(2) .icon-wrapper {
  background-color: #FFF2CC;
}

.product-card:nth-child(3) .icon-wrapper {
  background-color: #E9F7F2;
}

.product-card:hover .icon-wrapper {
  transform: rotate(15deg);
}

.product-icon {
  width: 120px;
  height: 120px;
  object-fit: contain;
}

.product-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 25px 20px;
  border-bottom-left-radius: 25px;
  border-bottom-right-radius: 25px;
  text-align: center;
}

.product-info h3 {
  font-weight: 800;
  font-family: 'JUST Sans', sans-serif;
  font-size: 1.6rem;
  margin-bottom: 10px;
  color: #222;
}

.product-info p {
  font-size: 1rem;
  line-height: 1.4;
  color: #444;
}

.product-info.blue {
  background-color: #DFE7FF;
}

.product-info.yellow {
  background-color: #FFF2CC;
}

.product-info.green {
  background-color: #E9F7F2;
}

/* Endless Fun Section */
.endless-fun {
  padding: 40px 0;
  display: flex;
  justify-content: center;
  margin-bottom: -30px;
}

/* Fun Container */
.fun-container {
  background-color: #FFE8D3;
  border-radius: 25px;
  padding: 15px 25px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 1;
  width: fit-content;
}

/* Fun Items */
.fun-item {
  width: 70px;
  height: 70px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
  color: #fffBf0;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
  white-space: nowrap;
  overflow: hidden; /* Prevents content from spilling out */
}

/* Ensure images are contained within the square */
.fun-item img {
  max-width: 95%; /* Limit width to container */
  max-height: 95%; /* Limit height to container */
  object-fit: contain; /* Maintain aspect ratio while fitting inside */
}

/* Specific Colors */
.fun-item.blue {
  background-color: #304c9c;
  animation: floatBlue 6s ease-in-out infinite alternate;
}

.fun-item.yellow {
  background-color: #ffd424;
  animation: floatYellow 6s ease-in-out infinite alternate;
}

.fun-item.pink {
  background-color: #506c54;
  animation: floatPink 6s ease-in-out infinite alternate;
}

/* Fun Text */
.fun-item.green {
  font-weight: 800;
  font-family: 'JUST Sans', sans-serif;
  background-color: #ffb4ac;
  color: #000;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 1.1rem;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  white-space: nowrap;
  min-width: fit-content;
  font-weight: bolder;
}

/* Icons */
.fun-item img {
  width: 60%;
  height: auto;
}

/* Signs */
.plus-sign,
.equals-sign {
  font-size: 2rem;
  color: #000;
  font-weight: 800;
  font-family: 'JUST Sans', sans-serif;
  margin: 0 10px;
}

/* Floating Animations */
@keyframes floatBlue {
  0% { transform: translateY(3px); }
  100% { transform: translateY(-3px); }
}

@keyframes floatYellow {
  0% { transform: translateY(5px); }
  100% { transform: translateY(-1px); }
}

@keyframes floatPink {
  0% { transform: translateY(6px); }
  100% { transform: translateY(0px); }
}

/* Benefits Section */
.benefits-section {
  padding: 80px 0;
  background-color: #fdfbf5;
}

.benefits-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

.benefit-card {
  background-color: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  text-align: center;
}

.benefit-card:hover {
  transform: translateY(-10px);
}

.benefit-icon {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: #f2864f;
}

.benefit-card h3 {
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 15px;
  font-family: 'JUST Sans', sans-serif;
}

.benefit-card p {
  font-size: 1rem;
  color: #666;
  line-height: 1.6;
}

.benefit-card.green-bg {
  background-color: #e8f5e9;
}

.benefit-card.blue-bg {
  background-color: #e3f2fd;
}

.benefit-card.orange-bg {
  background-color: #fff3e0;
}

.benefit-card.yellow-bg {
  background-color: #fffde7;
}

.benefit-card:nth-child(1):hover {
  transform: rotate(3deg) scale(1.05);
}

.benefit-card:nth-child(2):hover {
  transform: translateY(-15px);
}

.benefit-card:nth-child(3):hover {
  transform: rotate(-3deg) scale(1.05);
}

.benefit-card:nth-child(4):hover {
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .how-it-works h2,
  .endless-fun h2,
  .benefits-section h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
  }
  
  .product-info h3 {
    font-size: 1.2rem;
  }
  
  .benefits-grid {
    grid-template-columns: 1fr;
  }
  
  /* Mobile styles for endless-fun section */
  .fun-container {
    flex-wrap: wrap;
    justify-content: center;
    padding: 15px 15px;
    gap: 10px;
    max-width: 300px;
    margin: 0 auto;
  }
  
  /* First row: Block and Sticks with plus sign between them */
  .fun-item.blue,
  .fun-item.yellow,
  .fun-container .plus-sign:first-of-type {
    order: 1;
  }
  
  /* Second row: Wheels, equals sign, and Endless Fun text */
  .fun-item.pink,
  .equals-sign,
  .fun-item.green {
    order: 2;
    margin-top: 10px;
  }
  
  /* Hide the second plus sign on mobile */
  .fun-container .plus-sign:nth-of-type(2) {
    display: none;
  }
  
  /* Center the wheels item */
  .fun-item.pink {
    margin-right: auto;
    margin-left: auto;
  }
  
  /* Make the equals sign and green item align properly */
  .equals-sign {
    margin: 0 5px;
  }
  
  .fun-item.green {
    font-size: 0.9rem;
    padding: 8px 15px;
  }
}
