/**
 * Brand Showcase - Infinite Carousel Styles
 * Modern infinite scrolling brand showcase with subtle gradient background
 */

.brand-showcase {
    position: relative;
    padding: 20px 0;
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.brand-showcase-container {
    max-width: 100%;
    margin: 0 auto;
}

.brand-showcase-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 0 20px;
}

.brand-showcase-title {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.brand-showcase-subtitle {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    font-weight: 400;
}

/* Carousel Row Container - Provides vertical space for hover */
.brand-carousel-row {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
    padding: 16px 0;
    overflow: visible;
}

.brand-carousel-row:last-child {
    margin-bottom: 0;
}

/* Carousel Mask Container - Handles horizontal fade effect */
.brand-carousel-mask {
    position: relative;
    width: 100%;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

/* Carousel Track */
.brand-carousel-track {
    display: flex;
    gap: 48px;
    width: fit-content;
    will-change: transform;
    contain: layout style paint;
}

/* Brand Logo Wrapper - Contains overflow from scaled images */
.brand-logo-wrapper {
    min-width: 140px;
    height: 80px;
    overflow: hidden;
    border-radius: 12px;
}

/* LTR Animation (Row 1) */
.brand-carousel-row[data-direction="ltr"] .brand-carousel-track {
    animation: scrollLeft 60s linear infinite;
}

/* RTL Animation (Row 2) */
.brand-carousel-row[data-direction="rtl"] .brand-carousel-track {
    animation: scrollRight 60s linear infinite;
}

/* Pause on hover */
.brand-carousel-row:hover .brand-carousel-track {
    animation-play-state: paused;
}

/* Keyframe Animations */
@keyframes scrollLeft {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

@keyframes scrollRight {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0);
    }
}

/* Brand Logo Item */
.brand-logo-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    height: 80px;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.brand-logo-item img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: grayscale(100%) opacity(0.7);
    transition: filter 0.3s ease, transform 0.3s ease;
}

/* Hover Effects */
.brand-logo-wrapper:hover {
    position: relative;
    z-index: 10;
}

.brand-logo-wrapper:hover .brand-logo-item {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 1);
}

.brand-logo-wrapper:hover img {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.1);
}

/* Focus state for accessibility */
.brand-logo-item:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.brand-logo-item:focus img {
    filter: grayscale(0%) opacity(1);
}

/* Tablet Styles */
@media (max-width: 1024px) {
    .brand-showcase {
        padding: 20px 0;
    }
    
    .brand-showcase-header {
        margin-bottom: 32px;
    }
    
    .brand-showcase-title {
        font-size: 28px;
    }
    
    .brand-showcase-subtitle {
        font-size: 14px;
    }
    
    .brand-carousel-row {
        padding: 12px 0;
    }
    
    .brand-carousel-track {
        gap: 40px;
    }
    
    .brand-logo-wrapper {
        min-width: 120px;
        height: 70px;
        border-radius: 10px;
    }
    
    .brand-logo-item {
        min-width: 120px;
        height: 70px;
        padding: 12px 20px;
    }
    
    .brand-carousel-row[data-direction="ltr"] .brand-carousel-track,
    .brand-carousel-row[data-direction="rtl"] .brand-carousel-track {
        animation-duration: 50s;
    }
}

/* Mobile Styles */
@media (max-width: 640px) {
    .brand-showcase {
        padding: 20px 0;
    }
    
    .brand-showcase-header {
        margin-bottom: 24px;
    }
    
    .brand-showcase-title {
        font-size: 24px;
    }
    
    .brand-showcase-subtitle {
        font-size: 13px;
    }
    
    /* Hide second row on mobile for cleaner look */
    .brand-carousel-row {
        padding: 10px 0;
    }
    
    .brand-carousel-row[data-direction="rtl"] {
        display: none;
    }
    
    .brand-carousel-track {
        gap: 32px;
    }
    
    .brand-logo-wrapper {
        min-width: 100px;
        height: 60px;
        border-radius: 8px;
    }
    
    .brand-logo-item {
        min-width: 100px;
        height: 60px;
        padding: 10px 16px;
        border-radius: 8px;
    }
    
    .brand-carousel-row[data-direction="ltr"] .brand-carousel-track {
        animation-duration: 40s;
    }
    
    .brand-logo-wrapper:hover .brand-logo-item {
        transform: translateY(-4px);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .brand-carousel-track {
        animation: none !important;
    }
    
    .brand-carousel-row {
        overflow-x: auto;
        overflow-y: hidden;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    
    .brand-carousel-row::-webkit-scrollbar {
        height: 6px;
    }
    
    .brand-carousel-row::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.05);
        border-radius: 3px;
    }
    
    .brand-carousel-row::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 3px;
    }
}

/* Performance Optimizations */
.brand-showcase * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* GPU Acceleration */
.brand-carousel-track,
.brand-logo-item {
    transform: translateZ(0);
    backface-visibility: hidden;
}
