/*
 * MOSAIC SLIDESHOW
 * Animated tile grid for project showcase
 */

.mosaic-slideshow-container {
  width: 100%;
  padding: 4rem 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 600px;
}

.mosaic-slideshow {
  width: 90vw;
  max-width: 1200px;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  background: rgba(15, 23, 42, 0.5);
}

.mosaic-grid {
  display: grid;
  gap: 6px;
  width: 100%;
  height: 100%;
  padding: 6px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  grid-auto-rows: 1fr;
}

.mosaic-tile {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1),
              transform 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.mosaic-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mosaic-tile:hover::before {
  opacity: 1;
}

.mosaic-tile.show {
  opacity: 1;
  transform: scale(1);
}

/* Add subtle animation on hover */
.mosaic-tile:hover {
  transform: scale(1.05);
  z-index: 10;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .mosaic-slideshow {
    width: 95vw;
    aspect-ratio: 3/4;
  }

  .mosaic-grid {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 4px;
    padding: 4px;
  }

  .mosaic-tile {
    border-radius: 6px;
  }
}

@media (max-width: 480px) {
  .mosaic-grid {
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  }
}

/* Loading state */
.mosaic-slideshow.loading .mosaic-tile {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Performance optimizations */
.mosaic-tile {
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .mosaic-tile {
    transition: none;
    animation: none;
  }

  .mosaic-tile.show {
    opacity: 1;
    transform: scale(1);
  }
}
