/*=========== Portfolio Section ===========*/
.portfolio-section {
  padding: 60px 20px;
  background-color: #fff;
  text-align: center;
  position: relative;
  z-index: 1;
  overflow: hidden;
}
.portfolio-section::before {
  content: "";
  position: absolute;
  top: -150px;
  left: -150px;
  width: 300px;
  height: 300px;
  background: rgba(114, 9, 183, 0.3);
  filter: blur(150px);
  z-index: -1;
}

.portfolio-section::after {
  content: "";
  position: absolute;
  bottom: -150px;
  right: -150px;
  width: 300px;
  height: 300px;
  background: rgba(114, 9, 183, 0.3);
  filter: blur(180px);
  z-index: -1;
}

.portfolio-title {
  font-size: 36px;
  font-weight: bold;
  color: transparent;
  background: linear-gradient(90deg, #8e2de2, #f3c5f5, #4a0379);
  background-size: 300% 100%;
  background-repeat: no-repeat;
  background-position: 100% center;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientRightToLeft 6s linear infinite;
  margin-bottom: 40px;
  display: inline-block;
}

@keyframes gradientRightToLeft {
  0% {
    background-position: 100% center;
  }
  100% {
    background-position: 0% center;
  }
}

.portfolio-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 40px;
}

.filter-bbtn {
  background: linear-gradient(to right, #a966d6, #8e2de2);
  color: #fff;
  padding: 12px 30px;
  border-radius: 15px 0px 15px 0px;
  font-weight: bold;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-bbtn.active,
.filter-bbtn:hover {
  background: none !important;
  color: #8e2de2 !important;
  border: 2px solid #8e2de2;
}

.portfolio-slider {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  max-width: 1100px;
  margin: 0 auto;
}

.portfolio-item {
  background-color: #111;
  border-radius: 15px;
  overflow: hidden;
  padding: 10px;
  height: 400px;
  animation: fadeInUp 0.5s ease;
  border: 1px solid #333333;
  display: flex;
  flex-direction: column;
}

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

.image-container {
  height: 70%;
  overflow-y: auto;
  border-radius: 10px;
  scroll-behavior: smooth;
  cursor: grab;
  position: relative;
  /* Firefox scrollbar */
  scrollbar-color: #ff416c #f1f1f1;
  scrollbar-width: thin;
}

/* Chrome, Edge, Safari scrollbar */
.image-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.image-container::-webkit-scrollbar-track {
  background: #ff416c;
  border-radius: 10px;
}

.image-container::-webkit-scrollbar-thumb {
  background: #8e2de2;
  border-radius: 10px;
}

.image-container::-webkit-scrollbar-thumb:hover {
  background: #7d26d1;
}

.image-container img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  pointer-events: none;
  user-select: none;
}

/* Tag label inside image - FIXED POSITION */
.tag-container {
  position: sticky;
  bottom: 8px;
  left: 0;
  padding: 0 10px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap; /* Allows wrapping only when needed */
  gap: 5px;
  z-index: 2;
  width: calc(100% - 20px);
  pointer-events: none;
  align-content: flex-start; /* Stacks wrapped lines at the top */
  max-height: none; /* Remove height restrictions */
}

.tag-label,
.tag-label-purple,
.tag-label-gradient {
  padding: 4px 10px;
  font-size: 14px;
  font-weight: bold;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.2s ease;
}

/* When tags must wrap */
.tag-container.wrapped {
  flex-direction: column;
  align-items: flex-start;
}

/* Color variations remain same */
.tag-label { background: linear-gradient(90deg, rgba(255,65,108,0.9), rgba(142,45,226,0.9)) ; color: #fff;}
.tag-label-purple { background: rgba(142,45,226,0.85); color: #fff; }
.tag-label-gradient { 
  background: linear-gradient(90deg, rgba(142,45,226,0.9), rgba(255,65,108,0.9));
  color: #fff;
}

/* Item Info Box - FIXED HEIGHT */
.item-info {
  margin-top: 20px;
  text-align: center;
  position: relative;
  height: 25%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.item-title {
  font-size: 16px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 10px;
}

/* Live Demo Button */
.demo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #8e2de2;
  color: #fff;
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  margin: 0 auto;
}

/* Icon in button */
.demo-btn i {
  font-size: 16px;
}

/* Hover effect on .portfolio-item */
.portfolio-item:hover .demo-btn {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.load-more-container {
  text-align: center;
  margin: 30px 0 40px;
}

.load-more-btn {
  position: relative;
  background-color: #8e2de2;
  color: white;
  border: none;
  padding: 12px 28px;
  font-size: 18px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.load-more-btn:hover {
  background-color: #111;
}
.load-more-btn::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 12px solid #8e2de2; 
  transition: border-top-color 0.3s ease;
}

.load-more-btn:hover::after {
  border-top-color: #111;
}

.filter-btn {
  position: relative;
  background-color: #8e2de2;
  color: white;
  border: none;
  padding: 12px 28px;
  font-size: 18px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-bottom: 6px;
}

.filter-btn::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 12px solid #8e2de2;
  transition: border-top-color 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background-color: #111;
}

.filter-btn:hover::after,
.filter-btn.active::after {
  border-top-color: #111;
}

@media (max-width: 768px) {
  .portfolio-slider {
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 0 10px;
  }

  .portfolio-item {
    height: 350px;
  }
  
  .image-container {
    height: 100%;
  }
  
  .item-info {
    height: 30%;
    margin-top: 10px !important;
  }

  .load-more-btn,
  .filter-btn {
    padding: 6px 16px;
    font-size: 14px;
    border-radius: 5px;
  }

  .load-more-btn::after,
  .filter-btn::after {
    bottom: -5px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #8e2de2;
  }

  .load-more-btn:hover::after,
  .filter-btn:hover::after,
  .filter-btn.active::after {
    border-top-color: #111;
  }



  .tag-label {
    font-size: 12px;
    padding: 3px 8px;
  }

    .item-info {
    padding-top: 4px; /* Reduced from default */
    margin-top: 2px; /* Reduced spacing */
  }

  .item-title {
    font-size: 14px;
    margin-bottom: 4px; /* Reduced from 10px to 4px */
    line-height: 1.2; /* Tighter line height */
  }

  .demo-btn {
    margin-top: 4px; /* Reduced top margin */
    padding: 5px 10px; /* Slightly smaller button */
    font-size: 12px;
  }
}