/**
 * Showcase Widget Styles - Version 2.0 FIXED
 */

.showcase-widget {
    --primary-color: #8777E0;
    --secondary-color: #81C0FF;
    --bg-color: #0f0f1e;
    --bg-secondary: #1a1a2e;
    --text-color: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --fade-color: #0f0f1e;
    --fade-width: 100px;
    
    background: linear-gradient(180deg, var(--bg-color) 0%, var(--bg-secondary) 100%);
    color: var(--text-color);
    position: relative;
    overflow: visible; /* CHANGED: Allow shadows to render outside */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.showcase-widget * {
    box-sizing: border-box;
}

.showcase-widget.no-gradient {
    background: var(--bg-color);
}

.showcase-widget::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(135, 119, 224, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.showcase-widget.no-decoration::after {
    display: none;
}

.showcase-container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Header */
.showcase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 60px;
    flex-wrap: wrap;
    gap: 20px;
}

.header-content h2 {
    font-size: 3.5rem;
    font-weight: 800;
    margin: 0 0 15px 0;
}

.showcase-widget.gradient-title .header-content h2 {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-content p {
    font-size: 1.1rem;
    margin: 0;
}

.view-all-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-color);
    padding: 15px 35px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(135, 119, 224, 0.3);
    display: inline-block;
}

.view-all-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(135, 119, 224, 0.5);
}

/* Featured Project - with 3D tilt hover effect */
.featured-project {
    backdrop-filter: blur(15px);
    border: 1px solid rgba(129, 192, 255, 0.2);
    padding: 40px;
    margin-bottom: 50px;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    align-items: center;
    position: relative;
    overflow: visible; /* Allow 3D effect to show */
    background: rgba(129, 192, 255, 0.05);
    border-radius: 30px;
    transform-style: preserve-3d;
    perspective: 1500px;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.6s ease;
}

.showcase-widget.featured-shadow .featured-project {
    box-shadow: 0 20px 20px rgba(135, 119, 224, 0.3);
}

/* Cool 3D tilt hover effect */
.featured-project:hover {
    transform: rotateX(2deg) rotateY(-3deg) scale(1.02);
    box-shadow: 0 30px 80px rgba(135, 119, 224, 0.4), 
                0 15px 40px rgba(129, 192, 255, 0.3);
}

/* Disable 3D effects on mobile to prevent blur */
@media (max-width: 768px) {
    .featured-project {
        transform-style: flat; /* Disable 3D on mobile */
    }
    
    .featured-project:hover {
        transform: translateY(-2px) scale(1.01);
    }
    
    .featured-image {
        transform-style: flat;
    }
    
    .featured-project:hover .featured-image {
        transform: translateZ(0) scale(1.02);
    }
    
    .featured-project:hover .featured-image img {
        transform: translateZ(0) scale(1.02);
    }
}

.showcase-widget.no-featured-scale .featured-project:hover {
    transform: none;
}

/* Image pops out on hover */
.featured-image {
    width: 100%;
    height: 400px;
    border-radius: 0;
    background: transparent; /* Transparent background for webp mockups */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.3rem;
    overflow: visible; /* Allow image to pop out */
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    isolation: isolate; /* Create new stacking context */
}

.featured-project:hover .featured-image {
    transform: translateZ(30px) scale(1.05); /* Subtle pop out */
    z-index: 100; /* CHANGED: Much higher z-index to pop above content */
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Show full image including shadows */
    border-radius: 0; /* No border radius to show full mockup */
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    background: transparent; /* Ensure no background on img element */
    position: relative;
    z-index: 1; /* Ensure image is on top */
    /* Prevent blur on transforms */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-font-smoothing: subpixel-antialiased;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Hide mobile/desktop specific images by default */
.featured-image img.mobile-only,
.featured-image .image-placeholder.mobile-only {
    display: none !important;
}

.featured-image img.desktop-only,
.featured-image .image-placeholder.desktop-only {
    display: block !important;
}

/* Show mobile image on mobile devices - using multiple checks */
@media only screen and (max-width: 768px),
       only screen and (max-device-width: 768px) {
    .featured-image img.mobile-only,
    .featured-image .image-placeholder.mobile-only {
        display: block !important;
    }
    
    .featured-image img.desktop-only,
    .featured-image .image-placeholder.desktop-only {
        display: none !important;
    }
}

/* Additional mobile detection for touch devices */
@media (hover: none) and (pointer: coarse) {
    .featured-image img.mobile-only,
    .featured-image .image-placeholder.mobile-only {
        display: block !important;
    }
    
    .featured-image img.desktop-only,
    .featured-image .image-placeholder.desktop-only {
        display: none !important;
    }
}

.featured-project:hover .featured-image img {
    transform: translateZ(0) scale(1.15); /* Increased zoom from 1.05 to 1.15 for better detail */
}

.featured-image .image-placeholder {
    color: var(--text-color);
    text-align: center;
    padding: 20px;
}

.featured-badge {
    display: inline-block;
    background: rgba(135, 119, 224, 0.2);
    border: 1px solid var(--primary-color);
    color: var(--secondary-color);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.featured-content h3 {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 0 20px 0;
    color: var(--text-color);
}

.featured-content h3 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.featured-content h3 a:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.featured-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    line-height: 1.8;
    margin: 0 0 25px 0;
}

.featured-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tag {
    background: rgba(135, 119, 224, 0.1);
    border: 1px solid rgba(135, 119, 224, 0.3);
    color: rgba(255, 255, 255, 0.8);
    padding: 8px 16px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Carousel Section */
.carousel-section {
    margin-top: 60px;

}

.carousel-section h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 30px 0;
    color: var(--text-color);
}

.carousel-wrapper {
    position: relative;
    overflow: visible; /* CHANGED: Allow shadows to show */
    padding: 0 20px;
    margin: 0 -20px;
}

.carousel-wrapper.arrows-sides {
    padding: 0 60px;
}

.carousel-wrapper.arrows-sides .side-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 15;
    width: 50px;
    height: 50px;
}

.carousel-wrapper.arrows-sides .nav-prev {
    left: 10px;
}

.carousel-wrapper.arrows-sides .nav-next {
    right: 10px;
}

/* Fade overlays - DISABLED */
.fade-overlay {
    display: none !important; /* Disabled fade effect */
}

/* Carousel - smooth scrolling */
.carousel {
    display: flex;
    gap: 25px;
    overflow-x: auto;
    overflow-y: visible; /* CHANGED: Allow vertical overflow for shadows */
    padding: 30px 0 60px 0; /* Increased padding for overflow space */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) rgba(135, 119, 224, 0.1);
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    scroll-behavior: smooth;
}

/* Infinite carousel: Hide scroll behavior during repositioning */
.carousel.repositioning {
    scroll-behavior: auto !important;
}

/* Clone cards for infinite scroll */
.carousel-card.clone-start,
.carousel-card.clone-end {
    opacity: 1; /* Keep visible for seamless loop */
}

/* Mobile: Snap scroll for centered cards */
@media (max-width: 768px) {
    .carousel {
        scroll-snap-type: x mandatory;
        scroll-padding: 0 20px;
    }
    
    .carousel-card {
        scroll-snap-align: center;
        scroll-snap-stop: always;
    }
}

.showcase-widget.hide-scrollbar .carousel {
    scrollbar-width: none;

}

.showcase-widget.hide-scrollbar .carousel::-webkit-scrollbar {
    display: none;
}

.carousel::-webkit-scrollbar {
    height: 8px;
}

.carousel::-webkit-scrollbar-track {
    background: rgba(135, 119, 224, 0.1);
    border-radius: 10px;
}

.carousel::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 10px;
}

/* Carousel Card - SIMPLE transitions only */
.carousel-card {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(135, 119, 224, 0.2);
    background: rgba(135, 119, 224, 0.05);
    padding: 25px;
    border-radius: 20px;
    cursor: pointer;
    flex-shrink: 0;
    min-width: 350px;
    max-width: 350px;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s ease, box-shadow 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.carousel-card.is-active {
    border-color: var(--primary-color);
    box-shadow: 0 18px 50px rgba(135, 119, 224, 0.22);
    transform: scale(1.05) translateY(-8px); /* Lift and scale on active */
}

/* Mobile: Different active state - glow effect instead of scale */
@media (max-width: 768px) {
    .carousel-card.is-active {
        transform: translateY(-5px); /* Small lift only, no scale */
        box-shadow: 0 0 0 3px var(--primary-color), 0 12px 35px rgba(135, 119, 224, 0.4);
        border-color: var(--primary-color);
    }
}

/* Hover effects - ONLY when not dragging */
.carousel:not(.is-dragging) .carousel-card:hover {
    transform: translateY(-8px) scale(1.03);
    border-color: var(--secondary-color);
    box-shadow: 0 12px 40px rgba(129, 192, 255, 0.3);
}

.showcase-widget.hover-none .carousel-card:hover {
    transform: none;
}

.showcase-widget.hover-lift .carousel:not(.is-dragging) .carousel-card:hover {
    transform: translateY(-10px);
}

.showcase-widget.hover-scale .carousel:not(.is-dragging) .carousel-card:hover {
    transform: scale(1.05);
}

.showcase-widget.hover-lift-scale .carousel:not(.is-dragging) .carousel-card:hover {
    transform: translateY(-10px) scale(1.05);
}

.showcase-widget.carousel-hover-shadow .carousel-card:hover {
    box-shadow: 0 20px 50px rgba(129, 192, 255, 0.3);
}

/* Dragging state */
.carousel.is-dragging {
    cursor: grabbing;
    user-select: none;
    scroll-behavior: auto !important;
}

.carousel.is-dragging .carousel-card {
    transition: none !important;
    /* pointer-events removed to allow click detection */
}

.carousel-image {
    width: 100%;
    height: 180px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
    overflow: hidden;
}

.carousel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.carousel-image .image-placeholder {
    color: var(--text-color);
    text-align: center;
    padding: 15px;
}

.carousel-card h4 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: var(--text-color);
}

.carousel-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* Navigation Arrows */
.carousel-navigation {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 15;
}

.nav-arrow {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(135, 119, 224, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    background: rgba(255, 255, 255, 0.05);
    transition: opacity 0.3s ease, background-color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.nav-arrow:hover {
    background: rgba(135, 119, 224, 0.2);
}

.nav-arrow:active {
    transform: scale(0.95);
}

.nav-arrow:disabled {
    cursor: not-allowed;
    opacity: 0.3;
}

.nav-arrow svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .featured-project {
        grid-template-columns: 1fr;
    }
    
    .header-content h2 {
        font-size: 2.5rem;
    }
    
    .featured-content h3 {
        font-size: 2rem;
    }
    
    .carousel-wrapper.arrows-sides {
        padding: 0 45px;
    }
    
    .carousel-wrapper.arrows-sides .fade-overlay.fade-left {
        left: 45px;
    }
    
    .carousel-wrapper.arrows-sides .fade-overlay.fade-right {
        right: 45px;
    }
}

@media (max-width: 768px) {
    .showcase-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-content h2 {
        font-size: 2rem;
    }
    
    .featured-project {
        padding: 20px;
        gap: 20px;
        cursor: pointer; /* Make it clear it's clickable */
        -webkit-tap-highlight-color: rgba(129, 192, 255, 0.3); /* iOS tap feedback */
    }
    
    /* Mobile: Add active/tap lift effect */
    .featured-project:active {
        transform: translateY(-5px) scale(1.01);
        box-shadow: 0 15px 40px rgba(135, 119, 224, 0.4);
        transition: transform 0.15s ease, box-shadow 0.15s ease;
    }
    
    .featured-content h3 {
        font-size: 1.5rem;
    }
    
    .featured-content p {
        font-size: 0.95rem;
    }
    
    .featured-image {
        height: 280px; /* Smaller on mobile */
    }
    
    .carousel-wrapper {
        padding: 0 15px;
        margin: 0 -15px;
    }
    
    .carousel-wrapper.arrows-sides {
        padding: 0 50px; /* More space for arrows */
    }
    
    .carousel-wrapper.arrows-sides .nav-prev {
        left: 5px;
        width: 40px;
        height: 40px;
    }
    
    .carousel-wrapper.arrows-sides .nav-next {
        right: 5px;
        width: 40px;
        height: 40px;
    }
    
    .carousel-wrapper.arrows-sides .fade-overlay.fade-left {
        left: 50px; /* Account for arrow space */
    }
    
    .carousel-wrapper.arrows-sides .fade-overlay.fade-right {
        right: 50px; /* Account for arrow space */
    }
    
    .fade-overlay {
        --fade-width: 50px;
    }
    
    /* Better mobile card sizing - fit between arrows */
    .carousel-card {
        min-width: calc(100vw - 120px); /* Full width minus arrow space and padding */
        max-width: calc(100vw - 120px);
        padding: 20px;
    }
    
    /* When arrows are on bottom, use more width */
    .carousel-wrapper.arrows-bottom ~ .carousel-section .carousel-card {
        min-width: calc(85vw - 40px);
        max-width: calc(85vw - 40px);
    }
    
    .carousel-image {
        height: 150px; /* Smaller images on mobile */
    }
    
    .carousel-card h4 {
        font-size: 1.1rem;
        line-height: 1.3;
        white-space: normal; /* Allow text wrapping */
        overflow: visible;
        text-overflow: clip;
    }
    
    .carousel-card p {
        font-size: 0.85rem;
        line-height: 1.4;
    }
}

@media (max-width: 480px) {
    .header-content h2 {
        font-size: 1.75rem;
    }
    
    .view-all-btn {
        padding: 12px 25px;
        font-size: 0.9rem;
    }
    
    .featured-project {
        padding: 15px;
    }
    
    .featured-image {
        height: 220px;
    }
    
    .featured-content h3 {
        font-size: 1.3rem;
    }
    
    .carousel-wrapper {
        padding: 0 10px;
        margin: 0 -10px;
    }
    
    .carousel-wrapper.arrows-sides {
        padding: 0 30px;
    }
    
    .carousel-wrapper.arrows-sides .fade-overlay.fade-left {
        left: 30px;
    }
    
    .carousel-wrapper.arrows-sides .fade-overlay.fade-right {
        right: 30px;
    }
    
    /* Even more responsive on very small screens */
    .carousel-card {
        min-width: calc(90vw - 30px);
        max-width: calc(90vw - 30px);
        padding: 15px;
    }
    
    .carousel-image {
        height: 130px;
    }
}