/* SEE Portfolio - YUCK Style */
.see-portfolio-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 30px;
  justify-content: center;
  padding: 15px;
  background-color: #f0f0f0; /* Light gray background for the filter bar */
  border-radius: 8px;
}

.see-filter-btn {
  border: none;
  padding: 8px 16px;
  border-radius: 20px; /* Rounded buttons */
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: capitalize;
}

/* Inactive filter button style */
.see-filter-btn {
  background-color: rgba(0, 0, 0, 0.25); /* Black background with 25% opacity */
  color: white;
}

/* Active filter button style */
.see-filter-btn.active {
  background-color: white;
  color: black;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.see-filter-btn:hover:not(.active) {
  background-color: rgba(0, 0, 0, 0.4); /* Darken on hover for inactive */
}

.see-portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 0;
  margin: 0;
}

.see-portfolio-item {
  position: relative;
  border-radius: 12px; /* Rounded corners for cards */
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: #f9f9f9; /* Light background for card itself */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* Subtle shadow */
  aspect-ratio: 16 / 10;
}

.see-portfolio-item:hover {
  /* transform: translateY(-4px); */
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.see-portfolio-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
  position: relative; /* Needed for absolute positioning of overlays */
}

/* Media Container (Image/Video/GIF) */
.see-portfolio-media {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden; /* Keep this to contain scaled media */
}

.see-portfolio-image,
.see-portfolio-gif,
.see-portfolio-video {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Changed from cover to contain */
  transition: transform 0.4s ease;
  background-color: rgba(0, 0, 0, 0.05); /* Slight background for letterboxing */
}

/* Zoom only for images on hover */
.see-portfolio-item:hover .see-portfolio-image {
  /* transform: scale(1.05); */
}

/* Ensure GIFs and Videos do not scale via this rule */
.see-portfolio-item:hover .see-portfolio-gif,
.see-portfolio-item:hover .see-portfolio-video {
  transform: none;
}

.see-portfolio-video {
  background: #000; /* Retain black background for videos if object-fit: contain results in letterboxing */
}

.see-portfolio-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e0e0e0;
  color: #555;
  font-weight: 600;
  font-size: 18px;
  text-align: center;
  padding: 20px;
}

/* Overlaid Category Tags (Top-Left) */
.see-portfolio-categories-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10; /* Ensure labels are above media */
  display: flex;
  flex-wrap: wrap; /* Allow tags to wrap if many */
  gap: 6px;
  pointer-events: none; /* So they don't interfere with link or media events */
}

.see-portfolio-category-tag {
  background-color: rgba(0, 0, 0, 0.25); /* Black background, 25% opacity */
  color: white;
  padding: 5px 10px;
  border-radius: 15px; /* More rounded tags */
  font-size: 11px;
  font-weight: 500;
  text-transform: capitalize;
  letter-spacing: 0.3px;
  line-height: 1;
  white-space: nowrap;
}

/* Overlaid Title Tag (Bottom-Left) */
.see-portfolio-title-overlay {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 10; /* Ensure labels are above media */
  pointer-events: none; /* So they don't interfere with link or media events */
}

.see-portfolio-title-tag {
  background-color: rgba(255, 255, 255, 0.5); /* White background, 50% opacity */
  color: black; /* Black font for title */
  padding: 6px 12px;
  border-radius: 15px; /* More rounded tag */
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3; /* Adjusted for better multi-line spacing */
  display: inline-block;
 /*  max-width: calc(100% - 24px); Max width relative to padding */
  white-space: normal;
  overflow-wrap: break-word; /* Break long words if necessary */
  word-break: break-word; /* Ensure words break to prevent overflow */
}

/* Responsive Design Adjustments */
@media (max-width: 768px) {
  .see-portfolio-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
  }

  .see-portfolio-filters {
    padding: 10px;
    gap: 6px;
  }

  .see-filter-btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .see-portfolio-categories-overlay {
    top: 8px;
    left: 8px;
    gap: 4px;
  }

  .see-portfolio-category-tag {
    padding: 4px 8px;
    font-size: 10px;
  }

  .see-portfolio-title-overlay {
    bottom: 8px;
    left: 8px;
  }

  .see-portfolio-title-tag {
    padding: 5px 10px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .see-portfolio-grid {
    grid-template-columns: repeat(auto-fill, minmax(100%, 1fr)); /* Full width on very small screens */
    gap: 12px;
  }
  .see-portfolio-item {
    aspect-ratio: 4 / 3; /* Adjust aspect ratio for smaller screens if needed */
  }
}

/* Loading Animation */
.see-portfolio-grid.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.see-portfolio-grid.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  border: 3px solid #e0e0e0; /* Lighter border for loader */
  border-top: 3px solid #555; /* Darker top border for loader */
  border-radius: 50%;
  animation: spin 1s linear infinite;
  transform: translate(-50%, -50%);
  z-index: 1000;
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Filter Animation */
.see-portfolio-item.filtering-out {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.see-portfolio-item.filtering-in {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s; /* Add slight delay */
}

/* Dark theme support (basic example, can be expanded) */
@media (prefers-color-scheme: dark) {
  .see-portfolio-filters {
    background-color: #2d3748; /* Darker gray for filter bar */
  }

  .see-filter-btn {
    /* Inactive in dark mode */
    background-color: rgba(255, 255, 255, 0.15); /* Light background with opacity */
    color: #e2e8f0; /* Light text */
  }

  .see-filter-btn.active {
    /* Active in dark mode */
    background-color: #e2e8f0; /* Light background */
    color: #1a202c; /* Dark text */
  }

  .see-filter-btn:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.25);
  }

  .see-portfolio-item {
    background-color: #2d3748; /* Dark card background */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }

  .see-portfolio-item:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  }

  .see-portfolio-category-tag {
    background-color: rgba(0, 0, 0, 0.4); /* Darker semi-transparent black */
    color: #e2e8f0;
  }

  .see-portfolio-title-tag {
    background-color: rgba(0, 0, 0, 0.5); /* Dark semi-transparent for title bg */
    color: #e2e8f0; /* Light text for title */
  }

  .see-portfolio-image,
  .see-portfolio-gif,
  .see-portfolio-video {
    background-color: rgba(255, 255, 255, 0.05); /* Lighter background for letterboxing in dark mode */
  }
}
