.showcase-container {
  display: flex;
  flex-direction: row;
  gap: 10px;
  padding: 20px;
  max-width: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  justify-content: center;
  position: relative;
  z-index: 2;
  box-sizing: border-box;
}

.card {
  width: 80px;
  height: 475px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: width 300ms cubic-bezier(0.4, 0, 0.2, 1),
              height 300ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  scroll-snap-align: center;
  touch-action: pan-x;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.1); /* glassy effect */
  cursor: pointer;
  outline: none; /* remove tap outline */
}

.card:focus {
  outline: none;
}

/* Expanded states (hover, focus, or active) */
.card.active,
.card:hover,
.card:focus-within {
  width: 420px;
  height: 475px;
}

.card.active .title-collapsed,
.card:hover .title-collapsed,
.card:focus-within .title-collapsed {
  opacity: 0;
}

.card.active .content,
.card:hover .content,
.card:focus-within .content {
  opacity: 1;
}

/* Collapse the active card when another is hovered/focused */
.showcase-container:hover .card.active:not(:hover),
.showcase-container:focus-within .card.active:not(:focus-within) {
  width: 80px;
  height: 475px;
}

/* Hide content + show title when collapsed */
.showcase-container:hover .card.active:not(:hover) .content,
.showcase-container:focus-within .card.active:not(:focus-within) .content {
  opacity: 0;
}

.showcase-container:hover .card.active:not(:hover) .title-collapsed,
.showcase-container:focus-within .card.active:not(:focus-within) .title-collapsed {
  opacity: 1;
}

/* Background animation */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.05)
  );
  opacity: 0.5;
  z-index: -1;
  animation: wave 6s ease-in-out infinite;
  will-change: transform;
}

.card:nth-child(1)::before { animation-delay: 0s; }
.card:nth-child(2)::before { animation-delay: -1s; }
.card:nth-child(3)::before { animation-delay: -2s; }
.card:nth-child(4)::before { animation-delay: -3s; }
.card:nth-child(5)::before { animation-delay: -4s; }
.card:nth-child(6)::before { animation-delay: -5s; }
.card:nth-child(7)::before { animation-delay: -6s; }

@keyframes wave {
  0%, 100% { transform: translateX(-10%); }
  50% { transform: translateX(10%); }
}

/* Title (collapsed view) */
.title-collapsed {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  color: var(--theme-color);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 1px;
  opacity: 1;
  transition: opacity 300ms;
}

/* Content (expanded view) */
.content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 300ms;
  color: var(--theme-color);
  padding: 20px;
  text-align: center;
}

.title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 12px;
}

.description {
  font-size: 16px;
  line-height: 1.5;
  opacity: 0.8;
  margin-bottom: 20px;
  max-width: 360px;
}

.preview-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: none;
  color: var(--theme-color);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 200ms;
  cursor: pointer;
}

.preview-btn:hover {
  background: var(--hover-menu-bg);
}

.preview-btn::after {
  content: "→";
  font-size: 16px;
}

/* Mobile styles */
@media (max-width: 768px) {
  .showcase-container {
    flex-direction: column;
    align-items: center;
    padding: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    max-width: calc(100% - 20px);
    margin: 0 auto;
    width: 100%;
  }

  .card {
    width: 100%;
    min-width: 100%;
    max-width: calc(100% - 20px);
    height: 60px;
    margin-bottom: 8px;
    transition: height 300ms cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Expanded states for mobile */
  .card.active,
  .card:hover,
  .card:focus-within {
    height: 280px;
  }

  /* Collapse active card on mobile when another is focused/hovered */
  .showcase-container:hover .card.active:not(:hover),
  .showcase-container:focus-within .card.active:not(:focus-within) {
    height: 60px;
  }

  /* Hide content + show title when collapsed (mobile) */
  .showcase-container:hover .card.active:not(:hover) .content,
  .showcase-container:focus-within .card.active:not(:focus-within) .content {
    opacity: 0;
  }

  .showcase-container:hover .card.active:not(:hover) .title-collapsed,
  .showcase-container:focus-within .card.active:not(:focus-within) .title-collapsed {
    opacity: 1;
  }

  .title-collapsed {
    writing-mode: horizontal-tb;
    font-size: 16px;
    padding: 10px;
    text-align: center;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .content {
    padding: 15px;
  }

  .title {
    font-size: 20px;
  }

  .description {
    font-size: 14px;
  }

  .preview-btn {
    padding: 8px 16px;
    font-size: 12px;
  }
}






