/* Portfolio Container */
#portfolio-container {
  display: flex;
  min-width: 320px;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-evenly;
  background-color: var(--middle-bg-color);
  border-bottom: 5px solid var(--second-accent-color);
}

/* Portfolio Item */
.category {
  flex: 0 0 calc(33.33% - 20px);
  box-sizing: border-box;
  min-width: 250px;
  width: auto;
  height: auto;
  position: relative;
  margin: 20px 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
}

.category::before {
  content: attr(alt);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  color: #fff;
  opacity: 1;
  border-radius: 10px;
  transition: opacity 0.3s ease;
}

.category img {
  width: 100%;
  height: 100%;
  border-radius: 10px;
}

.category a {
  position: absolute;
  top: 50%;
  left: -100%; /* Initial position outside the div */
  right: 0;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 10px;
  margin: 0;
  opacity: 0;
  animation: slide-in 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards; /* Use cubic-bezier for smoother animation */
  -webkit-animation: slide-in 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards; /* For compatibility with certain browsers */
}

/* Keyframes for the slide-in animation */
@keyframes slide-in {
  0% {
    left: -100%; /* Initial position outside the div */
    opacity: 0; /* Initially hidden */
  }
  100% {
    left: 0; /* Slide in from the left */
    opacity: 1; /* Fully visible */
  }
}

@-webkit-keyframes slide-in {
  0% {
    left: -100%;
    opacity: 0;
  }
  100% {
    left: 0;
    opacity: 1;
  }
}

/* Individual delay for each category */
.category:nth-child(1) a {
  animation-delay: 0.5s; 
}

.category:nth-child(2) a {
  animation-delay: 1s; 
}

.category:nth-child(3) a {
  animation-delay: 1.5s; 
}
.category:nth-child(4) a {
  animation-delay: 2s; 
}

.category:nth-child(5) a {
  animation-delay: 2.5s; 
}

.category:nth-child(6) a {
  animation-delay: 3s; 
}

/* Hover effect to change opacity on hover */
.category:hover::before {
  opacity: 0.7;
}
