/**
 * 3D Infinite Gallery Styles
 * File: assets/css/3d-infinite-gallery.css
 */

/* Gallery Wrapper */
.gallery-3d-infinite-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* Gallery Container - 3D Parallax with Infinite Scroll */
.gallery-3d-infinite {
  display: flex;
  gap: 24px;
  padding: 40px 60px;
  margin: 0;
  perspective: 1000px;
  transform-style: preserve-3d;
  overflow-x: scroll;
  overflow-y: hidden;
  scroll-behavior: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: relative;
  width: 100%;
  max-width: 100vw;
  cursor: grab;
  list-style: none;
}

.gallery-3d-infinite:active {
  cursor: grabbing;
}

/* Hide scrollbar */
.gallery-3d-infinite::-webkit-scrollbar {
  display: none;
}

/* Gallery Items - 3D Cards */
.gallery-3d-infinite .gallery-item {
  list-style: none;
  margin: 0;
  padding: 0;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  scroll-snap-align: center;
  animation: slideIn 0.8s ease-out backwards;
}

.gallery-3d-infinite .gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-3d-infinite .gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-3d-infinite .gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-3d-infinite .gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-3d-infinite .gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-3d-infinite .gallery-item:nth-child(6) { animation-delay: 0.6s; }

/* 3D Hover Effect */
.gallery-3d-infinite.hover-3d .gallery-item:hover {
  transform: translateZ(60px) scale(1.05);
  z-index: 10;
}

/* Scale Hover Effect */
.gallery-3d-infinite.hover-scale .gallery-item:hover {
  transform: scale(1.08);
  z-index: 10;
}

/* Glow Hover Effect */
.gallery-3d-infinite.hover-glow .gallery-item:hover {
  z-index: 10;
}

.gallery-3d-infinite.hover-glow .gallery-item:hover .gallery-icon::after {
  opacity: 0.8 !important;
}

/* Gallery Icon Container */
.gallery-3d-infinite .gallery-icon {
  position: relative;
  width: 100%;
  height: 350px;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.2),
    0 1px 8px rgba(0, 0, 0, 0.1);
  transform-style: preserve-3d;
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.gallery-3d-infinite .gallery-item:hover .gallery-icon {
  box-shadow: 
    0 30px 60px rgba(0, 0, 0, 0.3),
    0 10px 20px rgba(0, 0, 0, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* 3D Glow Effect */
.gallery-3d-infinite .gallery-icon::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 100%);
  border-radius: 16px;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
  pointer-events: none;
}

.gallery-3d-infinite .gallery-item:hover .gallery-icon::before {
  opacity: 1;
}

/* Links */
.gallery-3d-infinite .gallery-icon a {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
}

/* Images - Fixed Height with Parallax */
.gallery-3d-infinite .gallery-icon img {
  width: 100%;
  height: 350px;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
  filter: brightness(0.95) contrast(1.05);
  border-radius: 16px;
  pointer-events: none;
  user-select: none;
}

/* Parallax Image Movement */
.gallery-3d-infinite .gallery-item:hover .gallery-icon img {
  transform: scale(1.15) translateZ(20px);
  filter: brightness(1) contrast(1.1);
}

/* Slide In Animation */
@keyframes slideIn {
  0% {
    opacity: 0;
    transform: translateX(100px) translateZ(-100px) rotateY(-20deg);
  }
  100% {
    opacity: 1;
    transform: translateX(0) translateZ(0) rotateY(0);
  }
}

/* Continuous Subtle Float */
@keyframes subtleFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.gallery-3d-infinite .gallery-item {
  animation: slideIn 0.8s ease-out backwards, subtleFloat 6s ease-in-out infinite;
}

.gallery-3d-infinite .gallery-item:nth-child(odd) {
  animation-duration: 0.8s, 7s;
}

.gallery-3d-infinite .gallery-item:nth-child(even) {
  animation-duration: 0.8s, 5s;
}

/* Pause float on hover */
.gallery-3d-infinite .gallery-item:hover {
  animation-play-state: paused;
}

/* Backdrop Blur Effect */
.gallery-3d-infinite .gallery-icon::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #667eea, #764ba2, #f093fb, #4facfe);
  border-radius: 16px;
  z-index: -1;
  opacity: 0;
  filter: blur(20px);
  transition: opacity 0.6s ease;
}

.gallery-3d-infinite .gallery-item:hover .gallery-icon::after {
  opacity: 0.6;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .gallery-3d-infinite {
    padding: 40px 40px;
  }
}

@media (max-width: 1024px) {
  .gallery-3d-infinite {
    padding: 30px 30px;
  }
  
  .gallery-3d-infinite .gallery-icon {
    height: 300px;
  }
  
  .gallery-3d-infinite .gallery-icon img {
    height: 300px;
  }
  
  .gallery-3d-infinite.hover-3d .gallery-item:hover {
    transform: translateZ(40px) scale(1.03);
  }
}

@media (max-width: 768px) {
  .gallery-3d-infinite {
    padding: 20px 20px;
  }
  
  .gallery-3d-infinite .gallery-icon {
    height: 280px;
    border-radius: 12px;
  }
  
  .gallery-3d-infinite .gallery-icon img {
    height: 280px;
  }
}

@media (max-width: 480px) {
  .gallery-3d-infinite {
    padding: 20px 15px;
  }
  
  .gallery-3d-infinite .gallery-icon {
    height: 320px;
  }
  
  .gallery-3d-infinite .gallery-icon img {
    height: 320px;
  }
  
  .gallery-3d-infinite.hover-3d .gallery-item:hover {
    transform: translateZ(30px) scale(1.02);
  }
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Loading State */
.gallery-3d-infinite.loading .gallery-item {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Editor Styles */
.elementor-editor-active .gallery-3d-infinite {
  overflow-x: auto;
}

.elementor-editor-active .gallery-3d-infinite .gallery-item {
  animation: none !important;
}