/* Portfolio Carousel */
.portfolio-carousel-container {
  position: relative;
  padding: 0.5rem 0;
  margin: 0 -1rem;
}

.portfolio-carousel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  padding: 0 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
}

.portfolio-carousel::-webkit-scrollbar {
  display: none;
}

.portfolio-item {
  scroll-snap-align: start;
  position: relative;
  aspect-ratio: 4/3;
  min-width: 0;
  cursor: pointer;
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.5rem;
  transition: transform 0.2s;
}

.portfolio-item:hover img {
  transform: scale(1.02);
}

.portfolio-delete-button {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background-color: #EF4444;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  border: none;
}

.portfolio-item:hover .portfolio-delete-button {
  opacity: 1;
}

.portfolio-delete-button:hover {
  background-color: #DC2626;
}

.portfolio-nav-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background-color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4B5563;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
  border: none;
  opacity: 0.9;
}

.portfolio-nav-button:hover {
  background-color: #F3F4F6;
  color: #1F2937;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  opacity: 1;
}

.portfolio-nav-button.prev {
  left: 0.5rem;
}

.portfolio-nav-button.next {
  right: 0.5rem;
}

.portfolio-empty-state {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  background-color: #F9FAFB;
  border: 2px dashed #E5E7EB;
  border-radius: 0.5rem;
}

.portfolio-upload-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 2rem;
  transition: all 0.2s;
}

.portfolio-upload-button:hover {
  color: #4F46E5;
}

.portfolio-upload-tile {
  aspect-ratio: 4/3;
  border: 2px dashed #E5E7EB;
  border-radius: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  background-color: #F9FAFB;
}

.portfolio-upload-tile:hover {
  border-color: #4F46E5;
  color: #4F46E5;
}

/* Touch Device Optimizations */
@media (hover: none) {
  .portfolio-carousel {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .portfolio-item {
    scroll-snap-align: start;
  }

  .portfolio-nav-button {
    display: none;
  }

  .portfolio-delete-button {
    opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .portfolio-carousel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portfolio-nav-button {
    width: 2rem;
    height: 2rem;
  }
}

@media (max-width: 480px) {
  .portfolio-carousel {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}
