/* Link styling - prevent color changes */
.asso, .asso:hover, .asso:visited, .asso:focus, .asso:active {
    color: inherit !important;
    text-decoration: none !important;
}

.club, .club:hover, .club:visited, .club:focus, .club:active {
    color: black !important;
    text-decoration: none !important;
}

/* Section layout */
.section {
    color: white;
    display: flex;
    flex-direction: column;
    position: relative;
}

.section[data-gradient="true"]::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, var(--current-color) 0%, var(--next-color) 100%);
    z-index: 1;
    pointer-events: none;
}

/* Ensure gradient works on mobile */
@media (max-width: 767px) {
    .section[data-gradient="true"]::after {
        height: 80px;
        bottom: -40px;
        z-index: 1;
    }
}

@media (max-width: 575px) {
    .section[data-gradient="true"]::after {
        height: 70px;
        bottom: -35px;
        z-index: 1;
    }
}

/* Main clubciation header */
.asso {
    padding: 25px;
    text-align: center;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border: 4px solid white;
    width: 75%;
    margin: 80px auto 50px auto;
    border-radius: 30px;
    box-shadow: 0 8px 15px -6px #000000;
    transition: transform 0.3s ease;
}

/* Association titles */
.asso-title {
    font-size: 4rem;
    font-weight: bold;
    text-align: center;
    margin: 0;
    color: white;
}

.asso-subtitle {
    font-size: 1.8rem;
    text-align: center;
    margin: 0;
    color: white;
}

/* Mobile logos - hidden by default */
.mobile-logos {
    display: none;
}

.clubs-title {
    font-size: 2.5rem;
    font-weight: bold;
    text-align: center;
    margin: 0;
    color: white;
}

/* Logo images */
.asso .left img,
.asso .right img {
    max-height: 200px;
    max-width: 250px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Logo containers with fixed width */
.asso .left,
.asso .right {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 250px;
}

/* Text content in center - flexible */
.asso .center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
    position: relative;
}

/* Ensure titles are centered ignoring mobile logos */
.asso .center .asso-title,
.asso .center .asso-subtitle {
    margin: 0;
}

/* Hover effects */
.zoom:hover {
    transform: scale(1.05);
}

/* Club cards layout */
.grid-club {
    width: 90%;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin: 50px auto 120px auto;
    justify-content: center;
    max-width: 1320px; /* Base: 4 per row */
}

/* If remainder is 1: use 5 per row */
.grid-club.five-per-row {
    max-width: 1650px !important; /* 5 * 300px + 4 * 30px gaps */
}

/* Individual club cards */
.club {
    width: 300px;
    height: 320px;
    box-shadow: 0 10px 50px -10px #1f2121;
    border-radius: 30px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: white;
    color: black;
    font-size: 1.3rem;
    text-align: center;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    z-index: 2;
}

.club:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.club img {
    height: 180px;
    max-width: 260px;
    width: auto;
    margin: auto;
    object-fit: contain;
    border-radius: 15px;
    background: white;
}

/* Fade-in animation */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive design using Bootstrap breakpoints */

/* Large screens (992px and up) */
@media (min-width: 992px) {
    .grid-club {
        max-width: 1320px !important; /* Base: max 4 cards per row */
    }
    
    /* If remainder is 1: use 5 per row */
    .grid-club.five-per-row {
        max-width: 1650px !important; /* 5 * 300px + 4 * 30px gaps */
    }
    
    .club {
        width: 300px;
    }
    
    /* Hide mobile logos on desktop */
    .mobile-logos {
        display: none;
    }
}

/* Medium screens (768px to 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    /* Hide mobile logos on desktop */
    .mobile-logos {
        display: none;
    }
    
    .grid-club {
        gap: 20px;
        max-width: 1000px !important;
    }
    .grid-club.five-per-row {
        max-width: 1200px !important;
    }
    .club {
        width: 280px;
        height: 300px;
    }
    .club img {
        height: 160px;
        max-width: 240px;
    }
    .asso {
        width: 90%;
        gap: 15px;
        margin: 40px auto 40px auto;
    }
    .grid-club {
        margin: 40px auto 100px auto;
    }
    .asso-title {
        font-size: 3rem;
    }
    .asso-subtitle {
        font-size: 1.5rem;
    }
    .clubs-title {
        font-size: 2rem;
        margin: 0;
    }
}

/* Small screens (576px to 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    /* Hide original logos */
    .asso .left {
        display: none !important;
    }
    .asso .right {
        display: none !important;
    }
    .grid-club {
        gap: 20px;
        max-width: 600px !important;
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .grid-club.five-per-row {
        max-width: 600px !important;
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .club {
        width: 280px;
        height: 280px;
    }
    .club img {
        height: 140px;
        max-width: 220px;
    }
    .asso {
        width: 90%;
        flex-direction: column;
        gap: 15px;
        margin: 50px auto 40px auto;
        padding: 18px;
        border: 3px solid white;
    }
    .grid-club {
        margin: 30px auto 100px auto;
    }
    .asso-title {
        font-size: 2rem !important;
    }
    .asso-subtitle {
        font-size: 1.3rem !important;
    }
    .clubs-title {
        font-size: 1.5rem !important;
        margin: 0 !important;
    }
    .asso .left img,
    .asso .right img {
        max-width: 80px;
        max-height: 80px;
    }
    
    /* Show mobile logos */
    .mobile-logos {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 20px;
        margin-bottom: 25px;
    }
    
    .mobile-logo-left img,
    .mobile-logo-right img {
        max-height: 100px;
        max-width: 150px;
        object-fit: contain;
    }
}

/* Extra small screens (below 576px) */
@media (max-width: 575px) {
    /* Hide original logos */
    .asso .left {
        display: none !important;
    }
    .asso .right {
        display: none !important;
    }
    .grid-club {
        width: 100%;
        gap: 15px;
        padding: 0 10px;
        max-width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center;
    }
    .grid-club.five-per-row {
        max-width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .club {
        width: 90%;
        max-width: 320px;
        height: 260px;
        min-height: 260px;
    }
    .club img {
        height: 120px;
        max-width: 200px;
    }
    .asso {
        width: 90%;
        flex-direction: column;
        gap: 10px;
        margin: 40px auto 30px auto;
        padding: 15px;
        border: 2px solid white;
    }
    .grid-club {
        margin: 20px auto 90px auto;
    }
    .asso-title {
        font-size: 1.5rem !important;
    }
    .asso-subtitle {
        font-size: 1.1rem !important;
    }
    .clubs-title {
        font-size: 1.3rem !important;
        margin: 0 !important;
    }
    .asso .left img,
    .asso .right img {
        max-width: 60px;
        max-height: 60px;
    }
    
    /* Show mobile logos */
    .mobile-logos {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .mobile-logo-left img,
    .mobile-logo-right img {
        max-height: 100px;
        max-width: 150px;
        object-fit: contain;
    }
}

/* Breakpoint at 1200px as requested */
@media (max-width: 1200px) and (min-width: 768px) {
    /* Hide mobile logos on desktop */
    .mobile-logos {
        display: none;
    }
    
    /* Reduce text sizes on mobile */
    .asso-title {
        font-size: 3rem;
    }
    .asso-subtitle {
        font-size: 1.6rem;
    }
    .clubs-title {
        font-size: 2rem;
        margin: 0;
    }
    
    .asso .left img,
    .asso .right img {
        max-height: 150px;
        max-width: 200px;
    }
    
    .club {
        font-size: 1.1rem;
    }
    
    .club img {
        height: 140px;
        max-width: 220px;
    }
}