/**
 * Luxury Carousel Animations
 * Parallax Depth & Magnetic Hover Effects
 * VDESIGN INTERIEUR
 */

/* ============================================
   PARALLAX DEPTH SYSTEM
   ============================================ */

/* Enable 3D transforms and perspective */
.carousel-container,
[class*="carousel"],
[class*="slider"],
[class*="project"] {
    transform-style: preserve-3d;
    perspective: 1200px;
}

/* Parallax Layer Base */
.parallax-layer {
    position: relative;
    will-change: transform;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Layer 1 - Background (slowest movement - 30%) */
.parallax-layer-1,
.carousel-card .project-image img,
.carousel-item .project-image img,
[class*="project"] img {
    transform: translateZ(-20px) scale(1.02);
    will-change: transform;
}

/* Layer 2 - Image Overlay (medium movement - 60%) */
.parallax-layer-2,
.carousel-card .image-overlay,
.carousel-item .image-overlay,
[class*="overlay"] {
    transform: translateZ(-10px) scale(1.01);
    will-change: transform;
}

/* Layer 3 - Border/Frame (faster movement - 90%) */
.parallax-layer-3,
.carousel-card .project-border,
.carousel-item .project-frame,
[class*="border"],
[class*="frame"] {
    transform: translateZ(5px);
    will-change: transform;
}

/* Layer 4 - Text Content (fastest - 100%, baseline) */
.parallax-layer-4,
.carousel-card .project-info,
.carousel-item .project-title,
.carousel-item .project-description,
[class*="project-info"],
[class*="project-title"],
[class*="project-desc"] {
    transform: translateZ(10px);
    will-change: transform;
}


/* ============================================
   MAGNETIC HOVER EFFECT
   ============================================ */

/* Magnetic Container Setup */
.magnetic-card,
.carousel-card,
.carousel-item,
[class*="project-card"],
[class*="portfolio-item"] {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform;
    cursor: pointer;
}

/* Magnetic Active State */
.magnetic-card.is-magnetic-active {
    transition: transform 0.15s ease-out;
    z-index: 10;
}

/* Magnetic Card Hover Glow */
.magnetic-card::before,
.carousel-card::before,
.carousel-item::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg,
            hsl(var(--primary) / 0.15),
            hsl(var(--primary-glow) / 0.1));
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: -1;
    filter: blur(20px);
}

.magnetic-card:hover::before,
.carousel-card:hover::before,
.carousel-item:hover::before {
    opacity: 1;
}

/* Enhanced Depth on Hover */
.magnetic-card:hover,
.carousel-card:hover,
.carousel-item:hover {
    transform: translateZ(20px) scale(1.02);
}

/* Smooth Return to Neutral Position */
.magnetic-card.is-returning {
    transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}


/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* GPU Acceleration Hints */
.parallax-layer,
.magnetic-card,
.carousel-card,
.carousel-item {
    -webkit-transform: translateZ(0);
    -moz-transform: translateZ(0);
    -ms-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000px;
    perspective: 1000px;
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {

    .parallax-layer,
    .magnetic-card,
    .carousel-card,
    .carousel-item {
        transform: none !important;
        transition: none !important;
    }

    .magnetic-card::before,
    .carousel-card::before,
    .carousel-item::before {
        display: none !important;
    }
}


/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

/* Disable magnetic hover on touch devices */
@media (hover: none) and (pointer: coarse) {

    .magnetic-card.is-magnetic-active,
    .carousel-card.is-magnetic-active,
    .carousel-item.is-magnetic-active {
        transform: none !important;
    }
}

/* Reduce parallax intensity on smaller screens */
@media (max-width: 768px) {

    .carousel-container,
    [class*="carousel"],
    [class*="slider"] {
        perspective: 800px;
    }

    .parallax-layer-1,
    .carousel-card .project-image img,
    .carousel-item .project-image img {
        transform: translateZ(-10px) scale(1.01);
    }

    .parallax-layer-2 {
        transform: translateZ(-5px);
    }

    .parallax-layer-3 {
        transform: translateZ(2px);
    }

    .parallax-layer-4 {
        transform: translateZ(5px);
    }
}


/* ============================================
   ENHANCED CAROUSEL TRANSITIONS
   ============================================ */

/* Smooth Slide Transitions */
.carousel-track,
.carousel-wrapper,
[class*="carousel-inner"],
[class*="slider-track"] {
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Card Entry Animation - DISABLED for smoother experience */
/*
@keyframes cardReveal {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
*/

/* Animation disabled - using CSS transitions instead
.carousel-card,
.carousel-item,
[class*="project-card"] {
    animation: cardReveal 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) backwards;
}
*/

.carousel-card:nth-child(1) {
    animation-delay: 0.1s;
}

.carousel-card:nth-child(2) {
    animation-delay: 0.2s;
}

.carousel-card:nth-child(3) {
    animation-delay: 0.3s;
}

.carousel-card:nth-child(4) {
    animation-delay: 0.4s;
}

.carousel-card:nth-child(5) {
    animation-delay: 0.5s;
}


/* ============================================
   LUXURY MICRO-INTERACTIONS
   ============================================ */

/* Image Scale on Hover */
.carousel-card:hover .project-image img,
.carousel-item:hover img {
    transform: translateZ(-20px) scale(1.08);
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Enhanced Text Reveal on Hover - Clip Path Wipe Effect */
.carousel-card .project-info,
.carousel-item .project-title {
    clip-path: inset(0 100% 0 0);
    transform: translateZ(10px);
    opacity: 0.7;
    transition:
        clip-path 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55),
        transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55),
        opacity 0.4s ease;
}

.carousel-card:hover .project-info,
.carousel-item:hover .project-title {
    clip-path: inset(0 0 0 0);
    transform: translateZ(15px);
    opacity: 1;
}

/* Word-by-word reveal for titles (if split into spans) */
.carousel-card .project-title span,
.carousel-item .project-title span {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px) rotateX(-90deg);
    transform-origin: 50% 100%;
    animation: wordReveal 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.carousel-card:hover .project-title span:nth-child(1),
.carousel-item:hover .project-title span:nth-child(1) {
    animation-delay: 0.05s;
}

.carousel-card:hover .project-title span:nth-child(2),
.carousel-item:hover .project-title span:nth-child(2) {
    animation-delay: 0.1s;
}

.carousel-card:hover .project-title span:nth-child(3),
.carousel-item:hover .project-title span:nth-child(3) {
    animation-delay: 0.15s;
}

.carousel-card:hover .project-title span:nth-child(4),
.carousel-item:hover .project-title span:nth-child(4) {
    animation-delay: 0.2s;
}

@keyframes wordReveal {
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0deg);
    }
}


/* Subtle Border Glow */
.carousel-card,
.carousel-item {
    border: 1px solid hsl(var(--border));
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.carousel-card:hover,
.carousel-item:hover {
    border-color: hsl(var(--primary) / 0.4);
    box-shadow:
        0 0 20px hsl(var(--primary) / 0.2),
        0 10px 40px -10px hsl(0 0% 0% / 0.5);
}