/* Logo Carousel Styles */
.logo-carousel {
    display: flex;
    gap: 60px; /* Reduced from 80px for more consistent spacing */
    animation: scroll 45s linear infinite;
    padding: 20px 0;
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* Base logo item styles */
.logo-item,
.logo-item-large {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    position: relative;
    z-index: 5;
    padding: 15px;
    transition: all 0.3s ease;
}

/* Regular logo item */
.logo-item {
    min-width: 160px; /* Reduced from 180px */
}

.logo-item img {
    max-width: 130px;
    height: auto;
    object-fit: contain;
    transition: all 0.4s ease;
    filter: grayscale(0);
    opacity: 1;
    /* Standardize dimensions */
    min-height: 50px;
    max-height: 60px;
}

/* Larger logo item */
.logo-item-large {
    min-width: 180px; /* Reduced from 220px */
}

.logo-item-large img {
    max-width: 150px;
    height: auto;
    object-fit: contain;
    transition: all 0.4s ease;
    filter: grayscale(0);
    opacity: 1;
    /* Standardize dimensions */
    min-height: 55px;
    max-height: 65px;
}

/* Special fix for CISPA logo which has different proportions */
.logo-item[data-logo="cispa"] img,
.logo-item-large[data-logo="cispa"] img {
    object-fit: contain;
    max-height: 65px;
    width: auto;
}

/* Special fix for BMFTR logo which has extra white space */
.partners-in-hero .logo-item-large img[alt="BMBF"] {
    max-height: 100px; /* Much larger to compensate for white space */
    transform: scale(1.4); /* Additional scaling */
}

.partners-in-hero .logo-item-large:hover img[alt="BMBF"] {
    transform: scale(1.5); /* Even larger on hover */
}

/* Individual logo hover effect */
.logo-item:hover img,
.logo-item-large:hover img {
    opacity: 1;
    transform: scale(1.05); /* Reduced scale for smoother effect */
}

/* Make sure individual logo hover works even when carousel is paused */
.partners-in-hero:hover .logo-item:hover img,
.partners-in-hero:hover .logo-item-large:hover img {
    opacity: 1;
    transform: scale(1.05);
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-100% - 60px));
    }
}

/* Partners Carousel Specific Styles */
.partners-in-hero {
    width: 100%;
    overflow: hidden;
    padding: 40px 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.partners-in-hero .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

.partners-title {
    text-align: center;
    color: #2D3748; /* Darker color for better visibility */
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 30px;
    opacity: 1; /* Changed from 0.9 to 1 for better visibility */
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
    padding: 0 20px;
    text-shadow: none; /* Removed text shadow for better visibility */
}

.partners-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.partners-in-hero .logo-carousel {
    margin: 20px auto;
    display: flex;
    gap: 80px;
    animation: scroll 60s linear infinite;
    width: max-content;
    padding: 15px 0;
}

.partners-in-hero .logo-item {
    flex: 0 0 auto;
    min-width: 180px;
    height: 100px; /* Set a fixed height for all logo items */
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 5; /* Ensure logo items are above other elements */
}

.partners-in-hero .logo-item img {
    max-width: 140px;
    width: auto; /* Changed from 100% to auto to maintain aspect ratio */
    height: auto;
    object-fit: contain;
    transition: all 0.4s ease;
    filter: grayscale(0);
    opacity: 1; /* Changed from 0.95 to 1 for better visibility */
    /* Standardize dimensions for all logos */
    min-height: 60px;
    max-height: 70px; /* Reduced from 80px for more consistency */
}

.partners-in-hero .logo-item:hover img {
    transform: scale(1.08);
    opacity: 1;
}

/* Add specific styles for larger logo items in partners section */
.partners-in-hero .logo-item-large {
    min-width: 220px;
    height: 100px; /* Same height as regular items */
}

.partners-in-hero .logo-item-large img {
    max-width: 180px;
    min-height: 60px;
    max-height: 85px; /* Increased from 70px to allow larger logos */
    transform: scale(1.2);
}

/* Make sure hover effect works properly on larger items too */
.partners-in-hero .logo-item-large:hover img {
    transform: scale(1.3); /* Slightly larger scale on hover */
    opacity: 1;
}

/* Pause animation on hover of the container, not individual items */
.partners-in-hero:hover .logo-carousel {
    animation-play-state: paused !important;
}

/* Ensure the carousel pauses when the class is applied */
.logo-carousel.paused {
    animation-play-state: paused !important;
}

/* Ensure smooth transition after hover */
.partners-in-hero .logo-carousel {
    animation-play-state: running;
}

/* Media Queries */
@media (max-width: 1024px) {
    .partners-in-hero .container {
        max-width: 100%;
        padding: 0 20px;
    }
    
    .partners-title {
        font-size: 1.1rem;
    }
    
    /* Responsive styles for larger logo items */
    .logo-item-large {
        min-width: 200px;
        height: 100px; /* Same as regular items */
    }
    
    .logo-item-large img {
        max-width: 160px;
        min-height: 60px; /* Same as regular logos */
        max-height: 70px; /* Same as regular logos */
        transform: scale(1.2); /* Use scale instead of larger height */
    }
}

@media (max-width: 768px) {
    .logo-carousel {
        gap: 40px;
        padding: 15px 0;
    }

    .logo-item,
    .logo-item-large {
        min-width: 140px;
        height: 80px;
        padding: 10px;
    }

    .logo-item img,
    .logo-item-large img {
        max-width: 120px;
        min-height: 40px;
        max-height: 50px;
    }

    .partners-in-hero {
        padding: 30px 0;
    }

    .partners-in-hero .logo-item {
        min-width: 130px;
        height: 80px; /* Adjusted height for medium screens */
        padding: 10px;
    }

    .partners-in-hero .logo-item img {
        max-width: 110px;
        min-height: 50px; /* Adjusted min-height */
        max-height: 60px; /* Adjusted max-height */
    }
    
    /* Add responsive styles for larger logo items in partners section */
    .partners-in-hero .logo-item-large {
        min-width: 170px;
        height: 80px; /* Same as regular items at this breakpoint */
    }
    
    .partners-in-hero .logo-item-large img {
        max-width: 140px;
        min-height: 50px;
        max-height: 75px; /* Increased for better visibility */
        transform: scale(1.2);
    }
    
    .partners-title {
        font-size: 1rem;
        margin-bottom: 25px;
    }

    .partners-title::after {
        width: 50px;
        height: 2px;
        bottom: -6px;
    }
}

@media (max-width: 480px) {
    .logo-carousel {
        gap: 30px;
        padding: 10px 0;
    }

    .logo-item,
    .logo-item-large {
        min-width: 120px;
        height: 70px;
        padding: 8px;
    }

    .logo-item img,
    .logo-item-large img {
        max-width: 100px;
        min-height: 35px;
        max-height: 45px;
    }
    
    .partners-in-hero {
        padding: 25px 0;
    }
    
    .partners-in-hero .logo-item {
        min-width: 110px;
        height: 70px; /* Adjusted height for small screens */
        padding: 8px;
    }
    
    .partners-in-hero .logo-item img {
        max-width: 90px;
        min-height: 40px; /* Adjusted min-height */
        max-height: 50px; /* Adjusted max-height */
    }
    
    /* Add responsive styles for larger logo items in partners section on small screens */
    .partners-in-hero .logo-item-large {
        min-width: 140px;
        height: 70px; /* Same as regular items at this breakpoint */
    }
    
    .partners-in-hero .logo-item-large img {
        max-width: 120px;
        min-height: 40px;
        max-height: 50px;
        transform: scale(1.15);
    }
    
    .partners-title {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }

    .partners-title::after {
        width: 40px;
        bottom: -5px;
    }
}

/* Remove the fixHoverSpeed animation that might be causing issues */
/* Fix for animation speed after hover */
@keyframes fixHoverSpeed {
    from { opacity: 0.999; }
    to { opacity: 1; }
}

/* Apply a dummy animation to force redraw without affecting appearance */
.partners-in-hero:hover .logo-carousel::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    /* Remove the animation that might be causing issues */
    pointer-events: none;
}

/* Ensure animation speed remains consistent */
.partners-in-hero .logo-carousel {
    will-change: transform;
    backface-visibility: hidden;
} 