/**
 * CNS Logo Carousel Styles
 */

/* Container */
.cns-logo-carousel-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding: 20px 0;
}

/* Carousel wrapper */
.cns-logo-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Logo track with continuous animation */
.cns-logo-track {
    display: flex;
    align-items: center;
    animation: marquee 30s linear infinite;
    width: fit-content;
    --animation-distance: -50%;
}

/* Marquee animation */
@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(var(--animation-distance, -50%));
    }
}

/* Logo items */
.cns-logo-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0 50px;
    transition: all 0.3s ease;
}

.cns-logo-item img {
    height: 60px;
    width: auto;
    object-fit: contain;
    transition: all 0.3s ease;
}

/* Pause on hover */
.cns-logo-carousel-container.pause-on-hover:hover .cns-logo-track {
    animation-play-state: paused;
}

/* Fade edges effect */
.cns-logo-carousel-container.fade-edges::before,
.cns-logo-carousel-container.fade-edges::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 150px;
    z-index: 2;
    pointer-events: none;
}

.cns-logo-carousel-container.fade-edges::before {
    left: 0;
    background: linear-gradient(to right, 
        rgba(255, 255, 255, 1) 0%, 
        rgba(255, 255, 255, 0.8) 30%,
        rgba(255, 255, 255, 0.4) 60%,
        rgba(255, 255, 255, 0) 100%);
}

.cns-logo-carousel-container.fade-edges::after {
    right: 0;
    background: linear-gradient(to left, 
        rgba(255, 255, 255, 1) 0%, 
        rgba(255, 255, 255, 0.8) 30%,
        rgba(255, 255, 255, 0.4) 60%,
        rgba(255, 255, 255, 0) 100%);
}

/* Dark background fade edges */
.elementor-section.elementor-section-boxed.elementor-background-dark .cns-logo-carousel-container.fade-edges::before {
    background: linear-gradient(to right, 
        rgba(0, 0, 0, 1) 0%, 
        rgba(0, 0, 0, 0.8) 30%,
        rgba(0, 0, 0, 0.4) 60%,
        rgba(0, 0, 0, 0) 100%);
}

.elementor-section.elementor-section-boxed.elementor-background-dark .cns-logo-carousel-container.fade-edges::after {
    background: linear-gradient(to left, 
        rgba(0, 0, 0, 1) 0%, 
        rgba(0, 0, 0, 0.8) 30%,
        rgba(0, 0, 0, 0.4) 60%,
        rgba(0, 0, 0, 0) 100%);
}

/* Grayscale effect */
.cns-logo-carousel.grayscale-effect .cns-logo-item img {
    filter: grayscale(100%);
    opacity: 0.6;
}

.cns-logo-carousel.grayscale-effect .cns-logo-item:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

/* Hover effects */
.cns-logo-carousel.hover-scale .cns-logo-item:hover {
    transform: scale(1.1);
}

.cns-logo-carousel.hover-brightness .cns-logo-item:hover img {
    filter: brightness(1.2);
}

.cns-logo-carousel.hover-both .cns-logo-item:hover {
    transform: scale(1.1);
}

.cns-logo-carousel.hover-both .cns-logo-item:hover img {
    filter: brightness(1.2);
}

/* Combined grayscale and hover effects */
.cns-logo-carousel.grayscale-effect.hover-scale .cns-logo-item:hover img,
.cns-logo-carousel.grayscale-effect.hover-both .cns-logo-item:hover img {
    filter: grayscale(0%) brightness(1.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cns-logo-item {
        margin: 0 25px;
    }
    
    .cns-logo-item img {
        height: 40px;
    }
    
    .cns-logo-carousel-container.fade-edges::before,
    .cns-logo-carousel-container.fade-edges::after {
        width: 50px;
    }
}

@media (max-width: 480px) {
    .cns-logo-item {
        margin: 0 15px;
    }
    
    .cns-logo-item img {
        height: 30px;
    }
    
    .cns-logo-carousel-container.fade-edges::before,
    .cns-logo-carousel-container.fade-edges::after {
        width: 30px;
    }
}

/* Smooth scrolling for better performance */
.cns-logo-track {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Ensure logos don't get distorted */
.cns-logo-item img {
    max-width: 200px;
    height: auto;
    object-fit: contain;
}

/* Alternative fade gradient for colored backgrounds */
.elementor-section[data-settings*="background_background"] .cns-logo-carousel-container.fade-edges::before,
.elementor-section[data-settings*="background_background"] .cns-logo-carousel-container.fade-edges::after {
    background: inherit;
}

/* Blue background specific fade */
.elementor-section[style*="background-color: #035182"] .cns-logo-carousel-container.fade-edges::before {
    background: linear-gradient(to right, 
        #035182 0%, 
        rgba(3, 81, 130, 0.8) 30%,
        rgba(3, 81, 130, 0.4) 60%,
        rgba(3, 81, 130, 0) 100%) !important;
}

.elementor-section[style*="background-color: #035182"] .cns-logo-carousel-container.fade-edges::after {
    background: linear-gradient(to left, 
        #035182 0%, 
        rgba(3, 81, 130, 0.8) 30%,
        rgba(3, 81, 130, 0.4) 60%,
        rgba(3, 81, 130, 0) 100%) !important;
}