/* ==========================================================================
   CLIENTS MARQUEE — MATERIAL DESIGN 3 (Redesign)
   Clean, modern, and reliable horizontal scrolling with M3 cards.
   ========================================================================== */

/* 1. Section Container */
.clients-section {
    position: relative;
    padding: 80px 0;
    overflow: hidden;
    background: transparent;
    display: block;
}

/* 2. Marquee Container (The Track) */
/* Wrapper for each row */
.clients-marquee-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    overflow: hidden;
    margin-bottom: 24px;
    /* Spacing between rows */
    /* M3 Surface Container styling for the track background (optional, kept transparent for cleaner look) */
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.clients-marquee {
    display: flex;
    width: fit-content;
    /* Hardware acceleration for smooth scrolling */
    transform: translate3d(0, 0, 0);
}

.clients-marquee-track {
    display: flex;
    align-items: center;
    gap: 24px;
    /* M3 standard spacing */
    padding: 16px 0;
    /* Vertical breathing room for shadows */
    animation: scrollHorizontal 60s linear infinite;
}

.clients-marquee-reverse .clients-marquee-track {
    animation: scrollHorizontalReverse 60s linear infinite;
}

/* 3. M3 Logo Cards */
.client-logo-item {
    /* M3 Card Styles */
    position: relative;
    flex: 0 0 auto;
    width: 180px;
    height: 100px;

    /* Surface Container Low */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);

    /* Shape: Medium */
    border-radius: 16px;

    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;

    /* Interaction */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.0, 0, 1.0);
    /* M3 Standard Easing */
}

/* Hover State - Elevation 2 */
.client-logo-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 4px 8px 3px rgba(0, 0, 0, 0.15),
        0 1px 3px rgba(0, 0, 0, 0.3);
}

/* 4. Logo Styling */
.client-logo {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    object-fit: contain;

    /* Monochrome by default */
    filter: grayscale(100%) opacity(0.7);
    transition: all 0.3s ease;
}

/* Color reveal on hover */
.client-logo-item:hover .client-logo {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.1);
}

/* 5. Animations */
@keyframes scrollHorizontal {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

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

    100% {
        transform: translateX(0);
    }
}

/* Pause on hover interaction */
.clients-marquee-wrapper:hover .clients-marquee-track {
    animation-play-state: paused;
}

/* 6. Dark/Light Mode Adaptability (using CSS variables if available, falling back to dark) */
[data-theme="light"] .client-logo-item {
    background: #F3F3FA;
    /* Surface Container Low Light */
    border: 1px solid #E0E0E0;
    box-shadow: none;
}

[data-theme="light"] .client-logo {
    filter: grayscale(100%) opacity(0.6);
}

[data-theme="light"] .client-logo-item:hover {
    background: #FFFFFF;
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 4px 8px 3px rgba(0, 0, 0, 0.05),
        0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .client-logo-item {
        width: 140px;
        height: 80px;
        border-radius: 12px;
        padding: 16px;
    }

    .clients-marquee-track {
        gap: 16px;
    }
}