/* ==========================================================================
   Carousel - Slide "Match(s) du week-end"
   Extrait du bloc <style> de templates/carousel/match-weekend-slide.html
   Keyframes mutualisés (slideInDown/slideInUp/fadeIn/bounce/slideInLeft/
   drift) : voir carousel.css
   ========================================================================== */

.match-weekend-slide {
    position: relative;
    min-height: 450px;
    height: auto;
    border-radius: 16px;
    overflow: visible;
    display: flex;
    align-items: center;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    background-attachment: fixed;
}

.match-weekend-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    animation: drift 20s infinite linear;
}

.slide-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.slide-header {
    text-align: center;
    margin-bottom: 1rem;
}

.slide-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: slideInDown 0.8s ease-out;
}

.bounce {
    animation: bounce 2s infinite;
}

.slide-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin: 0.5rem 0 0;
    animation: fadeIn 1s ease-out 0.3s both;
}

.matches-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: fit-content;
    margin: 0 auto;
    animation: slideInUp 0.8s ease-out 0.5s both;
    max-width: 100%;
}

/* Layout adaptatif selon le nombre de matchs */
.matches-container:has(.match-card-compact:nth-child(3)) {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem 1rem;
    width: 100%;
    max-width: 900px;
}

.matches-container:has(.match-card-compact:nth-child(5)) {
    grid-template-columns: repeat(3, 1fr);
    max-width: 100%;
    gap: 0.6rem;
}

.match-card-compact {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideInLeft 0.6s ease-out forwards;
    opacity: 0;
    transform: translateX(-30px);
    color: #374151;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    /* Taille fixe pour les rectangles */
    width: 320px;
    height: 160px;
    min-width: 320px;
    max-width: 320px;
    min-height: 160px;
    max-height: 160px;
    margin: 0 auto;
}

/* Ajustements pour grille avec 3+ matchs */
.matches-container:has(.match-card-compact:nth-child(3)) .match-card-compact {
    width: 300px;
    height: 155px;
    padding: 0.9rem 1.15rem;
}

.matches-container:has(.match-card-compact:nth-child(5)) .match-card-compact {
    width: 280px;
    height: 150px;
    padding: 0.85rem 1rem;
}

.match-card-compact[data-match-index="0"] { animation-delay: 0.7s; }
.match-card-compact[data-match-index="1"] { animation-delay: 0.9s; }
.match-card-compact[data-match-index="2"] { animation-delay: 1.1s; }

.match-card-compact:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Date et heure en header horizontal avec icône */
.match-datetime-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(var(--color-primary-rgb, 220, 38, 38), 0.15);
    flex-shrink: 0;
}

.match-day-compact {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--color-primary-600, #dc2626);
    text-transform: uppercase;
    background: rgba(var(--color-primary-rgb, 220, 38, 38), 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    border: 1px solid rgba(var(--color-primary-rgb, 220, 38, 38), 0.2);
}

.match-date-compact {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
}

.match-time-compact {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary-600, #dc2626);
    background: rgba(var(--color-primary-rgb, 220, 38, 38), 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.match-time-compact i {
    font-size: 0.65rem;
}


/* Équipes compactes sur une ligne - Design moderne */
.teams-compact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: space-between;
    flex: 1;
}

.team-compact {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1f2937;
    padding: 0.6rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(249, 250, 251, 0.9) 100%);
    border-radius: 12px;
    border: 2px solid rgba(0, 0, 0, 0.08);
    flex: 1;
    min-width: 0;
    max-width: 130px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    line-height: 1.2;
    word-break: break-word;
    hyphens: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
}

.team-compact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 12px 12px 0 0;
    transition: all 0.3s ease;
}

.team-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    border-color: rgba(0, 0, 0, 0.15);
}

.home-team-compact::before {
    background: linear-gradient(90deg, var(--color-primary-600, #dc2626) 0%, var(--color-primary-500, #ef4444) 100%);
}

.home-team-compact {
    border-color: rgba(var(--color-primary-rgb, 220, 38, 38), 0.2);
}

.home-team-compact:hover {
    border-color: rgba(var(--color-primary-rgb, 220, 38, 38), 0.4);
}

.away-team-compact::before {
    background: linear-gradient(90deg, #059669 0%, #10b981 100%);
}

.away-team-compact {
    border-color: rgba(5, 150, 105, 0.2);
}

.away-team-compact:hover {
    border-color: rgba(5, 150, 105, 0.4);
}

/* VS moderne avec icône */
.vs-compact {
    font-size: 0.7rem;
    font-weight: 800;
    color: #ffffff;
    background: linear-gradient(135deg, var(--color-primary-600, #dc2626) 0%, var(--color-primary-800, #991b1b) 100%);
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    text-transform: uppercase;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(var(--color-primary-rgb, 220, 38, 38), 0.3);
    letter-spacing: 0.5px;
}

/* Animations simplifiées pour le format compact */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}


.slide-footer {
    margin-top: auto;
    margin-bottom: 5px;
}

.cta-section {
    text-align: center;
}

.cta-text {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem;
    animation: fadeIn 1s ease-out 1.2s both;
}

.pulse {
    animation: pulse 1.5s infinite;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    animation: slideInUp 0.8s ease-out 1.4s both;
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-cta.primary {
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-cta.primary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-cta.secondary {
    background: transparent;
    color: inherit;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-cta.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
}

/* Ajustements pour 5+ matchs */
.matches-container:has(.match-card-compact:nth-child(5)) .team-compact {
    font-size: 0.7rem;
    max-width: 115px;
    padding: 0.5rem;
}

.matches-container:has(.match-card-compact:nth-child(5)) .match-day-compact,
.matches-container:has(.match-card-compact:nth-child(5)) .match-time-compact {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
}

.matches-container:has(.match-card-compact:nth-child(5)) .match-date-compact {
    font-size: 0.75rem;
}

.matches-container:has(.match-card-compact:nth-child(5)) .vs-compact {
    font-size: 0.65rem;
    padding: 0.3rem 0.45rem;
}

/* Responsive pour la version compacte */
@media (max-width: 768px) {
    .match-weekend-slide {
        height: auto;
        min-height: 400px;
        padding: 1.5rem;
    }

    .slide-title {
        font-size: 2rem;
    }

    .matches-container {
        gap: 0.6rem;
    }

    /* En mobile, toujours en colonne même avec 3+ matchs */
    .matches-container:has(.match-card-compact:nth-child(3)),
    .matches-container:has(.match-card-compact:nth-child(5)) {
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
    }

    .match-card-compact,
    .matches-container:has(.match-card-compact:nth-child(3)) .match-card-compact,
    .matches-container:has(.match-card-compact:nth-child(5)) .match-card-compact {
        padding: 0.9rem 1.1rem;
        width: 320px;
        height: 160px;
        min-width: 320px;
        max-width: 320px;
        min-height: 160px;
        max-height: 160px;
    }

    .match-datetime-header {
        flex-wrap: wrap;
        justify-content: center;
    }

    .match-day-compact,
    .match-time-compact,
    .matches-container:has(.match-card-compact:nth-child(5)) .match-day-compact,
    .matches-container:has(.match-card-compact:nth-child(5)) .match-time-compact {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }

    .match-date-compact,
    .matches-container:has(.match-card-compact:nth-child(5)) .match-date-compact {
        font-size: 0.8rem;
    }

    .team-compact,
    .matches-container:has(.match-card-compact:nth-child(5)) .team-compact {
        max-width: 130px;
        padding: 0.6rem;
        font-size: 0.75rem;
    }

    .vs-compact,
    .matches-container:has(.match-card-compact:nth-child(5)) .vs-compact {
        font-size: 0.7rem;
        padding: 0.35rem 0.5rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn-cta {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
}
